Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kloczek opened this issue Aug 6, 2023 · 2 comments

Comments

@kloczek
Copy link

kloczek commented Aug 6, 2023

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.

  • python3 -sBm build -w --no-isolation
  • because I'm calling build with --no-isolation I'm using during all processes only locally installed modules
  • install .whl file in </install/prefix> using 'installer` module
  • run pytest with $PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>
  • build is performed in env which is cut off from access to the public network (pytest is executed with -m "not network")

Here is pytest output:

+ 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 = <module 'autoprogram' from '/home/tkloczko/rpmbuild/BUILD/autoprogram-0.1.8/sphinxcontrib/autoprogram.py'>

    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 = <module 'autoprogram' from '/home/tkloczko/rpmbuild/BUILD/autoprogram-0.1.8/sphinxcontrib/autoprogram.py'>

    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 = <module 'autoprogram' from '/home/tkloczko/rpmbuild/BUILD/autoprogram-0.1.8/sphinxcontrib/autoprogram.py'>

    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 = <module 'autoprogram' from '/home/tkloczko/rpmbuild/BUILD/autoprogram-0.1.8/sphinxcontrib/autoprogram.py'>

    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 = <module 'autoprogram' from '/home/tkloczko/rpmbuild/BUILD/autoprogram-0.1.8/sphinxcontrib/autoprogram.py'>

    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 = <module 'autoprogram' from '/home/tkloczko/rpmbuild/BUILD/autoprogram-0.1.8/sphinxcontrib/autoprogram.py'>

    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 = <module 'autoprogram' from '/home/tkloczko/rpmbuild/BUILD/autoprogram-0.1.8/sphinxcontrib/autoprogram.py'>

    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 = <module 'autoprogram' from '/home/tkloczko/rpmbuild/BUILD/autoprogram-0.1.8/sphinxcontrib/autoprogram.py'>

    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

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
Copy link
Author

kloczek commented Mar 13, 2024

gentle ping .. any update? 🤔

@langston-barrett
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants