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.0.6: test suite fails with pytest 8.2.1 #51

Open
kloczek opened this issue May 30, 2024 · 1 comment
Open

0.0.6: test suite fails with pytest 8.2.1 #51

kloczek opened this issue May 30, 2024 · 1 comment

Comments

@kloczek
Copy link
Contributor

kloczek commented May 30, 2024

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-crick-0.0.6-2.fc37.x86_64/usr/lib64/python3.10/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-crick-0.0.6-2.fc37.x86_64/usr/lib/python3.10/site-packages
+ /usr/bin/pytest -ra -m 'not network' --import-mode=importlib
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.10.14, pytest-8.2.1, pluggy-1.5.0
rootdir: /home/tkloczko/rpmbuild/BUILD/crick-0.0.6
configfile: setup.cfg
plugins: vcr-1.0.2
collected 0 items / 3 errors

========================================================================================== ERRORS ===========================================================================================
_____________________________________________________________________ ERROR collecting crick/tests/test_space_saving.py _____________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/crick-0.0.6/crick/tests/test_space_saving.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
crick/__init__.py:4: in <module>
    from .space_saving import SpaceSaving
E   ModuleNotFoundError: No module named 'crick.space_saving'
________________________________________________________________________ ERROR collecting crick/tests/test_stats.py _________________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/crick-0.0.6/crick/tests/test_stats.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
crick/tests/test_stats.py:7: in <module>
    from crick import SummaryStats
E   ImportError: cannot import name 'SummaryStats' from 'crick' (/home/tkloczko/rpmbuild/BUILD/crick-0.0.6/crick/__init__.py)
_______________________________________________________________________ ERROR collecting crick/tests/test_tdigest.py ________________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/crick-0.0.6/crick/tests/test_tdigest.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
crick/tests/test_tdigest.py:6: in <module>
    from crick import TDigest
E   ImportError: cannot import name 'TDigest' from 'crick' (/home/tkloczko/rpmbuild/BUILD/crick-0.0.6/crick/__init__.py)
================================================================================== short test summary info ==================================================================================
ERROR crick/tests/test_space_saving.py
ERROR crick/tests/test_stats.py
ERROR crick/tests/test_tdigest.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
===================================================================================== 3 errors in 0.24s =====================================================================================
List of installed modules in build env:
Package            Version
------------------ -----------
build              1.2.1
Cython             3.0.10
exceptiongroup     1.1.3
importlib_metadata 7.1.0
iniconfig          2.0.0
installer          0.7.0
numpy              1.26.4
packaging          24.0
pluggy             1.5.0
pyproject_hooks    1.0.0
pytest             8.2.1
python-dateutil    2.9.0.post0
scipy              1.12.0
setuptools         69.4.0
setuptools-scm     8.1.0
tokenize_rt        5.2.0
tomli              2.0.1
versioneer         0.29
wheel              0.43.0
zipp               3.19.0

Please let me know if you need more details or want me to perform some diagnostics.

@j08lue j08lue mentioned this issue Aug 9, 2024
@j08lue
Copy link

j08lue commented Aug 19, 2024

Is it intentional that crick is not installed in the build env? Should you not at least pip install -e it?

Why do the tests even run during the build? 🤔

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