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
Copy file name to clipboardExpand all lines: LINUX_SETUP.md
+88-15Lines changed: 88 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,65 +1,138 @@
1
1
# Developer setup (Linux)
2
2
3
-
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.
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
+
18
85
```bash
19
-
python3.10 -m pip install --user pipx
20
-
python3.10 -m pipx ensurepath
21
86
pipx install poetry
87
+
poetry python install 3.12
22
88
```
23
89
24
-
## 4. Create and activate development environment
90
+
## 5. Create development environment
91
+
25
92
```bash
26
-
poetry install
27
-
poetry shell
93
+
poetry env use 3.12
94
+
poetry install --extras dev
28
95
```
29
96
30
-
## 5. Install pre-commit hooks
97
+
## 6. Install pre-commit hooks
98
+
31
99
```bash
32
100
pipx install pre-commit
33
101
pre-commit install
34
102
```
35
103
36
104
Run pre-commit checks manually:
105
+
37
106
```bash
38
107
pre-commit run --all-files
39
108
```
40
109
41
-
## 6. Run tests
110
+
## 7. Run tests
42
111
43
112
Run fast unit tests using simulated data:
113
+
44
114
```bash
45
115
poetry run pytest -v tests/anoph
46
116
```
47
117
48
-
## 7. Google Cloud authentication (for legacy tests)
118
+
## 8. Google Cloud authentication (for legacy tests)
49
119
50
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).
51
121
52
122
Once access has been granted, [install the Google Cloud CLI](https://cloud.google.com/sdk/docs/install):
0 commit comments