Skip to content

3.1.0 + master: pytest is failing #121

Description

@kloczek

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

Here is pytest output:

Details
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-intervaltree-3.1.0-8.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-intervaltree-3.1.0-8.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network'
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.8.16, pytest-7.2.0, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/intervaltree-3.1.0, configfile: setup.cfg
collected 99 items / 3 errors

========================================================================================== ERRORS ===========================================================================================
_________________________________________________________________________ ERROR collecting intervaltree/interval.py _________________________________________________________________________
/usr/lib/python3.8/site-packages/_pytest/runner.py:339: in from_call
    result: Optional[TResult] = func()
/usr/lib/python3.8/site-packages/_pytest/runner.py:370: in <lambda>
    call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
/usr/lib/python3.8/site-packages/_pytest/doctest.py:548: 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: ('intervaltree.interval', '/home/tkloczko/rpmbuild/BUILD/intervaltree-3.1.0/build/lib/intervaltree/interval.py', PosixPath('/home/tkloczko/rpmbuild/BUILD/intervaltree-3.1.0/intervaltree/interval.py'))
_______________________________________________________________________ ERROR collecting intervaltree/intervaltree.py _______________________________________________________________________
/usr/lib/python3.8/site-packages/_pytest/runner.py:339: in from_call
    result: Optional[TResult] = func()
/usr/lib/python3.8/site-packages/_pytest/runner.py:370: in <lambda>
    call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
/usr/lib/python3.8/site-packages/_pytest/doctest.py:548: 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: ('intervaltree.intervaltree', '/home/tkloczko/rpmbuild/BUILD/intervaltree-3.1.0/build/lib/intervaltree/intervaltree.py', PosixPath('/home/tkloczko/rpmbuild/BUILD/intervaltree-3.1.0/intervaltree/intervaltree.py'))
___________________________________________________________________________ ERROR collecting intervaltree/node.py ___________________________________________________________________________
/usr/lib/python3.8/site-packages/_pytest/runner.py:339: in from_call
    result: Optional[TResult] = func()
/usr/lib/python3.8/site-packages/_pytest/runner.py:370: in <lambda>
    call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
/usr/lib/python3.8/site-packages/_pytest/doctest.py:548: 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: ('intervaltree.node', '/home/tkloczko/rpmbuild/BUILD/intervaltree-3.1.0/build/lib/intervaltree/node.py', PosixPath('/home/tkloczko/rpmbuild/BUILD/intervaltree-3.1.0/intervaltree/node.py'))
================================================================================== short test summary info ==================================================================================
ERROR intervaltree/interval.py - _pytest.pathlib.ImportPathMismatchError: ('intervaltree.interval', '/home/tkloczko/rpmbuild/BUILD/intervaltree-3.1.0/build/lib/intervaltree/interval.py', PosixPath('/home/tkloczko/rpmb...
ERROR intervaltree/intervaltree.py - _pytest.pathlib.ImportPathMismatchError: ('intervaltree.intervaltree', '/home/tkloczko/rpmbuild/BUILD/intervaltree-3.1.0/build/lib/intervaltree/intervaltree.py', PosixPath('/home/tkloc...
ERROR intervaltree/node.py - _pytest.pathlib.ImportPathMismatchError: ('intervaltree.node', '/home/tkloczko/rpmbuild/BUILD/intervaltree-3.1.0/build/lib/intervaltree/node.py', PosixPath('/home/tkloczko/rpmbuild/BUI...
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
==================================================================================== 3 errors in 17.33s =====================================================================================

Here is list of installed modules in build env

Details
Package                       Version
----------------------------- -----------------
alabaster                     0.7.12
appdirs                       1.4.4
asn1crypto                    1.5.1
attrs                         22.2.0
Babel                         2.11.0
bcrypt                        3.2.2
Brlapi                        0.8.3
build                         0.9.0
cffi                          1.15.1
charset-normalizer            3.0.1
contourpy                     1.0.6
cryptography                  38.0.4
cssselect                     1.1.0
cycler                        0.11.0
distro                        1.8.0
dnspython                     2.2.1
docutils                      0.19
exceptiongroup                1.0.0
extras                        1.0.0
fixtures                      4.0.0
fonttools                     4.38.0
gpg                           1.18.0-unknown
idna                          3.4
imagesize                     1.4.1
importlib-metadata            5.1.0
iniconfig                     1.1.1
Jinja2                        3.1.2
kiwisolver                    1.4.4
libcomps                      0.1.19
louis                         3.24.0
lxml                          4.9.1
MarkupSafe                    2.1.1
matplotlib                    3.6.2
numpy                         1.24.1
olefile                       0.46
packaging                     21.3
pbr                           5.9.0
pep517                        0.13.0
Pillow                        9.3.0
pip                           22.3.1
pluggy                        1.0.0
ply                           3.11
psutil                        5.9.2
pyasn1                        0.4.8
pyasn1-modules                0.2.8
pycparser                     2.21
pyelftools                    0.28
Pygments                      2.13.0
PyGObject                     3.42.2
pyparsing                     3.0.9
pyserial                      3.5
PySocks                       1.7.1
pytest                        7.2.0
python-dateutil               2.8.2
pytz                          2022.4
PyYAML                        6.0
requests                      2.28.1
rpm                           4.17.0
scour                         0.38.2
setuptools                    65.6.3
six                           1.16.0
snowballstemmer               2.2.0
sortedcontainers              2.4.0
Sphinx                        5.3.0
sphinxcontrib-applehelp       1.0.2.dev20221204
sphinxcontrib-autoprogram     0.1.7
sphinxcontrib-devhelp         1.0.2.dev20221204
sphinxcontrib-htmlhelp        2.0.0
sphinxcontrib-jsmath          1.0.1.dev20221204
sphinxcontrib-qthelp          1.0.3.dev20221204
sphinxcontrib-serializinghtml 1.1.5
testtools                     2.5.0
tomli                         2.0.1
tpm2-pkcs11-tools             1.33.7
tpm2-pytss                    1.1.0
urllib3                       1.26.12
wheel                         0.38.4
zipp                          3.11.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions