Skip to content

Commit 226d6fa

Browse files
remove rye + all in on uv
1 parent e50809c commit 226d6fa

File tree

11 files changed

+393
-840
lines changed

11 files changed

+393
-840
lines changed

Brewfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
brew "rye"
1+
brew "uv"
22

CLAUDE.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,26 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Development Commands
66

7-
### Package Management in the top level repo
8-
- Use `rye` for dependency management (preferred)
7+
### Package Management
8+
- Use `uv` for dependency management
99
- Run `./scripts/bootstrap` to set up the environment
10-
- Or use `rye sync --all-features` directly
10+
- Or use `uv sync --all-extras --group dev` directly
1111

12-
Special note: the individual tutorials maintain their own tutorial specific virtualenv using `uv`. So when testing/running tutorials, you `uv run` instead of `rye run`. Everything else is similar.
12+
Both the main repo and individual tutorials use `uv` for consistency.
1313

1414
#### Testing
15-
- Run tests: `rye run pytest` or `./scripts/test`
16-
- Run specific test: `rye run pytest path/to/test_file.py::TestClass::test_method -v`
15+
- Run tests: `uv run pytest` or `./scripts/test`
16+
- Run specific test: `uv run pytest path/to/test_file.py::TestClass::test_method -v`
1717
- Mock server is automatically started for tests, runs on port 4010
1818

1919
#### Linting and Formatting
20-
- Format code: `rye run format` or `./scripts/format`
21-
* The repository is still in flux, so running format might accidentally change files that aren't part of your scope of changes. So always run `run rye format` with additional arguments to constrain the formatting to the files that you are modifying.
22-
- Lint code: `rye run lint` or `./scripts/lint`
23-
- Type check: `rye run typecheck` (runs both pyright and mypy)
20+
- Format code: `uv run task format` or `./scripts/format`
21+
* The repository is still in flux, so running format might accidentally change files that aren't part of your scope of changes. So always run `uv run task format` with additional arguments to constrain the formatting to the files that you are modifying.
22+
- Lint code: `uv run task lint` or `./scripts/lint`
23+
- Type check: `uv run task typecheck` (runs both pyright and mypy)
2424

2525
### Building and Running
26-
- Build package: `rye build`
26+
- Build package: `uv build`
2727

2828

2929

@@ -89,5 +89,5 @@ Most SDK code is auto-generated. Manual changes are preserved in:
8989

9090
### Environment Requirements
9191
- Python 3.12+ required
92-
- Uses Rye for dependency management
92+
- Uses UV for dependency management
9393
- Supports both sync and async client patterns

noxfile.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
@nox.session(reuse_venv=True, name="test-pydantic-v1")
55
def test_pydantic_v1(session: nox.Session) -> None:
6-
session.install("-r", "requirements-dev.lock")
6+
# Install dependencies via uv
7+
session.run("uv", "sync", "--group", "dev", external=True)
78
session.install("pydantic<2")
89

910
session.run("pytest", "--showlocals", "--ignore=tests/functional", *session.posargs)

pyproject.toml

Lines changed: 24 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,13 @@ dev = [
7171
[project.scripts]
7272
agentex = "agentex.lib.cli.commands.main:app"
7373

74-
[tool.rye]
75-
managed = true
76-
# version pins are in requirements-dev.lock
77-
dev-dependencies = [
74+
75+
[build-system]
76+
requires = ["hatchling==1.26.3", "hatch-fancy-pypi-readme"]
77+
build-backend = "hatchling.build"
78+
79+
[dependency-groups]
80+
dev = [
7881
"pyright==1.1.399",
7982
"mypy",
8083
"respx",
@@ -89,48 +92,28 @@ dev-dependencies = [
8992
"nest_asyncio==1.6.0",
9093
"pytest-xdist>=3.6.1",
9194
"debugpy>=1.8.15",
92-
]
93-
94-
[tool.rye.scripts]
95-
format = { chain = [
96-
"format:ruff",
97-
"format:docs",
98-
"fix:ruff",
99-
# run formatting again to fix any inconsistencies when imports are stripped
100-
"format:ruff",
101-
]}
102-
"format:docs" = "python scripts/utils/ruffen-docs.py README.md api.md"
103-
"format:ruff" = "ruff format"
104-
105-
"lint" = { chain = [
106-
"check:ruff",
107-
"typecheck",
108-
"check:importable",
109-
]}
110-
"check:ruff" = "ruff check ."
111-
"fix:ruff" = "ruff check --fix ."
112-
113-
"check:importable" = "python -c 'import agentex'"
114-
115-
typecheck = { chain = [
116-
"typecheck:pyright",
117-
"typecheck:mypy"
118-
]}
119-
"typecheck:pyright" = "pyright"
120-
"typecheck:verify-types" = "pyright --verifytypes agentex --ignoreexternal"
121-
"typecheck:mypy" = "mypy ."
122-
123-
[build-system]
124-
requires = ["hatchling==1.26.3", "hatch-fancy-pypi-readme"]
125-
build-backend = "hatchling.build"
126-
127-
[dependency-groups]
128-
dev = [
12995
"ipywidgets>=8.1.7",
13096
"nbstripout>=0.8.1",
13197
"yaspin>=3.1.0",
98+
"taskipy>=1.12.0",
13299
]
133100

101+
[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" }
116+
134117
[tool.hatch.build]
135118
include = [
136119
"src/*"

0 commit comments

Comments
 (0)