earwig / mwparserfromhell

A Python parser for MediaWiki wikicode
https://mwparserfromhell.readthedocs.io/
MIT License
757 stars 75 forks source link

Broken setup.py install #263

Closed lahwaacz closed 3 years ago

lahwaacz commented 3 years ago

setup.py install seems to install only .py files directly from src/mwparserfromhell, but skips all subdirectories:

$ python setup.py install --prefix=/usr --root=./install_root
...
$ tree install_root/
install_root/
└── usr
    └── lib
        └── python3.9
            └── site-packages
                ├── mwparserfromhell
                │   ├── definitions.py
                │   ├── __init__.py
                │   ├── parser
                │   │   └── _tokenizer.cpython-39-x86_64-linux-gnu.so
                │   ├── __pycache__
                │   │   ├── definitions.cpython-39.pyc
                │   │   ├── __init__.cpython-39.pyc
                │   │   ├── string_mixin.cpython-39.pyc
                │   │   ├── utils.cpython-39.pyc
                │   │   └── wikicode.cpython-39.pyc
                │   ├── string_mixin.py
                │   ├── utils.py
                │   └── wikicode.py
                └── mwparserfromhell-0.7.dev0-py3.9.egg-info
                    ├── dependency_links.txt
                    ├── PKG-INFO
                    ├── SOURCES.txt
                    └── top_level.txt

8 directories, 15 files

Note that all subpackages (nodes, parser, smart_list) were not installed:

$ tree src/mwparserfromhell
src/mwparserfromhell
├── definitions.py
├── __init__.py
├── nodes
│   ├── argument.py
│   ├── _base.py
│   ├── comment.py
│   ├── external_link.py
│   ├── extras
│   │   ├── attribute.py
│   │   ├── __init__.py
│   │   └── parameter.py
│   ├── heading.py
│   ├── html_entity.py
│   ├── __init__.py
│   ├── tag.py
│   ├── template.py
│   ├── text.py
│   └── wikilink.py
├── parser
│   ├── builder.py
│   ├── contexts.py
│   ├── ctokenizer
│   │   ├── avl_tree.c
│   │   ├── avl_tree.h
│   │   ├── common.h
│   │   ├── contexts.h
│   │   ├── definitions.c
│   │   ├── definitions.h
│   │   ├── tag_data.c
│   │   ├── tag_data.h
│   │   ├── textbuffer.c
│   │   ├── textbuffer.h
│   │   ├── tokenizer.c
│   │   ├── tokenizer.h
│   │   ├── tokens.c
│   │   ├── tokens.h
│   │   ├── tok_parse.c
│   │   ├── tok_parse.h
│   │   ├── tok_support.c
│   │   └── tok_support.h
│   ├── errors.py
│   ├── __init__.py
│   ├── tokenizer.py
│   └── tokens.py
├── smart_list
│   ├── __init__.py
│   ├── list_proxy.py
│   ├── smart_list.py
│   └── utils.py
├── string_mixin.py
├── utils.py
└── wikicode.py

5 directories, 47 files
earwig commented 3 years ago

Thanks. Fixed now, I think. I had removed a setuptools.find_packages() call but apparently it's still needed. I'd like to take this opportunity to complain about how annoying Python packaging is.

lahwaacz commented 3 years ago

Thanks. I also noticed that running setup.py test now does not execute any tests anymore (it used to work before pytest). Can you fix it or break it completely if the tests should be run differently?

earwig commented 3 years ago

setup.py test is apparently deprecated (source), but I agree it should either error or work. The latter seemed easier to do than the former, but it does depend on adding a deprecated dependency. (4e63226f6b6d7c7ba12eefaff88a8911e67697bd)