Skip to content

Commit a306663

Browse files
committed
switch to uv
1 parent c8d549d commit a306663

6 files changed

Lines changed: 391 additions & 68 deletions

File tree

.github/workflows/finegrain-ci.yml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,21 @@ jobs:
1818
- name: checkout
1919
uses: actions/checkout@v4
2020

21-
- name: Install Rye
22-
uses: eifinger/setup-rye@v4
21+
- name: install uv
22+
uses: astral-sh/setup-uv@v6
2323
with:
2424
enable-cache: true
25-
cache-prefix: 'finegrain-rye-cache'
26-
working-directory: 'finegrain'
25+
cache-suffix: "finegrain-python"
26+
cache-dependency-glob: "**/finegrain/uv.lock"
2727

28-
- name: add shims dir to PATH
29-
run: echo "$RYE_HOME/shims" >> $GITHUB_PATH
30-
31-
- name: get pyright
32-
run: rye tools install pyright --force
33-
34-
- name: rye sync
35-
run: rye sync
28+
- name: uv sync
29+
run: uv sync --frozen --all-extras --dev
3630

3731
- name: format
38-
run: rye fmt --check
32+
run: uv run ruff format
3933

4034
- name: lint
41-
run: rye lint
35+
run: uv run ruff check
4236

4337
- name: typecheck
44-
run: pyright
38+
run: uv run pyright

finegrain/.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12.11

finegrain/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ If you run in a synchronous context and do not want to manage asyncio, see [this
2626

2727
You need API credentials (an API key or an email and a password) to run tests. Be careful: doing so will use credits!
2828

29-
To install dependencies, install [Rye](https://rye.astral.sh) and run:
29+
To install dependencies, install [uv](https://docs.astral.sh/uv/) and run:
3030

3131
```bash
32-
rye sync
32+
uv sync --all-extras
3333
```
3434

3535
The most basic way to run tests is:
3636

3737
```bash
38-
FG_API_CREDENTIALS=FGAPI-ABCDEF-123456-7890AB-CDEF12 rye test
38+
FG_API_CREDENTIALS=FGAPI-ABCDEF-123456-7890AB-CDEF12 uv run pytest
3939
```
4040

4141
If you run tests to debug something you can use for instance:
@@ -47,6 +47,6 @@ mkdir -p "$odir"
4747
FG_API_CREDENTIALS=FGAPI-ABCDEF-123456-7890AB-CDEF12 \
4848
FG_API_URL="https://.../editor" \
4949
FG_TESTS_OUTPUT_DIR="$odir" \
50-
rye run pytest -v \
50+
uv run pytest -v \
5151
-s -o log_cli=true -o log_level=INFO
5252
```

finegrain/pyproject.toml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,20 @@ dependencies = [
1313
readme = "README.md"
1414
requires-python = ">= 3.12, <3.13"
1515

16-
[build-system]
17-
requires = ["hatchling"]
18-
build-backend = "hatchling.build"
19-
20-
[tool.rye]
21-
managed = true
16+
[dependency-groups]
2217
# pytest-asyncio > 0.21 changes event loop management
23-
dev-dependencies = [
24-
"pytest>=8.3.5",
25-
"environs>=14.1.1",
18+
dev = [
19+
"environs>=14.3.0",
20+
"pyright>=1.1.405",
21+
"pytest>=8.4.2",
2622
"pytest-asyncio>=0.21.0, <0.22.0",
23+
"ruff>=0.12.12",
2724
]
2825

26+
[build-system]
27+
requires = ["hatchling"]
28+
build-backend = "hatchling.build"
29+
2930
[tool.hatch.metadata]
3031
allow-direct-references = true
3132

finegrain/requirements.lock

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

0 commit comments

Comments
 (0)