|
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. |
| 3 | +## 1. Install Git |
| 4 | + |
| 5 | +Choose the command for your Linux distribution: |
| 6 | + |
| 7 | +**Ubuntu, Debian, and Mint:** |
| 8 | + |
| 9 | +```bash |
| 10 | +sudo apt update |
| 11 | +sudo apt install -y git |
| 12 | +``` |
| 13 | + |
| 14 | +**Fedora:** |
4 | 15 |
|
5 | | -## 1. Fork and clone this repo |
6 | 16 | ```bash |
7 | | -git clone git@github.com:[username]/malariagen-data-python.git |
| 17 | +sudo dnf install -y git |
| 18 | +``` |
| 19 | + |
| 20 | +**Arch Linux:** |
| 21 | + |
| 22 | +```bash |
| 23 | +sudo pacman -S sudo |
| 24 | +sudo pacman -S git |
| 25 | +sudo pacman -S openssh |
| 26 | +``` |
| 27 | + |
| 28 | +If your Arch install does not have `sudo` configured yet, run the commands above as `root`, then configure `sudo` for your user. |
| 29 | + |
| 30 | +## 2. Fork and clone this repo |
| 31 | + |
| 32 | +After forking the repository on GitHub, clone your fork. |
| 33 | + |
| 34 | +Use SSH if your SSH keys are set up: |
| 35 | + |
| 36 | +```bash |
| 37 | +git clone git@github.com:[YOUR_GITHUB_USERNAME]/malariagen-data-python.git |
8 | 38 | cd malariagen-data-python |
9 | 39 | ``` |
10 | 40 |
|
11 | | -## 2. Install Python |
| 41 | +Use HTTPS if you prefer, or if you do not have SSH keys configured (common on WSL): |
| 42 | + |
| 43 | +```bash |
| 44 | +git clone https://github.com/[YOUR_GITHUB_USERNAME]/malariagen-data-python.git |
| 45 | +cd malariagen-data-python |
| 46 | +``` |
| 47 | + |
| 48 | +## 3. Install pipx |
| 49 | + |
| 50 | +Choose the command for your Linux distribution: |
| 51 | + |
| 52 | +**Ubuntu, Debian, and Mint:** |
| 53 | + |
| 54 | +```bash |
| 55 | +sudo apt update |
| 56 | +sudo apt install -y pipx |
| 57 | +pipx ensurepath |
| 58 | +``` |
| 59 | + |
| 60 | +**Fedora:** |
| 61 | + |
| 62 | +```bash |
| 63 | +sudo dnf install -y pipx |
| 64 | +pipx ensurepath |
| 65 | +``` |
| 66 | + |
| 67 | +**Arch Linux:** |
| 68 | + |
12 | 69 | ```bash |
13 | | -sudo add-apt-repository ppa:deadsnakes/ppa |
14 | | -sudo apt install python3.10 python3.10-venv |
| 70 | +sudo pacman -S python-pipx |
| 71 | +pipx ensurepath |
15 | 72 | ``` |
16 | 73 |
|
17 | | -## 3. Install pipx and poetry |
| 74 | +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): |
| 123 | + |
53 | 124 | ```bash |
54 | 125 | ./install_gcloud.sh |
55 | 126 | ``` |
56 | 127 |
|
57 | 128 | Then obtain application-default credentials: |
| 129 | + |
58 | 130 | ```bash |
59 | 131 | ./google-cloud-sdk/bin/gcloud auth application-default login |
60 | 132 | ``` |
61 | 133 |
|
62 | 134 | Once authenticated, run legacy tests: |
| 135 | + |
63 | 136 | ```bash |
64 | 137 | poetry run pytest --ignore=tests/anoph -v tests |
65 | 138 | ``` |
|
0 commit comments