jaraco / pytest-checkdocs

MIT License
6 stars 5 forks source link

2.9.0: pytest is failing #18

Closed kloczek closed 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.

Prev version was OK. Here is pytest output:

```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-checkdocs-2.9.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-checkdocs-2.9.0-2.fc35.x86_64/usr/lib/python3.8/site-packages + /usr/bin/pytest -ra =========================================================================== test session starts ============================================================================ platform linux -- Python 3.8.14, pytest-7.1.3, pluggy-1.0.0 rootdir: /home/tkloczko/rpmbuild/BUILD/pytest-checkdocs-2.9.0, configfile: pytest.ini plugins: checkdocs-2.9.0 collected 2 items / 1 error ================================================================================== ERRORS ================================================================================== _____________________________________________________________ ERROR collecting pytest_checkdocs/py310compat.py _____________________________________________________________ /usr/lib/python3.8/site-packages/_pytest/runner.py:338: in from_call result: Optional[TResult] = func() /usr/lib/python3.8/site-packages/_pytest/runner.py:369: in call = CallInfo.from_call(lambda: list(collector.collect()), "collect") /usr/lib/python3.8/site-packages/_pytest/doctest.py:545: in collect module = import_path( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:556: in import_path raise ImportPathMismatchError(module_name, module_file, path) E _pytest.pathlib.ImportPathMismatchError: ('pytest_checkdocs.py310compat', '/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-checkdocs-2.9.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/pytest_checkdocs/py310compat.py', PosixPath('/home/tkloczko/rpmbuild/BUILD/pytest-checkdocs-2.9.0/pytest_checkdocs/py310compat.py')) ========================================================================= short test summary info ========================================================================== ERROR pytest_checkdocs/py310compat.py - _pytest.pathlib.ImportPathMismatchError: ('pytest_checkdocs.py310compat', '/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-checkd... !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ============================================================================= 1 error in 0.19s ============================================================================= ```

Here is list of installed modules in build env

```console Package Version ----------------------------- ----------------- alabaster 0.7.12 appdirs 1.4.4 attrs 22.1.0 Babel 2.10.2 Brlapi 0.8.3 build 0.8.0 charset-normalizer 2.1.0 codespell 2.2.1 cssselect 1.1.0 cycler 0.11.0 distro 1.7.0 dnspython 2.2.1 docutils 0.18.1 extras 1.0.0 fixtures 4.0.0 fonttools 4.37.3 gpg 1.17.1-unknown idna 3.4 imagesize 1.4.1 importlib-metadata 5.0.0 iniconfig 1.1.1 jaraco.packaging 9.1.1 Jinja2 3.1.1 kiwisolver 1.4.4 libcomps 0.1.19 louis 3.23.0 lxml 4.9.1 MarkupSafe 2.1.1 matplotlib 3.5.3 numpy 1.23.1 olefile 0.46 packaging 21.3 pbr 5.9.0 pep517 0.12.0 Pillow 9.2.0 pip 22.2.2 pluggy 1.0.0 py 1.11.0 Pygments 2.13.0 PyGObject 3.42.2 pyparsing 3.0.9 pytest 7.1.3 python-dateutil 2.8.2 pytz 2022.4 requests 2.28.1 rpm 4.17.0 rst.linker 2.3.1 scour 0.38.2 setuptools 65.4.1 setuptools-scm 7.0.5 six 1.16.0 snowballstemmer 2.2.0 Sphinx 5.2.3 sphinxcontrib-applehelp 1.0.2.dev20220730 sphinxcontrib-devhelp 1.0.2.dev20220730 sphinxcontrib-htmlhelp 2.0.0 sphinxcontrib-jsmath 1.0.1.dev20220730 sphinxcontrib-qthelp 1.0.3.dev20220730 sphinxcontrib-serializinghtml 1.1.5 testtools 2.5.0 tomli 2.0.1 typing_extensions 4.3.0 urllib3 1.26.12 wheel 0.37.1 zipp 3.9.0 ```
jaraco commented 1 year ago

There's nothing this project can do about these duplicate imports. I seem to recall you were able to work around issues like these by using --import-mode importlib. Maybe that will help.