Skip to content

Commit 1bd4ff7

Browse files
feat(api): Bump edition to switch rye -> UV
1 parent 413b755 commit 1bd4ff7

17 files changed

Lines changed: 2655 additions & 2278 deletions

.devcontainer/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}
33

44
USER vscode
55

6-
RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.44.0" RYE_INSTALL_OPTION="--yes" bash
7-
ENV PATH=/home/vscode/.rye/shims:$PATH
6+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
87

98
RUN echo "[[ -d .venv ]] && source .venv/bin/activate || export PATH=\$PATH" >> /home/vscode/.bashrc

.devcontainer/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"context": ".."
88
},
99

10-
"postStartCommand": "rye sync --all-features",
10+
"postStartCommand": "uv sync --all-extras",
1111

1212
"customizations": {
1313
"vscode": {
@@ -20,7 +20,7 @@
2020
"python.defaultInterpreterPath": ".venv/bin/python",
2121
"python.typeChecking": "basic",
2222
"terminal.integrated.env.linux": {
23-
"PATH": "/home/vscode/.rye/shims:${env:PATH}"
23+
"PATH": "${env:PATH}"
2424
}
2525
}
2626
}

.github/workflows/ci.yml

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,13 @@ jobs:
2323
steps:
2424
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2525

26-
- name: Install Rye
27-
run: |
28-
curl -sSf https://rye.astral.sh/get | bash
29-
echo "$HOME/.rye/shims" >> $GITHUB_PATH
30-
env:
31-
RYE_VERSION: '0.44.0'
32-
RYE_INSTALL_OPTION: '--yes'
26+
- name: Install uv
27+
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2
28+
with:
29+
version: '0.10.2'
3330

3431
- name: Install dependencies
35-
run: rye sync --all-features
32+
run: uv sync --all-extras
3633

3734
- name: Run lints
3835
run: ./scripts/lint
@@ -48,19 +45,16 @@ jobs:
4845
steps:
4946
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5047

51-
- name: Install Rye
52-
run: |
53-
curl -sSf https://rye.astral.sh/get | bash
54-
echo "$HOME/.rye/shims" >> $GITHUB_PATH
55-
env:
56-
RYE_VERSION: '0.44.0'
57-
RYE_INSTALL_OPTION: '--yes'
48+
- name: Install uv
49+
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2
50+
with:
51+
version: '0.10.2'
5852

5953
- name: Install dependencies
60-
run: rye sync --all-features
54+
run: uv sync --all-extras
6155

6256
- name: Run build
63-
run: rye build
57+
run: uv build
6458

6559
- name: Get GitHub OIDC Token
6660
if: |-
@@ -89,13 +83,10 @@ jobs:
8983
steps:
9084
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
9185

92-
- name: Install Rye
93-
run: |
94-
curl -sSf https://rye.astral.sh/get | bash
95-
echo "$HOME/.rye/shims" >> $GITHUB_PATH
96-
env:
97-
RYE_VERSION: '0.44.0'
98-
RYE_INSTALL_OPTION: '--yes'
86+
- name: Install uv
87+
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2
88+
with:
89+
version: '0.10.2'
9990

10091
- name: Bootstrap
10192
run: ./scripts/bootstrap

.github/workflows/publish-pypi.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,10 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1818

19-
- name: Install Rye
20-
run: |
21-
curl -sSf https://rye.astral.sh/get | bash
22-
echo "$HOME/.rye/shims" >> $GITHUB_PATH
23-
env:
24-
RYE_VERSION: "0.44.0"
25-
RYE_INSTALL_OPTION: "--yes"
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2
21+
with:
22+
version: '0.9.13'
2623

2724
- name: Publish to PyPI
2825
run: |

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 64
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp/agentex-sdk-9185c7bad4328824f8790e963c5a9f20b70f5c15fc148c348947efc1bd9a946c.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp/agentex-sdk-4aa312560bc67c5627e5c20cce4546c2fb8026908b22bd6332e897c960751ade.yml
33
openapi_spec_hash: 9115c9f283257e0636aba67fadfeda0a
4-
config_hash: 713b2e04b6e0aa109ab9d5a3375a5021
4+
config_hash: e4d27ffb1e50df3990f825bc8da887f5

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

CONTRIBUTING.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
## Setting up the environment
22

3-
### With Rye
3+
### With `uv`
44

