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

tests/helpers.py is missing in 3.2.0 PyPI sdist #234

Open
mgorny opened this issue Jun 3, 2024 · 2 comments
Open

tests/helpers.py is missing in 3.2.0 PyPI sdist #234

mgorny opened this issue Jun 3, 2024 · 2 comments

Comments

@mgorny
Copy link

mgorny commented Jun 3, 2024

When running the test suite from PyPI sdist for 3.2.0, I'm getting errors like the following:

_______________________________________________ ERROR collecting tests/test_ulinalg.py ________________________________________________
ImportError while importing test module '/tmp/portage/dev-python/uncertainties-3.2.0/work/uncertainties-3.2.0/tests/test_ulinalg.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.10/site-packages/_pytest/python.py:492: in importtestmodule
    mod = import_path(
/usr/lib/python3.10/site-packages/_pytest/pathlib.py:591: in import_path
    importlib.import_module(module_name)
/usr/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1050: in _gcd_import
    ???
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:688: in _load_unlocked
    ???
/usr/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:178: in exec_module
    exec(co, module.__dict__)
tests/test_ulinalg.py:11: in <module>
    from helpers import uarrays_close
E   ModuleNotFoundError: No module named 'helpers'

Indeed, tests/helpers.py is not included in the sdist.

@wshanks
Copy link
Collaborator

wshanks commented Jun 3, 2024

Sorry about that. I opened #235 for this.

#235 should be enough. I opened #232 to make sure that the installed package files are tested and not the files in the repo. We could go further and make sure the files from the sdist are used for testing as well 🤔 I haven't noticed other projects going that far though.

@newville
Copy link
Member

newville commented Jun 3, 2024

@mgorny Yeah, thanks and sorry for the trouble. It looks like the building of the ".tar.gz" file included many of the files in "tests", but not the "helpers.py" file. I'm not sure why that is.

We're finding a few packaging- and release-related buglets.
I suspect that we will need to release a 3.2.1 relatively soon to fix these kinds of problems.

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

3 participants