Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ build/
venv/
venv
.venv/
*.egg-info/

# Generic Python caches/artifacts
__pycache__/
*.py[cod]
Expand All @@ -23,6 +25,10 @@ __pycache__/
.coverage.*
htmlcov/

# Installer log files
.install-*.log
scripts/.install-*.log

# OS artifacts
.DS_Store
Thumbs.db
Expand Down
45 changes: 45 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,48 @@
[project]
name = "muiogo"
version = "0.1.0"
description = "MUIOGO, integration project to bring the purely Python-based OG-Core model into MUIO, the GUI for OSeMOSYS (CLEWS)"
readme = "README.md"
requires-python = ">=3.10, <3.13"
dependencies = [
"blinker==1.8.2",
"boto3==1.34.122",
"botocore==1.34.122",
"click==8.1.7",
"colorama==0.4.6",
"et-xmlfile==1.1.0",
"Flask==3.0.3",
"Flask-Cors==4.0.1",
"itsdangerous==2.2.0",
"Jinja2==3.1.4",
"jmespath==1.0.1",
"MarkupSafe==2.1.5",
"numpy==1.26.4",
"openpyxl==3.1.4",
"packaging==24.0",
"pandas==2.2.2",
"python-dateutil==2.9.0.post0",
"python-dotenv==1.0.1",
"pytz==2024.1",
"s3transfer==0.10.1",
"tzdata==2024.1",
"waitress==3.0.0",
"Werkzeug==3.0.3",
]

[project.urls]
Homepage = "https://github.com/EAPD-DRB/MUIOGO"
"Issue Tracker" = "https://github.com/EAPD-DRB/MUIOGO/issues"

[tool.uv]
# MUIOGO is an application we run (python API/app.py), not a library that other
# code imports — so uv installs only the dependencies; it does not build or
# install MUIOGO itself as a package.
package = false

#----------------------------------------------------------------------------
# ruff
# ---------------------------------------------------------------------------
[tool.ruff]
target-version = "py310"
line-length = 120
Expand Down
77 changes: 70 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,88 @@
# Runtime dependencies - cross-platform (Windows / macOS / Linux)
# This file was autogenerated by uv via the following command:
# uv export --no-hashes --no-emit-project -o requirements.txt
blinker==1.8.2
# via
# flask
# muiogo
boto3==1.34.122
# via muiogo
botocore==1.34.122
# via
# boto3
# muiogo
# s3transfer
click==8.1.7
# via
# flask
# muiogo
colorama==0.4.6
# via
# click
# muiogo
et-xmlfile==1.1.0
Flask==3.0.3
Flask-Cors==4.0.1
# via
# muiogo
# openpyxl
flask==3.0.3
# via
# flask-cors
# muiogo
flask-cors==4.0.1
# via muiogo
itsdangerous==2.2.0
Jinja2==3.1.4
# via
# flask
# muiogo
jinja2==3.1.4
# via
# flask
# muiogo
jmespath==1.0.1
MarkupSafe==2.1.5
# via
# boto3
# botocore
# muiogo
markupsafe==2.1.5
# via
# jinja2
# muiogo
# werkzeug
numpy==1.26.4
# via
# muiogo
# pandas
openpyxl==3.1.4
# via muiogo
packaging==24.0
# via muiogo
pandas==2.2.2
# via muiogo
python-dateutil==2.9.0.post0
# via
# botocore
# muiogo
# pandas
python-dotenv==1.0.1
# via muiogo
pytz==2024.1
# via
# muiogo
# pandas
s3transfer==0.10.1
# via
# boto3
# muiogo
six==1.17.0
# via python-dateutil
tzdata==2024.1
# via
# muiogo
# pandas
urllib3==2.7.0
# via botocore
waitress==3.0.0
Werkzeug==3.0.3

# via muiogo
werkzeug==3.0.3
# via
# flask
# muiogo
85 changes: 85 additions & 0 deletions scripts/QUICK_INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Quick install

One command takes you from a clean machine to a running MUIOGO. The only pre-requisite is **git**; the installer adds `uv`, which brings the right Python and every dependency with it.

You can run it two ways — paste a one-line command, or download the script and run it. Both do the same thing.

## Option 1 — One line

### macOS / Linux

```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/EAPD-DRB/MUIOGO/main/scripts/install.sh)"
```

### Windows (PowerShell)

```powershell
$f = "$env:TEMP\muiogo-install.ps1"; irm https://raw.githubusercontent.com/EAPD-DRB/MUIOGO/main/scripts/install.ps1 -OutFile $f; powershell -ExecutionPolicy Bypass -File $f
```

(On Windows the installer is saved to a temp file and run from there, so it executes as a normal script.)

## Option 2 — Download, then run

Handy if you'd rather read the script first, or keep it to re-run later.

### macOS / Linux

```bash
curl -fsSL https://raw.githubusercontent.com/EAPD-DRB/MUIOGO/main/scripts/install.sh -o install.sh
bash install.sh
```

### Windows (PowerShell)

```powershell
Invoke-WebRequest -UseBasicParsing -Uri https://raw.githubusercontent.com/EAPD-DRB/MUIOGO/main/scripts/install.ps1 -OutFile install.ps1
powershell -ExecutionPolicy Bypass -File .\install.ps1
```

## What it does

1. Checks that git is installed (and tells you how to install it if it isn't).
2. Installs `uv` if it isn't already present (~5 MB, no admin needed).
3. Clones MUIOGO.
4. Runs `uv sync` — installs the right Python and all dependencies into a local `.venv`.
5. Platform setup — installs the GLPK and CBC solvers, downloads the demo data, creates the app secret key, and verifies everything.

It's safe to re-run: if MUIOGO is already there, it offers to update with `git pull` instead of cloning again.

## Options / skipping prompts

These work with either method above:

- `--dest DIR` / `-Dest` — parent folder to install into (MUIOGO is cloned as a subfolder). Default: current directory.
- `--branch BRANCH` / `-Branch` — install a non-default branch (for testing a fork or PR).
- `--repo-url URL` / `-RepoUrl` — clone from a different repository URL.
- `--yes` / `-Yes` — accept all prompts (non-interactive).
- `--no-demo-data` / `-NoDemoData` — skip the demo-data download.
- `--skip-uv-install` / `-SkipUvInstall` — assume `uv` is already installed.
- `--log` / `-Log` — write an install log file.

```bash
# macOS / Linux — install into ~/Projects/MUIOGO, no prompts
bash install.sh --dest ~/Projects --yes
```
```powershell
# Windows — install into C:\Users\<you>\Projects\MUIOGO, no prompts
powershell -ExecutionPolicy Bypass -File .\install.ps1 -Dest C:\Users\$env:USERNAME\Projects -Yes
```

## After install

```bash
# macOS / Linux
cd <destination>/MUIOGO
uv run python API/app.py
```
```powershell
# Windows
cd <destination>\MUIOGO
uv run python API\app.py
```

Then open <http://127.0.0.1:5002/> in your browser. (The installer also offers to start it for you at the end.)
Loading
Loading