5-
We use [Rye](https://rye.astral.sh/) to manage dependencies because it will automatically provision a Python environment with the expected Python version. To set it up, run:
5+
We use [uv](https://docs.astral.sh/uv/) to manage dependencies because it will automatically provision a Python environment with the expected Python version. To set it up, run:
66

77
```sh
88
$ ./scripts/bootstrap
99
```
1010

11-
Or [install Rye manually](https://rye.astral.sh/guide/installation/) and run:
11+
Or [install uv manually](https://docs.astral.sh/uv/getting-started/installation/) and run:
1212

1313
```sh
14-
$ rye sync --all-features
14+
$ uv sync --all-extras
1515
```
1616

17-
You can then run scripts using `rye run python script.py` or by activating the virtual environment:
17+
You can then run scripts using `uv run python script.py` or by manually activating the virtual environment:
1818

1919
```sh
20-
# Activate the virtual environment - https://docs.python.org/3/library/venv.html#how-venvs-work
20+
# manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work
2121
$ source .venv/bin/activate
2222

23-
# now you can omit the `rye run` prefix
23+
# now you can omit the `uv run` prefix
2424
$ python script.py
2525
```
2626

27-
### Without Rye
27+
### Without `uv`
2828

29-
Alternatively if you don't want to install `Rye`, you can stick with the standard `pip` setup by ensuring you have the Python version specified in `.python-version`, create a virtual environment however you desire and then install dependencies using this command:
29+
Alternatively if you don't want to install `uv`, you can stick with the standard `pip` setup by ensuring you have the Python version specified in `.python-version`, create a virtual environment however you desire and then install dependencies using this command:
3030

3131
```sh
3232
$ pip install -r requirements-dev.lock
@@ -78,7 +78,7 @@ All files in the `examples/` directory are not modified by the generator and can
7878
```py
7979
# add an example to examples/<your-example>.py
8080

81-
#!/usr/bin/env -S rye run python
81+
#!/usr/bin/env -S uv run python
8282
8383
```
8484

@@ -105,7 +105,7 @@ Building this package will create two files in the `dist/` directory, a `.tar.gz
105105
To create a distributable version of the library, all you have to do is run this command:
106106

107107
```sh
108-
$ rye build
108+
$ uv build
109109
# or
110110
$ python -m build
111111
```

bin/publish-pypi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env bash
22

33
set -eux
4+
rm -rf dist
45
mkdir -p dist
5-
rye build --clean
6-
rye publish --yes --token=$PYPI_TOKEN
6+
uv build
7+
uv publish --token=$PYPI_TOKEN

noxfile.py

Lines changed: 0 additions & 9 deletions
This file was deleted.

pyproject.toml

Lines changed: 9 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -78,65 +78,35 @@ dev = [
7878
[project.scripts]
7979
agentex = "agentex.lib.cli.commands.main:app"
8080

81-
[tool.rye]
81+
[tool.uv]
8282
managed = true
83-
# version pins are in requirements-dev.lock
84-
dev-dependencies = [
83+
required-version = ">=0.9"
84+
85+
[dependency-groups]
86+
# version pins are in uv.lock
87+
dev = [
8588
"pyright==1.1.399",
8689
"mypy==1.17",
8790
"respx",
8891
"pytest",
8992
"pytest-asyncio",
9093
"ruff",
9194
"time-machine",
92-
"nox",
9395
"dirty-equals>=0.6.0",
9496
"importlib-metadata>=6.7.0",
9597
"rich>=13.7.1",
9698
"nest_asyncio==1.6.0",
9799
"pytest-xdist>=3.6.1",
98100
"debugpy>=1.8.15",
101+
"ipywidgets>=8.1.7",
102+
"nbstripout>=0.8.1",
103+
"yaspin>=3.1.0",
99104
]
100105

101-
[tool.rye.scripts]
102-
format = { chain = [
103-
"format:ruff",
104-
"format:docs",
105-
"fix:ruff",
106-
# run formatting again to fix any inconsistencies when imports are stripped
107-
"format:ruff",
108-
]}
109-
"format:docs" = "bash -c 'python scripts/utils/ruffen-docs.py README.md $(find . -type f -name api.md)'"
110-
"format:ruff" = "ruff format"
111-
112-
"lint" = { chain = [
113-
"check:ruff",
114-
"typecheck",
115-
"check:importable",
116-
]}
117-
"check:ruff" = "ruff check ."
118-
"fix:ruff" = "ruff check --fix ."
119-
120-
"check:importable" = "python -c 'import agentex'"
121-
122-
typecheck = { chain = [
123-
"typecheck:pyright"
124-
]}
125-
"typecheck:pyright" = "pyright"
126-
"typecheck:verify-types" = "pyright --verifytypes agentex --ignoreexternal"
127-
"typecheck:mypy" = "mypy ."
128-
129106
[build-system]
130107
requires = ["hatchling==1.26.3", "hatch-fancy-pypi-readme"]
131108
build-backend = "hatchling.build"
132109

133-
[dependency-groups]
134-
dev = [
135-
"ipywidgets>=8.1.7",
136-
"nbstripout>=0.8.1",
137-
"yaspin>=3.1.0",
138-
]
139-
140110
[tool.hatch.build]
141111
include = [
142112
"src/*"

0 commit comments

Comments
 (0)