sphinx-contrib / autoprogram

Documenting CLI programs
https://pypi.org/project/sphinxcontrib-autoprogram/
Other
44 stars 23 forks source link

0.1.8: pytest is failing with ` module 'autoprogram' has no attribute 'add_directive'` #65

Open kloczek opened 1 year ago

kloczek commented 1 year ago

I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

Here is pytest output:

```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-sphinxcontrib-autoprogram-0.1.8-3.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-sphinxcontrib-autoprogram-0.1.8-3.fc35.x86_64/usr/lib/python3.8/site-packages + /usr/bin/pytest -ra -m 'not network' sphinxcontrib/autoprogram.py ==================================================================================== test session starts ==================================================================================== platform linux -- Python 3.8.17, pytest-7.4.0, pluggy-1.2.0 rootdir: /home/tkloczko/rpmbuild/BUILD/autoprogram-0.1.8 collected 8 items sphinxcontrib/autoprogram.py EEEEEEEE [100%] ========================================================================================== ERRORS =========================================================================================== __________________________________________________________________ ERROR at setup of ScannerTestCase.test_argument_groups ___________________________________________________________________ app = def setup(app) -> Dict[str, bool]: > app.add_directive("autoprogram", AutoprogramDirective) E AttributeError: module 'autoprogram' has no attribute 'add_directive' sphinxcontrib/autoprogram.py:338: AttributeError ______________________________________________________________________ ERROR at setup of ScannerTestCase.test_choices _______________________________________________________________________ app = def setup(app) -> Dict[str, bool]: > app.add_directive("autoprogram", AutoprogramDirective) E AttributeError: module 'autoprogram' has no attribute 'add_directive' sphinxcontrib/autoprogram.py:338: AttributeError ____________________________________________________________________ ERROR at setup of ScannerTestCase.test_parse_epilog ____________________________________________________________________ app = def setup(app) -> Dict[str, bool]: > app.add_directive("autoprogram", AutoprogramDirective) E AttributeError: module 'autoprogram' has no attribute 'add_directive' sphinxcontrib/autoprogram.py:338: AttributeError ___________________________________________________________________ ERROR at setup of ScannerTestCase.test_simple_parser ____________________________________________________________________ app = def setup(app) -> Dict[str, bool]: > app.add_directive("autoprogram", AutoprogramDirective) E AttributeError: module 'autoprogram' has no attribute 'add_directive' sphinxcontrib/autoprogram.py:338: AttributeError ____________________________________________________________________ ERROR at setup of ScannerTestCase.test_subcommands _____________________________________________________________________ app = def setup(app) -> Dict[str, bool]: > app.add_directive("autoprogram", AutoprogramDirective) E AttributeError: module 'autoprogram' has no attribute 'add_directive' sphinxcontrib/autoprogram.py:338: AttributeError _______________________________________________________________ ERROR at setup of AutoprogramDirectiveTestCase.test_make_rst ________________________________________________________________ app = def setup(app) -> Dict[str, bool]: > app.add_directive("autoprogram", AutoprogramDirective) E AttributeError: module 'autoprogram' has no attribute 'add_directive' sphinxcontrib/autoprogram.py:338: AttributeError _____________________________________________________________________ ERROR at setup of UtilTestCase.test_import_object _____________________________________________________________________ app = def setup(app) -> Dict[str, bool]: > app.add_directive("autoprogram", AutoprogramDirective) E AttributeError: module 'autoprogram' has no attribute 'add_directive' sphinxcontrib/autoprogram.py:338: AttributeError ______________________________________________________________________ ERROR at setup of test_case.test_import_object _______________________________________________________________________ app = def setup(app) -> Dict[str, bool]: > app.add_directive("autoprogram", AutoprogramDirective) E AttributeError: module 'autoprogram' has no attribute 'add_directive' sphinxcontrib/autoprogram.py:338: AttributeError ================================================================================== short test summary info ================================================================================== ERROR sphinxcontrib/autoprogram.py::ScannerTestCase::test_argument_groups - AttributeError: module 'autoprogram' has no attribute 'add_directive' ERROR sphinxcontrib/autoprogram.py::ScannerTestCase::test_choices - AttributeError: module 'autoprogram' has no attribute 'add_directive' ERROR sphinxcontrib/autoprogram.py::ScannerTestCase::test_parse_epilog - AttributeError: module 'autoprogram' has no attribute 'add_directive' ERROR sphinxcontrib/autoprogram.py::ScannerTestCase::test_simple_parser - AttributeError: module 'autoprogram' has no attribute 'add_directive' ERROR sphinxcontrib/autoprogram.py::ScannerTestCase::test_subcommands - AttributeError: module 'autoprogram' has no attribute 'add_directive' ERROR sphinxcontrib/autoprogram.py::AutoprogramDirectiveTestCase::test_make_rst - AttributeError: module 'autoprogram' has no attribute 'add_directive' ERROR sphinxcontrib/autoprogram.py::UtilTestCase::test_import_object - AttributeError: module 'autoprogram' has no attribute 'add_directive' ERROR sphinxcontrib/autoprogram.py::test_case::test_import_object - AttributeError: module 'autoprogram' has no attribute 'add_directive' ===================================================================================== 8 errors in 0.31s ===================================================================================== ```

Here is list of installed modules in build env

```console Package Version ----------------------------- ------- alabaster 0.7.13 Babel 2.12.1 build 0.10.0 charset-normalizer 3.2.0 distro 1.8.0 docutils 0.19 exceptiongroup 1.1.1 gpg 1.20.0 idna 3.4 imagesize 1.4.1 importlib-metadata 6.8.0 iniconfig 2.0.0 installer 0.7.0 Jinja2 3.1.2 libcomps 0.1.19 MarkupSafe 2.1.2 packaging 23.1 pluggy 1.2.0 Pygments 2.16.0 pyproject_hooks 1.0.0 pytest 7.4.0 python-dateutil 2.8.2 pytz 2023.2 requests 2.31.0 setuptools 68.0.0 six 1.16.0 snowballstemmer 2.2.0 Sphinx 6.2.1 sphinxcontrib-applehelp 1.0.4 sphinxcontrib-devhelp 1.0.2 sphinxcontrib-htmlhelp 2.0.0 sphinxcontrib-jsmath 1.0.1 sphinxcontrib-qthelp 1.0.3 sphinxcontrib-serializinghtml 1.1.5 tomli 2.0.1 urllib3 1.26.15 wheel 0.40.0 zipp 3.16.2 ```
kloczek commented 8 months ago

gentle ping .. any update? 🤔

langston-barrett commented 8 months ago

Honestly, I don't really have a good idea of why this is happening. You say you're trying to use a PEP517 build, so maybe fixing #72 will help?