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.8: pytest is failing #19

Open
kloczek opened this issue Apr 9, 2022 · 2 comments
Open

0.8: pytest is failing #19

kloczek opened this issue Apr 9, 2022 · 2 comments

Comments

@kloczek
Copy link

kloczek commented Apr 9, 2022

I'm trying to package 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>
  • run pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>

  • I'm usinh 0.8 + commits from master
  • Looks like latest pytest fails on collecting units.

Here is pytest output:

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-repoze-sphinx-autointerface-0.8-23.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-repoze-sphinx-autointerface-0.8-23.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra --import-mode=importlib
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.13, pytest-7.1.1, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/repoze.sphinx.autointerface-0.8
plugins: asyncio-0.18.2
asyncio: mode=legacy
collected 0 items / 1 error

================================================================================== ERRORS ==================================================================================
________________________________________________________ ERROR collecting repoze/sphinx/tests/test_autointerface.py ________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/repoze.sphinx.autointerface-0.8/repoze/sphinx/tests/test_autointerface.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
repoze/sphinx/tests/test_autointerface.py:3: in <module>
    from repoze.sphinx.tests.util import TestApp
../../BUILDROOT/python-repoze-sphinx-autointerface-0.8-23.fc35.x86_64/usr/lib/python3.8/site-packages/repoze/sphinx/tests/util.py:11: in <module>
    from sphinx.ext.autodoc import AutoDirective
E   ImportError: cannot import name 'AutoDirective' from 'sphinx.ext.autodoc' (/usr/lib/python3.8/site-packages/sphinx/ext/autodoc/__init__.py)
============================================================================= warnings summary =============================================================================
../../../../../usr/lib/python3.8/site-packages/pytest_asyncio/plugin.py:191
  /usr/lib/python3.8/site-packages/pytest_asyncio/plugin.py:191: DeprecationWarning: The 'asyncio_mode' default value will change to 'strict' in future, please explicitly use 'asyncio_mode=strict' or 'asyncio_mode=auto' in pytest configuration file.
    config.issue_config_time_warning(LEGACY_MODE, stacklevel=2)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
========================================================================= short test summary info ==========================================================================
ERROR repoze/sphinx/tests/test_autointerface.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
======================================================================= 1 warning, 1 error in 0.30s ========================================================================
@kloczek
Copy link
Author

kloczek commented Apr 9, 2022

First I've been thinking that I have already packahged that extencsion then I found that I found
https://www.sphinx-doc.org/en/master/extdev/deprecated.html which indicates that sphinx.ext.autodoc is already deprecated.

@kloczek
Copy link
Author

kloczek commented May 26, 2022

Just tested new 1.0.0 and looks like it is one warning 😋

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-repoze-sphinx-autointerface-1.0.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-repoze-sphinx-autointerface-1.0.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/repoze.sphinx.autointerface-1.0.0
plugins: hypothesis-6.41.0
collected 2 items

repoze/sphinx/tests/test_autointerface.py ..                                                                                                                         [100%]

============================================================================= warnings summary =============================================================================
repoze/sphinx/tests/util.py:31
  /home/tkloczko/rpmbuild/BUILD/repoze.sphinx.autointerface-1.0.0/repoze/sphinx/tests/util.py:31: PytestCollectionWarning: cannot collect test class 'TestApp' because it has a __init__ constructor (from: repoze/sphinx/tests/test_autointerface.py)
    class TestApp(application.Sphinx):

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
======================================================================= 2 passed, 1 warning in 0.51s =======================================================================

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

1 participant