I am working on a brand new project and created a project with the latest cookiecutter template. However, with nothing added, it still fails in the nox sessions for tests and typeguard.
The error seen is given below but it boils down to not being able to import the package I am building.
➜ poetry run nox -rs tests-3.10
nox > Running session tests-3.10
nox > Re-using existing virtual environment at .nox/tests-3-10.
nox > poetry build --format=wheel
nox > pip uninstall --yes file:///Users/asimami/experiments/BrainfoamKit/dist/BrainfoamKit-0.0.1-py3-none-any.whl
nox > python -m pip install --constraint=.nox/tests-3-10/tmp/requirements.txt file:///Users/asimami/experiments/BrainfoamKit/dist/BrainfoamKit-0.0.1-py3-none-any.whl
nox > python -m pip install --constraint=.nox/tests-3-10/tmp/requirements.txt 'coverage[toml]' pytest pygments
nox > coverage run --parallel -m pytest
=============================================================================================== test session starts ================================================================================================
platform darwin -- Python 3.10.4, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /Users/asimami/experiments/BrainfoamKit
collected 0 items / 1 error
====================================================================================================== ERRORS ======================================================================================================
_______________________________________________________________________________________ ERROR collecting tests/test_main.py ________________________________________________________________________________________
ImportError while importing test module '/Users/asimami/experiments/BrainfoamKit/tests/test_main.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/Cellar/python@3.10/3.10.4/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_main.py:5: in <module>
from BrainfoamKit import __main__
E ModuleNotFoundError: No module named 'BrainfoamKit'
============================================================================================= short test summary info ==============================================================================================
ERROR tests/test_main.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
================================================================================================= 1 error in 0.19s =================================================================================================
/Users/asimami/experiments/BrainfoamKit/.nox/tests-3-10/lib/python3.10/site-packages/coverage/inorout.py:517: CoverageWarning: Module BrainfoamKit was never imported. (module-not-imported)
self.warn(f"Module {pkg} was never imported.", slug="module-not-imported")
nox > Command coverage run --parallel -m pytest failed with exit code 2
nox > Session tests-3.10 failed.
nox > Running session coverage
nox > Re-using existing virtual environment at .nox/coverage.
nox > python -m pip install --constraint=.nox/coverage/tmp/requirements.txt 'coverage[toml]'
nox > coverage combine
Combined data file .coverage.IAmGroot.69101.630021
nox > coverage report
Name Stmts Miss Branch BrPart Cover Missing
----------------------------------------------------------------
tests/__init__.py 0 0 0 0 100%
tests/test_main.py 9 6 0 0 33% 8-17
----------------------------------------------------------------
TOTAL 9 6 0 0 33%
Coverage failure: total of 33 is less than fail-under=100
nox > Command coverage report failed with exit code 2
nox > Session coverage failed.
nox > Ran multiple sessions:
nox > * tests-3.10: failed
nox > * coverage: failed
Things I have tried
I have tried cleaning out any rogue python installations on my system
I have removed and reinstalled cookiecutter, poetry and pyenv and the python versions (3.7-3.10)
Hi,
I am working on a brand new project and created a project with the latest cookiecutter template. However, with nothing added, it still fails in the nox sessions for tests and typeguard.
The error seen is given below but it boils down to not being able to import the package I am building.
Things I have tried
cookiecutter
,poetry
andpyenv
and the python versions (3.7-3.10)A complete log of my nox run is here: https://gist.github.com/AliSajid/e884d6d93cbe03a3f6433e2d1b648413
Tool versions
Python 3.10.4
brainfoamkit 0.0.1
Poetry version 1.1.13
Cookiecutter 1.7.3 from /Users/asimami/.local/pipx/venvs/cookiecutter/lib/python3.10/site-packages (Python 3.1)
nox 2022.1.7