Closed niniack closed 3 days ago
I tried freshly cloning SAELens and running the commands as you specified but can't reproduce this error. I wonder if there's some issue with conda and paths being messed up? It looks like Python isn't recognizing tests.unit
as a valid module path. Maybe you can try something like PYTHONPATH=/home/nsa325/work/SAELens/ poetry run pytest tests/unit
to see if that helps conda realize where tests.unit
is located?
Yep, I figured out shortly after that it updating the PYTHONPATH var fixes the issue.
[tool.pytest.ini_options]
pythonpath = "."
I threw this in to pyproject.toml
and it helps Python recognize the tests path. From pytest documentation
pythonpath Sets list of directories that should be added to the python search path. Directories will be added to the head of sys.path. Similar to the PYTHONPATH environment variable, the directories will be included in where Python will look for imported modules. Paths are relative to the rootdir directory. Directories remain in path for the duration of the test session.
Thank you!
Describe the bug After a fresh install of SAELens, the shell command
make unit-test
fails.Code example
I install SAELens as follows:
poetry lock
poetry install
Then, as per the docs, I run
make check-ci
which outputsNext, I run
make unit-test
on its own and arrive at the same error again.System Info
I'm using a Linux machine with a conda environment. Given that I am on a restricted cluster, conda is how I should select an appropriate Python version.
Inside a Python shell:
Checklist