Skip to content

Commit a965ef8

Browse files
feat: consolidate GDS ecosystem into uv workspace monorepo
Migrate gds-framework, gds-viz, gds-games, and gds-examples from separate repos into a single monorepo with: - uv workspace resolution across all 4 packages - Shared ruff config (line-length 88, reformatted from 100) - Unified MkDocs Material docs site - GitHub Actions CI (matrix test), publish (tag-based OIDC), and docs (GitHub Pages) workflows - 745 tests passing across all packages
0 parents  commit a965ef8

239 files changed

Lines changed: 34604 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: astral-sh/setup-uv@v4
15+
- run: uv sync
16+
- run: uv run ruff check packages/
17+
- run: uv run ruff format --check packages/
18+
19+
test:
20+
runs-on: ubuntu-latest
21+
strategy:
22+
matrix:
23+
package:
24+
- gds-framework
25+
- gds-viz
26+
- gds-games
27+
- gds-examples
28+
steps:
29+
- uses: actions/checkout@v4
30+
- uses: astral-sh/setup-uv@v4
31+
- run: uv sync --package ${{ matrix.package }}
32+
- name: Run tests
33+
run: |
34+
if [ "${{ matrix.package }}" = "gds-examples" ]; then
35+
uv run --package ${{ matrix.package }} pytest packages/gds-examples -v
36+
else
37+
uv run --package ${{ matrix.package }} pytest packages/${{ matrix.package }}/tests -v
38+
fi

.github/workflows/docs.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "docs/**"
8+
- "mkdocs.yml"
9+
- "packages/*/gds*/**"
10+
- "packages/*/ogs/**"
11+
12+
permissions:
13+
pages: write
14+
id-token: write
15+
16+
concurrency:
17+
group: pages
18+
cancel-in-progress: true
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: astral-sh/setup-uv@v4
26+
- run: uv sync --all-packages --group docs
27+
- run: uv run mkdocs build --strict
28+
- uses: actions/upload-pages-artifact@v3
29+
with:
30+
path: site
31+
32+
deploy:
33+
needs: build
34+
runs-on: ubuntu-latest
35+
environment:
36+
name: github-pages
37+
url: ${{ steps.deployment.outputs.page_url }}
38+
steps:
39+
- id: deployment
40+
uses: actions/deploy-pages@v4

.github/workflows/publish.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- "*/v*"
7+
8+
permissions:
9+
id-token: write
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
environment: pypi
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: astral-sh/setup-uv@v4
18+
19+
- name: Parse package name from tag
20+
id: parse
21+
run: |
22+
TAG="${GITHUB_REF#refs/tags/}"
23+
PACKAGE="${TAG%%/v*}"
24+
VERSION="${TAG#*/v}"
25+
echo "package=$PACKAGE" >> "$GITHUB_OUTPUT"
26+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
27+
echo "Publishing $PACKAGE v$VERSION"
28+
29+
- run: uv build --package ${{ steps.parse.outputs.package }}
30+
- run: uv publish

.gitignore

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.egg-info/
6+
*.egg
7+
dist/
8+
build/
9+
*.whl
10+
11+
# Virtual environments
12+
.venv/
13+
venv/
14+
ENV/
15+
16+
# uv
17+
uv.lock
18+
19+
# IDE
20+
.idea/
21+
.vscode/
22+
*.swp
23+
*.swo
24+
*~
25+
26+
# Testing
27+
.coverage
28+
.pytest_cache/
29+
htmlcov/
30+
.mypy_cache/
31+
32+
# MkDocs
33+
site/
34+
35+
# OS
36+
.DS_Store
37+
Thumbs.db
38+
39+
# Ruff
40+
.ruff_cache/
41+
42+
# Pyright
43+
.pyright/

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.8.6
4+
hooks:
5+
- id: ruff
6+
args: [--fix]
7+
- id: ruff-format

CLAUDE.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code when working in this monorepo.
4+
5+
## Project
6+
7+
`gds-core` — monorepo for the Generalized Dynamical Systems ecosystem. Contains four packages managed as a uv workspace.
8+
9+
## Packages
10+
11+
| Package | Import | Location |
12+
|---------|--------|----------|
13+
| gds-framework | `gds` | `packages/gds-framework/` |
14+
| gds-viz | `gds_viz` | `packages/gds-viz/` |
15+
| gds-games | `ogs` | `packages/gds-games/` |
16+
| gds-examples || `packages/gds-examples/` |
17+
18+
## Commands
19+
20+
```bash
21+
# Install all packages (workspace-linked)
22+
uv sync --all-packages
23+
24+
# Run tests per-package
25+
uv run --package gds-framework pytest packages/gds-framework/tests -v
26+
uv run --package gds-viz pytest packages/gds-viz/tests -v
27+
uv run --package gds-games pytest packages/gds-games/tests -v
28+
uv run --package gds-examples pytest packages/gds-examples -v
29+
30+
# Run all tests
31+
uv run --package gds-framework pytest packages/gds-framework/tests packages/gds-viz/tests packages/gds-games/tests packages/gds-examples -v
32+
33+
# Lint & format
34+
uv run ruff check packages/
35+
uv run ruff format --check packages/
36+
37+
# Build a specific package
38+
uv build --package gds-framework
39+
40+
# Docs
41+
uv sync --all-packages --group docs
42+
uv run mkdocs build --strict
43+
uv run mkdocs serve
44+
```
45+
46+
## Architecture
47+
48+
This is a **uv workspace** monorepo. The root `pyproject.toml` declares `packages/*` as workspace members. Each package has its own `pyproject.toml` with package-specific dependencies and build config. Shared tooling (ruff, docs) is configured at the root.
49+
50+
### Dependency Graph
51+
52+
```
53+
gds-framework ← core engine (no GDS dependencies)
54+
55+
gds-viz ← visualization (depends on gds-framework)
56+
gds-games ← game theory DSL (depends on gds-framework)
57+
58+
gds-examples ← tutorials (depends on gds-framework + gds-viz)
59+
```
60+
61+
### Key Conventions
62+
63+
- All data models are Pydantic v2 BaseModel
64+
- Absolute imports only (never relative)
65+
- Ruff config inherited from root (line-length 88)
66+
- Each package published independently to PyPI via tag-based workflow (`gds-framework/v0.3.1`)
67+
- Per-package CLAUDE.md files contain package-specific architecture details

0 commit comments

Comments
 (0)