-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
129 lines (115 loc) · 7.26 KB
/
Copy pathpyproject.toml
File metadata and controls
129 lines (115 loc) · 7.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
[project]
name = "ai-almanac"
version = "0.1.0"
description = "Local-first benchmarking platform for AI weather and climate models."
readme = "README.md"
requires-python = ">=3.12"
license = { text = "MIT" }
authors = [{ name = "AI Almanac contributors" }]
dependencies = [
"fastapi>=0.135.3",
"uvicorn[standard]>=0.44.0",
"sqlalchemy>=2.0.49",
"aiosqlite>=0.20.0",
"alembic>=1.18.4",
"pydantic-settings>=2.13.1",
"platformdirs>=4.3.6",
"typer>=0.15.1",
"python-dotenv>=1.0.1",
"pyyaml>=6.0.2",
"h5netcdf>=1.8.1",
"h5py>=3.16.0",
"netcdf4>=1.7.4",
"xarray>=2026.2.0",
"greenlet>=3.4.0",
# LLM/chat — kept for the LLM-centric UI surface.
"pydantic-ai>=2,<3",
"openai>=2.32.0",
"httpx>=0.28.1",
"matplotlib>=3.10.9",
"psycopg[binary]>=3.3.4,<4",
"cryptography>=48.0.1,<51", "google-cloud-storage>=3.12.0,<4", "gcsfs>=2026.5.0,<2027", "modal>=1.5.0,<2", "globus-sdk>=4.8.0,<5", "titiler-core>=2.0.5,<3", "certifi",
]
[project.scripts]
ai-almanac = "ai_almanac.cli:app"
[dependency-groups]
dev = [
"pytest>=9.0.3",
"pytest-asyncio>=1.3.0",
"ruff>=0.15.11",
"build>=1.5.0,<2",
]
[build-system]
requires = ["hatchling>=1.27.0"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/ai_almanac"]
[tool.hatch.build.targets.wheel.force-include]
# The SvelteKit SPA is built into web/build by `npm run build` and bundled
# into the wheel so `pip install ai-almanac` ships the UI.
"web/build" = "ai_almanac/server/static"
"modal/blending_app.py" = "ai_almanac/envs/blending_app.py"
[tool.hatch.build.targets.sdist]
# The wheel is built from the sdist by standard Python build frontends.
# Include the generated SPA even though web/build is ignored by Git.
artifacts = ["web/build", "modal/blending_app.py"]
[tool.ruff]
line-length = 100
target-version = "py312"
[tool.ruff.lint]
select = ["E", "F", "I", "UP", "B", "SIM"]
ignore = ["E501"]
[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"
asyncio_default_test_loop_scope = "session"
testpaths = ["tests"]
pythonpath = "."
[tool.pixi.workspace]
channels = ["conda-forge"]
platforms = ["osx-arm64", "linux-64", "linux-aarch64"]
[tool.pixi.pypi-dependencies]
ai-almanac = { path = ".", editable = true }
[tool.pixi.environments]
default = { solve-group = "default" }
dev = { features = ["dev"], solve-group = "default" }
[tool.pixi.tasks]
dev = { cmd = "process-compose -f process-compose.dev.yaml", description = "Run FastAPI reload and Vite HMR together" }
lint-python = { cmd = "ruff check src tests modal scripts evals", default-environment = "dev", description = "Lint Python sources and tests" }
format-python = { cmd = "ruff format src tests modal scripts evals", default-environment = "dev", description = "Format Python sources and tests" }
format-python-check = { cmd = "ruff format --check src tests modal scripts evals", default-environment = "dev", description = "Check Python formatting without modifying files" }
install-hooks = { cmd = "git config core.hooksPath .githooks", description = "Enable the repo's git hooks (pre-commit format/lint, pre-push check/test)" }
install-web = { cmd = "npm install", cwd = "web", description = "Install frontend dependencies" }
build-web = { cmd = "npm run build", depends-on = ["install-web"], cwd = "web", description = "Build the production frontend bundle" }
check-web = { cmd = "npm run check", depends-on = ["install-web"], cwd = "web", description = "Type-check the frontend" }
lint-web = { cmd = "npm run lint", depends-on = ["install-web"], cwd = "web", description = "Check frontend formatting (prettier)" }
format-web = { cmd = "npm run format", depends-on = ["install-web"], cwd = "web", description = "Format the frontend (prettier --write)" }
test-web = { cmd = "npm test -- --run", depends-on = ["install-web"], cwd = "web", description = "Run frontend tests" }
backend = { cmd = "ai-almanac serve --reload --no-open", description = "Run the FastAPI development server" }
test-python = { cmd = "pytest", default-environment = "dev", description = "Run Python tests" }
generate-api-types = { cmd = "bash scripts/generate-api-types.sh", default-environment = "dev", description = "Regenerate web/src/lib/api-types.gen.ts from the FastAPI OpenAPI schema" }
test-compose-e2e = { cmd = "./scripts/e2e-compose.sh", description = "Run the containerized PostgreSQL benchmark smoke flow" }
eval-assistant = { cmd = "python evals/assistant/run.py", default-environment = "dev", description = "Score the assistant's guardrails against adversarial prompts (calls a real model; --offline to check the harness for free)" }
self-host-local = { cmd = "./scripts/self-host-local.sh", description = "Start the local shared-mode development stack" }
self-host-local-gpu = { cmd = "./scripts/self-host-local.sh gpu", description = "Start local shared mode with the real Pixi GPU runner" }
self-host-local-gcs = { cmd = "./scripts/self-host-local.sh --storage gcs", description = "Start local shared mode with GCS storage" }
self-host-local-modal = { cmd = "./scripts/self-host-local.sh --storage gcs --runner modal", description = "Start local shared mode with GCS storage and Modal jobs" }
self-host-local-down = { cmd = "docker compose -p ai-almanac-local -f compose.local.yaml -f compose.local-gpu.yaml down", description = "Stop the local shared-mode development stack" }
self-host-local-reset = { cmd = "docker compose -p ai-almanac-local -f compose.local.yaml -f compose.local-gpu.yaml down --volumes", description = "Stop and delete local shared-mode development data" }
self-host-local-logs = { cmd = "docker compose -p ai-almanac-local -f compose.local.yaml -f compose.local-gpu.yaml logs --follow", description = "Follow local shared-mode development logs" }
package = { cmd = "python -m build", default-environment = "dev", depends-on = ["build-web"], description = "Build the Python wheel and source distribution" }
serve = { cmd = "ai-almanac serve --no-open", depends-on = ["build-web"], description = "Run a production-style server with the built frontend" }
deploy-modal = { cmd = "modal deploy modal/app.py", description = "Deploy the Modal benchmark app (run_benchmark + chat tools)" }
deploy-blending = { cmd = "modal deploy modal/blending_app.py", description = "Deploy the Modal blending app (run_blend)" }
deploy-forecasts = { cmd = "modal deploy modal/forecasts_app.py", description = "Deploy the Modal forecasts app (run_forecast)" }
test = { depends-on = [{ task = "test-python" }, { task = "test-web" }], description = "Run backend and frontend tests" }
check = { depends-on = [{ task = "lint-python" }, { task = "format-python-check" }, { task = "check-web" }, { task = "lint-web" }], description = "Run backend lint + format checks and frontend type + format checks" }
format = { depends-on = [{ task = "format-python" }, { task = "format-web" }], description = "Format backend and frontend sources" }
build = { depends-on = [{ task = "package" }], description = "Build frontend and Python distributions" }
frontend = { cmd = "npm run dev -- --host localhost", cwd = "web", env = { VITE_API_URL = "http://localhost:8765" }, description = "Run the Vite development server" }
[tool.pixi.dependencies]
nodejs = ">=26.3.0,<26.4"
process-compose = ">=1.103.0,<2"
rasterio = ">=1.5.0,<2"
gdal = ">=3.12.3,<4"
proj = ">=9.7.1,<10"