You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you only need to run tests, `poetry install --with test` is sufficient.
61
+
48
62
**Recommended**: Use `poetry run` to run commands inside the virtual environment:
49
63
50
64
```bash
@@ -71,7 +85,7 @@ You'll need:
71
85
python script.py
72
86
```
73
87
74
-
5.**Install pre-commit hooks**
88
+
6.**Install pre-commit hooks**
75
89
76
90
```bash
77
91
pipx install pre-commit
@@ -107,16 +121,40 @@ You'll need:
107
121
108
122
4.**Run tests locally**
109
123
110
-
Fast unit tests (no external data access):
124
+
Fast unit tests using simulated data (no external data access):
111
125
112
126
```bash
113
-
poetry run pytest -v tests/anoph
127
+
poetry run pytest -v tests --ignore tests/integration
114
128
```
115
129
116
-
All unit tests (requires setting up credentials for legacy tests):
130
+
To run integration tests which read data from GCS, you'll need to [request access to MalariaGEN data on GCS](https://malariagen.github.io/vector-data/vobs/vobs-data-access.html).
131
+
132
+
Once access has been granted, [install the Google Cloud CLI](https://cloud.google.com/sdk/docs/install). E.g., if on Linux:
117
133
118
134
```bash
119
-
poetry run pytest -v tests --ignore tests/integration
135
+
./install_gcloud.sh
136
+
```
137
+
138
+
You'll then need to obtain application-default credentials, e.g.:
Tests will run slowly the first time, as data required for testing will be read from GCS. Subsequent runs will be faster as data will be cached locally in the "gcs_cache" folder.
151
+
152
+
6.**Run typechecking**
153
+
154
+
Run static typechecking with mypy:
155
+
156
+
```bash
157
+
poetry run mypy malariagen_data tests --ignore-missing-imports
120
158
```
121
159
122
160
5.**Check code quality**
@@ -150,7 +188,7 @@ ruff format .
150
188
-**Fast tests**: Unit tests should use simulated data when possible (see `tests/anoph/`)
151
189
-**Integration tests**: Tests requiring GCS data access are slower and run separately
152
190
153
-
Run type checking with:
191
+
Run dynamic type checking with:
154
192
155
193
```bash
156
194
poetry run pytest -v tests --typeguard-packages=malariagen_data,malariagen_data.anoph
Close and reopen your terminal to apply PATH changes.
75
+
If you prefer to reload the shell in-place, run:
76
+
77
+
```bash
78
+
exec bash
79
+
```
80
+
81
+
## 4. Install Poetry and Python 3.12
82
+
83
+
The package requires `>=3.10,<3.13`. We use Poetry's built-in installer to handle the Python version universally across all distributions.
84
+
85
+
```bash
86
+
pipx install poetry
87
+
poetry python install 3.12
88
+
```
89
+
90
+
## 5. Create development environment
91
+
92
+
```bash
93
+
poetry env use 3.12
94
+
poetry install --extras dev
95
+
```
96
+
97
+
## 6. Install pre-commit hooks
98
+
99
+
```bash
100
+
pipx install pre-commit
101
+
pre-commit install
102
+
```
103
+
104
+
Run pre-commit checks manually:
105
+
106
+
```bash
107
+
pre-commit run --all-files
108
+
```
109
+
110
+
## 7. Run tests
111
+
112
+
Run fast unit tests using simulated data:
113
+
114
+
```bash
115
+
poetry run pytest -v tests/anoph
116
+
```
117
+
118
+
## 8. Google Cloud authentication (for legacy tests)
119
+
120
+
To run legacy tests which read data from GCS, you'll need to [request access to MalariaGEN data on GCS](https://malariagen.github.io/vector-data/vobs/vobs-data-access.html).
121
+
122
+
Once access has been granted, [install the Google Cloud CLI](https://cloud.google.com/sdk/docs/install):
## 6. Google Cloud authentication (for legacy tests)
51
+
52
+
To run legacy tests which read data from GCS, you'll need to [request access to MalariaGEN data on GCS](https://malariagen.github.io/vector-data/vobs/vobs-data-access.html).
53
+
54
+
Once access has been granted, install the Google Cloud CLI:
55
+
```bash
56
+
brew install google-cloud-sdk
57
+
```
58
+
59
+
Then authenticate:
60
+
```bash
61
+
gcloud auth application-default login
62
+
```
63
+
64
+
This opens a browser — log in with any Google account.
65
+
66
+
Once authenticated, run legacy tests:
67
+
```bash
68
+
pytest --ignore=tests/anoph -v tests
69
+
```
70
+
71
+
Tests will run slowly the first time, as data will be read from GCS and cached locally in the `gcs_cache` folder.
72
+
73
+
## 7. VS Code terminal integration
74
+
75
+
To use the `code` command from the terminal:
76
+
77
+
Open VS Code → `Cmd + Shift + P` → type `Shell Command: Install 'code' command in PATH` → press Enter.
0 commit comments