|
| 1 | +# Quick install |
| 2 | + |
| 3 | +A single installer for OG-Core and its country calibrations. Pre-req: **git** installed. Nothing else. |
| 4 | + |
| 5 | +It installs uv if needed, clones the repo you choose, runs `uv sync --extra dev`, and verifies the import. Pick the repo from a menu, or pass `--repo` / `-Repo`. |
| 6 | + |
| 7 | +You can run it two ways — paste a one-line command, or download the script and run it. Both do the same thing. |
| 8 | + |
| 9 | +## Option 1 — One-line |
| 10 | + |
| 11 | +### macOS / Linux |
| 12 | + |
| 13 | +```bash |
| 14 | +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/PSLmodels/OG-Core/master/scripts/install.sh)" |
| 15 | +``` |
| 16 | + |
| 17 | +### Windows (PowerShell) |
| 18 | + |
| 19 | +```powershell |
| 20 | +iex (irm https://raw.githubusercontent.com/PSLmodels/OG-Core/master/scripts/install.ps1) |
| 21 | +``` |
| 22 | + |
| 23 | +## Option 2 — Download, then run |
| 24 | + |
| 25 | +Handy if you'd rather read the script first, or keep it to re-run later. |
| 26 | + |
| 27 | +### macOS / Linux |
| 28 | + |
| 29 | +```bash |
| 30 | +curl -fsSL https://raw.githubusercontent.com/PSLmodels/OG-Core/master/scripts/install.sh -o install.sh |
| 31 | +bash install.sh |
| 32 | +``` |
| 33 | + |
| 34 | +### Windows (PowerShell) |
| 35 | + |
| 36 | +```powershell |
| 37 | +Invoke-WebRequest -UseBasicParsing -Uri https://raw.githubusercontent.com/PSLmodels/OG-Core/master/scripts/install.ps1 -OutFile install.ps1 |
| 38 | +powershell -ExecutionPolicy Bypass -File .\install.ps1 |
| 39 | +``` |
| 40 | + |
| 41 | +## Choosing a repo and skipping prompts |
| 42 | + |
| 43 | +By default the installer shows a menu of repos and prompts for a destination. Flags let you go straight there — they work with either method above: |
| 44 | + |
| 45 | +- `--repo` / `-Repo` — a short key for a repo in the built-in catalog: |
| 46 | + - `og-core` — base model ([PSLmodels/OG-Core](https://github.com/PSLmodels/OG-Core)) |
| 47 | + - `og-eth` — Ethiopia calibration ([EAPD-DRB/OG-ETH](https://github.com/EAPD-DRB/OG-ETH)); works once its uv migration lands |
| 48 | +- `--repo-url` / `-RepoUrl` — a full git URL, for any other uv-based repo (a fork, or a country repo not yet in the catalog). Clones the default branch. |
| 49 | +- `--branch` / `-Branch` — **for development work**: install a non-default branch (e.g. a fork or a migration branch before it merges). |
| 50 | +- `--dest` / `-Dest` and `--yes` / `-Yes` — set the parent directory and skip the confirmation prompt. |
| 51 | + |
| 52 | +```bash |
| 53 | +# macOS / Linux -- OG-Core to ~/Projects/OG-Core, no prompts |
| 54 | +bash install.sh --repo og-core --dest ~/Projects --yes |
| 55 | +# any repo by URL (default branch) |
| 56 | +bash install.sh --repo-url https://github.com/OWNER/OG-XYZ.git |
| 57 | +# a specific branch (development) |
| 58 | +bash install.sh --repo-url https://github.com/OWNER/OG-XYZ.git --branch my-feature |
| 59 | +``` |
| 60 | + |
| 61 | +```powershell |
| 62 | +# Windows -- OG-Core to C:\Users\<you>\Projects\OG-Core, no prompts |
| 63 | +powershell -ExecutionPolicy Bypass -File .\install.ps1 -Repo og-core -Dest C:\Users\$env:USERNAME\Projects -Yes |
| 64 | +# any repo by URL (default branch) |
| 65 | +powershell -ExecutionPolicy Bypass -File .\install.ps1 -RepoUrl https://github.com/OWNER/OG-XYZ.git |
| 66 | +``` |
| 67 | + |
| 68 | +More country calibrations get added to the catalog as they migrate to uv. |
| 69 | + |
| 70 | +## After install |
| 71 | + |
| 72 | +Activate the venv and you're set: |
| 73 | + |
| 74 | +```bash |
| 75 | +# macOS / Linux |
| 76 | +cd <destination> |
| 77 | +source .venv/bin/activate |
| 78 | +python -W ignore -c "import ogcore; print(ogcore.__version__)" |
| 79 | +``` |
| 80 | + |
| 81 | +```powershell |
| 82 | +# Windows |
| 83 | +cd <destination> |
| 84 | +.\.venv\Scripts\Activate.ps1 |
| 85 | +python -W ignore -c "import ogcore; print(ogcore.__version__)" |
| 86 | +``` |
| 87 | + |
| 88 | +(Swap `ogcore` for the package of the repo you installed — e.g. `ogeth` for OG-ETH.) |
0 commit comments