Skip to content

Commit d131c69

Browse files
Add universal uv-based installer for OG-Core and country repos
1 parent 1a3d8c9 commit d131c69

3 files changed

Lines changed: 1239 additions & 0 deletions

File tree

scripts/QUICK_INSTALL.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
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+
$f = "$env:TEMP\og-install.ps1"; irm https://raw.githubusercontent.com/PSLmodels/OG-Core/master/scripts/install.ps1 -OutFile $f; powershell -ExecutionPolicy Bypass -File $f
21+
```
22+
23+
(On Windows the installer is saved to a temp file and run from there, so it executes as a normal script.)
24+
25+
## Option 2 — Download, then run
26+
27+
Handy if you'd rather read the script first, or keep it to re-run later.
28+
29+
### macOS / Linux
30+
31+
```bash
32+
curl -fsSL https://raw.githubusercontent.com/PSLmodels/OG-Core/master/scripts/install.sh -o install.sh
33+
bash install.sh
34+
```
35+
36+
### Windows (PowerShell)
37+
38+
```powershell
39+
Invoke-WebRequest -UseBasicParsing -Uri https://raw.githubusercontent.com/PSLmodels/OG-Core/master/scripts/install.ps1 -OutFile install.ps1
40+
powershell -ExecutionPolicy Bypass -File .\install.ps1
41+
```
42+
43+
## Choosing a repo and skipping prompts
44+
45+
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:
46+
47+
- `--repo` / `-Repo` — a short key for a repo in the built-in catalog:
48+
- `og-core` — base model ([PSLmodels/OG-Core](https://github.com/PSLmodels/OG-Core))
49+
- `og-eth` — Ethiopia calibration ([EAPD-DRB/OG-ETH](https://github.com/EAPD-DRB/OG-ETH)); works once its uv migration lands
50+
- `--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.
51+
- `--branch` / `-Branch`**for development work**: install a non-default branch (e.g. a fork or a migration branch before it merges).
52+
- `--dest` / `-Dest` and `--yes` / `-Yes` — set the parent directory and skip the confirmation prompt.
53+
54+
```bash
55+
# macOS / Linux -- OG-Core to ~/Projects/OG-Core, no prompts
56+
bash install.sh --repo og-core --dest ~/Projects --yes
57+
# any repo by URL (default branch)
58+
bash install.sh --repo-url https://github.com/OWNER/OG-XYZ.git
59+
# a specific branch (development)
60+
bash install.sh --repo-url https://github.com/OWNER/OG-XYZ.git --branch my-feature
61+
```
62+
63+
```powershell
64+
# Windows -- OG-Core to C:\Users\<you>\Projects\OG-Core, no prompts
65+
powershell -ExecutionPolicy Bypass -File .\install.ps1 -Repo og-core -Dest C:\Users\$env:USERNAME\Projects -Yes
66+
# any repo by URL (default branch)
67+
powershell -ExecutionPolicy Bypass -File .\install.ps1 -RepoUrl https://github.com/OWNER/OG-XYZ.git
68+
```
69+
70+
More country calibrations get added to the catalog as they migrate to uv.
71+
72+
## After install
73+
74+
Activate the venv and you're set:
75+
76+
```bash
77+
# macOS / Linux
78+
cd <destination>
79+
source .venv/bin/activate
80+
python -W ignore -c "import ogcore; print(ogcore.__version__)"
81+
```
82+
83+
```powershell
84+
# Windows
85+
cd <destination>
86+
.\.venv\Scripts\Activate.ps1
87+
python -W ignore -c "import ogcore; print(ogcore.__version__)"
88+
```
89+
90+
(Swap `ogcore` for the package of the repo you installed — e.g. `ogeth` for OG-ETH.)

0 commit comments

Comments
 (0)