Skip to content

Commit 4b21326

Browse files
migrate ci fully to uv
1 parent 226d6fa commit 4b21326

File tree

4 files changed

+88
-42
lines changed

4 files changed

+88
-42
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,16 @@ jobs:
2121
steps:
2222
- uses: actions/checkout@v4
2323

24-
- name: Install Rye
25-
run: |
26-
curl -sSf https://rye.astral.sh/get | bash
27-
echo "$HOME/.rye/shims" >> $GITHUB_PATH
28-
env:
29-
RYE_VERSION: '0.44.0'
30-
RYE_INSTALL_OPTION: '--yes'
24+
- uses: astral-sh/setup-uv@v3
25+
with:
26+
version: "latest"
27+
enable-cache: true
3128

3229
- name: Install dependencies
33-
run: rye sync --all-features
30+
run: uv sync --all-extras --group dev
3431

3532
- name: Run lints
36-
run: ./scripts/lint
33+
run: uv run task ci-lint
3734

3835
build:
3936
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
@@ -46,19 +43,16 @@ jobs:
4643
steps:
4744
- uses: actions/checkout@v4
4845

49-
- name: Install Rye
50-
run: |
51-
curl -sSf https://rye.astral.sh/get | bash
52-
echo "$HOME/.rye/shims" >> $GITHUB_PATH
53-
env:
54-
RYE_VERSION: '0.44.0'
55-
RYE_INSTALL_OPTION: '--yes'
46+
- uses: astral-sh/setup-uv@v3
47+
with:
48+
version: "latest"
49+
enable-cache: true
5650

5751
- name: Install dependencies
58-
run: rye sync --all-features
52+
run: uv sync --all-extras --group dev
5953

6054
- name: Run build
61-
run: rye build
55+
run: uv run task ci-build
6256

6357
- name: Get GitHub OIDC Token
6458
if: github.repository == 'stainless-sdks/agentex-sdk-python'
@@ -83,16 +77,13 @@ jobs:
8377
steps:
8478
- uses: actions/checkout@v4
8579

86-
- name: Install Rye
87-
run: |
88-
curl -sSf https://rye.astral.sh/get | bash
89-
echo "$HOME/.rye/shims" >> $GITHUB_PATH
90-
env:
91-
RYE_VERSION: '0.44.0'
92-
RYE_INSTALL_OPTION: '--yes'
80+
- uses: astral-sh/setup-uv@v3
81+
with:
82+
version: "latest"
83+
enable-cache: true
9384

9485
- name: Bootstrap
95-
run: ./scripts/bootstrap
86+
run: uv run task bootstrap
9687

9788
- name: Run tests
98-
run: ./scripts/test
89+
run: uv run task ci-test

CLAUDE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
66

77
### Package Management
88
- Use `uv` for dependency management
9-
- Run `./scripts/bootstrap` to set up the environment
9+
- Run `uv run task bootstrap` to set up the environment
1010
- Or use `uv sync --all-extras --group dev` directly
11+
- Run `uv run task setup-pre-commit` to install pre-commit hooks
1112

1213
Both the main repo and individual tutorials use `uv` for consistency.
1314

pyproject.toml

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -96,23 +96,41 @@ dev = [
9696
"nbstripout>=0.8.1",
9797
"yaspin>=3.1.0",
9898
"taskipy>=1.12.0",
99+
"pre-commit>=3.5.0",
99100
]
100101

101102
[tool.taskipy.tasks]
102-
format = { cmd = "task format:ruff && task format:docs && task fix:ruff && task format:ruff", help = "Format code with ruff and docs" }
103-
"format:docs" = { cmd = "python scripts/utils/ruffen-docs.py README.md api.md", help = "Format documentation" }
104-
"format:ruff" = { cmd = "ruff format", help = "Format code with ruff" }
105-
106-
lint = { cmd = "task check:ruff && task typecheck && task check:importable", help = "Run all linting checks" }
107-
"check:ruff" = { cmd = "ruff check .", help = "Check code with ruff" }
108-
"fix:ruff" = { cmd = "ruff check --fix .", help = "Fix ruff issues automatically" }
109-
110-
"check:importable" = { cmd = "python -c 'import agentex'", help = "Check that agentex can be imported" }
111-
112-
typecheck = { cmd = "task typecheck:pyright && task typecheck:mypy", help = "Run type checking" }
113-
"typecheck:pyright" = { cmd = "pyright", help = "Run pyright type checker" }
114-
"typecheck:verify-types" = { cmd = "pyright --verifytypes agentex --ignoreexternal", help = "Verify types" }
115-
"typecheck:mypy" = { cmd = "mypy .", help = "Run mypy type checker" }
103+
# === ATOMIC TASKS (building blocks) ===
104+
"format-ruff" = { cmd = "ruff format", help = "Format code with ruff" }
105+
"format-docs" = { cmd = "python scripts/utils/ruffen-docs.py README.md api.md", help = "Format documentation" }
106+
"check-ruff" = { cmd = "ruff check .", help = "Check code with ruff" }
107+
"fix-ruff" = { cmd = "ruff check --fix .", help = "Fix ruff issues automatically" }
108+
"check-types-pyright" = { cmd = "pyright", help = "Run pyright type checker" }
109+
"check-types-mypy" = { cmd = "mypy .", help = "Run mypy type checker" }
110+
"check-importable" = { cmd = "python -c 'import agentex'", help = "Check that agentex can be imported" }
111+
112+
# === COMPOSITE TASKS with hooks ===
113+
format = { cmd = "task format-ruff", help = "Format code with ruff and docs" }
114+
post_format = "task format-docs"
115+
116+
typecheck = { cmd = "task check-types-pyright", help = "Run type checking" }
117+
post_typecheck = "task check-types-mypy"
118+
119+
lint = { cmd = "task check-ruff", help = "Run all linting checks" }
120+
post_lint = "task typecheck && task check-importable"
121+
122+
# === SCRIPT DELEGATION (complex operations) ===
123+
bootstrap = { cmd = "./scripts/bootstrap", help = "Set up development environment" }
124+
test = { cmd = "./scripts/test", help = "Run tests with mock server" }
125+
mock = { cmd = "./scripts/mock", help = "Start mock API server" }
126+
127+
# === DEVELOPMENT SETUP ===
128+
setup-pre-commit = { cmd = "pre-commit install", help = "Install pre-commit hooks" }
129+
130+
# === CI-SPECIFIC TASKS ===
131+
ci-lint = { cmd = "task lint", help = "Run linting for CI" }
132+
ci-test = { cmd = "task test", help = "Run tests for CI" }
133+
ci-build = { cmd = "uv build", help = "Build package for CI" }
116134

117135
[tool.hatch.build]
118136
include = [

uv.lock

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)