repoze / repoze.sphinx.autointerface

Auto-generate Sphinx API docs from Zope interfaces
http://pypi.python.org/pypi/repoze.sphinx.autointerface
Other
8 stars 7 forks source link

0.8: pytest is failing #19

Open kloczek opened 2 years ago

kloczek commented 2 years ago

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.

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 commented 2 years ago

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 commented 2 years ago

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 =======================================================================