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
To get setup for development, see [this video if you prefer VS Code](https://youtu.be/zddl3n1DCFM), or [this older video if you prefer PyCharm](https://youtu.be/QniQi-Hoo9A), and the instructions below.
## 7. Google Cloud authentication (for legacy tests)
49
+
50
+
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).
51
+
52
+
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.
Copy file name to clipboardExpand all lines: README.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,8 +44,11 @@ for release notes.
44
44
45
45
## Developer setup
46
46
47
-
To get setup for development, see [this video if you prefer VS Code](https://youtu.be/zddl3n1DCFM), or [this older video if you prefer PyCharm](https://youtu.be/QniQi-Hoo9A), and the instructions below.
47
+
To get setup for development, see [this video if you prefer VS Code](https://youtu.be/zddl3n1DCFM), or [this older video if you prefer PyCharm](https://youtu.be/QniQi-Hoo9A).
48
48
49
+
For detailed setup instructions, see:
50
+
-[Linux setup guide](LINUX_SETUP.md)
51
+
-[macOS setup guide](MACOS_SETUP.md)
49
52
Detailed instructions can be found in the [Contributors guide](https://github.com/malariagen/malariagen-data-python/blob/master/CONTRIBUTING.md).
0 commit comments