ImperialCollegeLondon / SWMManywhere

SWMManywhere is used to derive and simulate a sewer network anywhere in the world
https://imperialcollegelondon.github.io/SWMManywhere/
BSD 3-Clause "New" or "Revised" License
5 stars 1 forks source link

Tests failing unless installing package in editable mode #330

Closed AdrianDAlessandro closed 1 month ago

AdrianDAlessandro commented 1 month ago

The CONTRIBUTING docs say to install the development dependencies with: pip install .[dev,doc]

When I did this there were many test failures of the type:

______________________________________ ERROR collecting src/swmmanywhere/utilities.py _______________________________________
import file mismatch:
imported module 'swmmanywhere.utilities' has this __file__ attribute:
  /Users/adalessa/Projects/SWMManywhere/SWMManywhere/.venv/lib/python3.12/site-packages/swmmanywhere/utilities.py
which is not the same as the test file we want to collect:
  /Users/adalessa/Projects/SWMManywhere/SWMManywhere/src/swmmanywhere/utilities.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules

Solution:

The solution appears to be installing the package in editable mode pip install -e .[dev,doc]