|
| 1 | +# Developer setup (macOS) |
| 2 | + |
| 3 | +The Linux setup guide is available in [LINUX_SETUP.md](LINUX_SETUP.md). If you are on macOS, follow these steps instead. |
| 4 | + |
| 5 | +## 1. Install Miniconda |
| 6 | + |
| 7 | +Download and install Miniconda for macOS from https://docs.conda.io/en/latest/miniconda.html. |
| 8 | +Choose the Apple Silicon installer if you have an Apple Silicon Mac, or the Intel installer otherwise. You can check with: |
| 9 | +```bash |
| 10 | +uname -m |
| 11 | +# arm64 = Apple Silicon, x86_64 = Intel |
| 12 | +``` |
| 13 | + |
| 14 | +After installation, close and reopen your terminal for conda to be available. |
| 15 | + |
| 16 | +## 2. Create a conda environment |
| 17 | + |
| 18 | +The package requires Python `>=3.10, <3.13`. Python 3.13+ is not currently supported. |
| 19 | +```bash |
| 20 | +conda create -n malariagen python=3.11 |
| 21 | +conda activate malariagen |
| 22 | +``` |
| 23 | + |
| 24 | +## 3. Fork and clone this repo |
| 25 | + |
| 26 | +Fork the repository on GitHub, then clone your fork: |
| 27 | +```bash |
| 28 | +git clone git@github.com:[username]/malariagen-data-python.git |
| 29 | +cd malariagen-data-python |
| 30 | +pip install -e ".[dev]" |
| 31 | +``` |
| 32 | + |
| 33 | +## 4. Install pre-commit hooks |
| 34 | +```bash |
| 35 | +pre-commit install |
| 36 | +``` |
| 37 | + |
| 38 | +Run pre-commit checks manually: |
| 39 | +```bash |
| 40 | +pre-commit run --all-files |
| 41 | +``` |
| 42 | + |
| 43 | +## 5. Run tests |
| 44 | + |
| 45 | +Run fast unit tests using simulated data: |
| 46 | +```bash |
| 47 | +pytest -v tests/anoph |
| 48 | +``` |
| 49 | + |
| 50 | +## 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