-
Notifications
You must be signed in to change notification settings - Fork 99
Description
Hi team I am setting up my local environment to start contributing to the project and ran into a slight hurdle with the onboarding documentation.
Following the CONTRIBUTING.md guide, I ran poetry install and then attempted to run the recommended fast unit tests. However, the test suite instantly fails to collect, throwing 21 errors for a missing dependency.
The ERROR:
E ModuleNotFoundError: No module named 'pytest_cases'
================================================== short test summary info ===================================================
ERROR tests/anoph/test_base.py
ERROR tests/anoph/test_cnv_data.py
ERROR tests/anoph/test_cnv_frq.py
ERROR tests/anoph/test_describe.py
ERROR tests/anoph/test_dipclust.py
ERROR tests/anoph/test_distance.py
ERROR tests/anoph/test_fst.py
ERROR tests/anoph/test_g123.py
ERROR tests/anoph/test_genome_features.py
ERROR tests/anoph/test_genome_sequence.py
ERROR tests/anoph/test_h12.py
ERROR tests/anoph/test_h1x.py
ERROR tests/anoph/test_hap_data.py
ERROR tests/anoph/test_hap_frq.py
ERROR tests/anoph/test_hapclust.py
ERROR tests/anoph/test_igv.py
ERROR tests/anoph/test_pca.py
ERROR tests/anoph/test_plink_converter.py
ERROR tests/anoph/test_sample_metadata.py
ERROR tests/anoph/test_snp_data.py
ERROR tests/anoph/test_snp_frq.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 21 errors during collection
Steps to Reproduce (Verified in an isolated environment):
To ensure this wasn't just a misconfigured Python cache or a global package conflict on my own machine, I spun up a completely blank Ubuntu 22.04 Docker container, installed Python 3.10 and Poetry from scratch, and followed the exact commands in the guide. The exact same error occurred.
Here is the clean-room reproduction script:
docker run -it --rm ubuntu:22.04 bash
apt update && apt install -y software-properties-common git curl tzdata
add-apt-repository ppa:deadsnakes/ppa -y
apt update && apt install -y python3.10 python3.10-venv python3.10-dev pipx
export PATH="$PATH:/root/.local/bin"
pipx install poetry
git clone https://github.com/malariagen/malariagen-data-python.git
cd malariagen-data-python
poetry env use python3.10
poetry install
poetry run pytest -v tests/anoph
Root Cause & Workaround:
Looking at the dependency graph and lockfile, it appears pytest-cases is currently placed behind an optional marker (e.g., extra == "dev"). Because the standard poetry install command doesn't fetch these by default under the current configuration, the test dependencies are skipped.
I was able to successfully install the missing packages and get the test suite passing by manually fetching the extras:
poetry install --all-extras
Proposed Solution:
Did I miss a specific Poetry flag during the standard installation step, or should the CONTRIBUTING.md be updated to instruct new contributors to use the --all-extras flag when cloning?
If the documentation just needs a quick tweak, I would be more than happy to submit a Pull Request to update the guide so future contributors have a frictionless setup experience!