|
| 1 | +# Windows Setup Guide |
| 2 | + |
| 3 | +To get setup for development on Windows, see |
| 4 | +[this video if you prefer VS Code](https://youtu.be/zddl3n1DCFM), |
| 5 | +or [this older video if you prefer PyCharm](https://youtu.be/QniQi-Hoo9A), |
| 6 | +and the instructions below. |
| 7 | + |
| 8 | +## 1. Fork and clone this repo |
| 9 | +```bash |
| 10 | +git clone https://github.com/[username]/malariagen-data-python.git |
| 11 | +cd malariagen-data-python |
| 12 | +``` |
| 13 | + |
| 14 | +## 2. Install Python |
| 15 | + |
| 16 | +Download and install Python 3.10 from the official website: |
| 17 | +https://www.python.org/downloads/windows/ |
| 18 | + |
| 19 | +During installation, check the box that says Add Python to PATH |
| 20 | +before clicking Install. |
| 21 | + |
| 22 | +Verify the installation worked: |
| 23 | +```bash |
| 24 | +python --version |
| 25 | +``` |
| 26 | + |
| 27 | +## 3. Install pipx and poetry |
| 28 | +```bash |
| 29 | +python -m pip install --user pipx |
| 30 | +python -m pipx ensurepath |
| 31 | +pipx install poetry |
| 32 | +``` |
| 33 | + |
| 34 | +After running ensurepath, close and reopen PowerShell before continuing. |
| 35 | + |
| 36 | +## 4. Create and activate development environment |
| 37 | +```bash |
| 38 | +poetry install |
| 39 | +poetry shell |
| 40 | +``` |
| 41 | + |
| 42 | +## 5. Install pre-commit hooks |
| 43 | +```bash |
| 44 | +pipx install pre-commit |
| 45 | +pre-commit install |
| 46 | +``` |
| 47 | + |
| 48 | +## 6. Add upstream remote and get latest code |
| 49 | +```bash |
| 50 | +git remote add upstream https://github.com/malariagen/malariagen-data-python |
| 51 | +git pull upstream master |
| 52 | +``` |
| 53 | + |
| 54 | +Note: On Windows the default branch is called master, not main. |
| 55 | + |
| 56 | +## 7. Verify everything works |
| 57 | +```bash |
| 58 | +python -c "import malariagen_data; print('Setup successful!')" |
| 59 | +``` |
| 60 | + |
| 61 | +## Common Issues on Windows |
| 62 | + |
| 63 | +**poetry not found after install** |
| 64 | + |
| 65 | +Close and reopen PowerShell, then try again. |
| 66 | + |
| 67 | +**git not recognized** |
| 68 | + |
| 69 | +Install Git from https://git-scm.com/download/win |
| 70 | +and restart PowerShell. |
| 71 | + |
| 72 | +**python not recognized** |
| 73 | + |
| 74 | +Reinstall Python and make sure to check |
| 75 | +Add Python to PATH during installation. |
| 76 | + |
| 77 | +**fatal: not a git repository** |
| 78 | + |
| 79 | +Make sure you are inside the malariagen-data-python |
| 80 | +folder before running any git commands. |
| 81 | +```bash |
| 82 | +cd malariagen-data-python |
| 83 | +``` |
| 84 | + |
| 85 | +**error: pathspec main did not match** |
| 86 | + |
| 87 | +On Windows use master instead of main. |
| 88 | +```bash |
| 89 | +git checkout master |
| 90 | +``` |
0 commit comments