Skip to content

Commit 2b07b0f

Browse files
committed
⬆️ Migrate to uv
1 parent 89dcd63 commit 2b07b0f

File tree

10 files changed

+275
-119
lines changed

10 files changed

+275
-119
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ updates:
1212
- package-ecosystem: "uv"
1313
directory: "/"
1414
schedule:
15-
interval: "monthly"
16-
commit-message:
17-
prefix:
18-
- package-ecosystem: "pip"
19-
directory: "/"
20-
schedule:
21-
interval: "monthly"
15+
interval: "daily"
2216
commit-message:
2317
prefix:

.github/workflows/pre-commit.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77
- synchronize
88

99
env:
10-
UV_SYSTEM_PYTHON: 1
1110
# Forks and Dependabot don't have access to secrets
1211
HAS_SECRETS: ${{ secrets.PRE_COMMIT != '' }}
1312

@@ -41,14 +40,15 @@ jobs:
4140
- name: Set up Python
4241
uses: actions/setup-python@v6
4342
with:
44-
python-version: "3.14"
43+
python-version-file: ".python-version"
4544
- name: Setup uv
4645
uses: astral-sh/setup-uv@v7
4746
with:
4847
cache-dependency-glob: |
4948
pyproject.toml
5049
uv.lock
51-
- run: uv pip install -r requirements-tests.txt
50+
- name: Install Dependencies
51+
run: uv sync --locked
5252
- name: Run prek - pre-commit
5353
id: precommit
5454
run: uvx prek run --from-ref origin/${GITHUB_BASE_REF} --to-ref HEAD --show-diff-on-failure

.github/workflows/publish.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
permissions:
1212
id-token: write
13+
contents: read
1314
steps:
1415
- name: Dump GitHub context
1516
env:
@@ -19,14 +20,10 @@ jobs:
1920
- name: Set up Python
2021
uses: actions/setup-python@v6
2122
with:
22-
python-version: "3.10"
23-
- name: Install build dependencies
24-
run: pip install build
23+
python-version-file: ".python-version"
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v7
2526
- name: Build distribution
26-
run: python -m build
27+
run: uv build
2728
- name: Publish
28-
uses: pypa/gh-action-pypi-publish@v1.13.0
29-
- name: Dump GitHub context
30-
env:
31-
GITHUB_CONTEXT: ${{ toJson(github) }}
32-
run: echo "$GITHUB_CONTEXT"
29+
run: uv publish

.github/workflows/smokeshow.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ on:
1010
permissions:
1111
statuses: write
1212

13-
env:
14-
UV_SYSTEM_PYTHON: 1
15-
1613
jobs:
1714
smokeshow:
1815
runs-on: ubuntu-latest
@@ -25,14 +22,14 @@ jobs:
2522
- uses: actions/checkout@v6
2623
- uses: actions/setup-python@v6
2724
with:
28-
python-version: '3.13'
25+
python-version-file: ".python-version"
2926
- name: Setup uv
3027
uses: astral-sh/setup-uv@v7
3128
with:
3229
cache-dependency-glob: |
33-
requirements**.txt
3430
pyproject.toml
35-
- run: uv pip install -r requirements-tests.txt
31+
uv.lock
32+
- run: uv sync --locked --no-dev --group tests
3633
- uses: actions/download-artifact@v7
3734
with:
3835
name: coverage-html
@@ -43,7 +40,7 @@ jobs:
4340
- name: Upload coverage to Smokeshow
4441
run: |
4542
for i in 1 2 3 4 5; do
46-
if smokeshow upload htmlcov; then
43+
if uv run smokeshow upload htmlcov; then
4744
echo "Smokeshow upload success!"
4845
break
4946
fi

.github/workflows/test-redistribute.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ on:
99
- opened
1010
- synchronize
1111

12-
env:
13-
UV_SYSTEM_PYTHON: 1
14-
1512
jobs:
1613
test-redistribute:
1714
runs-on: ubuntu-latest
@@ -24,12 +21,11 @@ jobs:
2421
- name: Set up Python
2522
uses: actions/setup-python@v6
2623
with:
27-
python-version: "3.10"
24+
python-version-file: ".python-version"
2825
# Needed to run tests
2926
- name: Setup uv
3027
uses: astral-sh/setup-uv@v7
3128
with:
32-
version: "0.9.6"
3329
enable-cache: true
3430
- name: Verify uv is available
3531
run: uv --version
@@ -44,7 +40,7 @@ jobs:
4440
- name: Install test dependencies
4541
run: |
4642
cd dist/fastapi_new*/
47-
pip install -r requirements-tests.txt
43+
pip install --group tests --editable .
4844
- name: Run source distribution tests
4945
run: |
5046
cd dist/fastapi_new*/

.github/workflows/test.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ on:
1919
- cron: "0 0 * * 1"
2020

2121
env:
22-
UV_SYSTEM_PYTHON: 1
22+
UV_NO_SYNC: true
2323

2424
jobs:
2525
test:
@@ -44,6 +44,8 @@ jobs:
4444
python-version: "3.13"
4545
fail-fast: false
4646
runs-on: ${{ matrix.os }}
47+
env:
48+
UV_PYTHON: ${{ matrix.python-version }}
4749
steps:
4850
- uses: actions/checkout@v6
4951
- name: Set up Python
@@ -53,22 +55,21 @@ jobs:
5355
- name: Setup uv
5456
uses: astral-sh/setup-uv@v7
5557
with:
56-
version: "0.9.6"
5758
enable-cache: true
5859
cache-dependency-glob: |
59-
requirements**.txt
6060
pyproject.toml
61+
uv.lock
6162
# Allow debugging with tmate
6263
- name: Setup tmate session
6364
uses: mxschmitt/action-tmate@v3
6465
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
6566
with:
6667
limit-access-to-actor: true
6768
- name: Install Dependencies
68-
run: uv pip install -r requirements-tests.txt
69+
run: uv sync --locked --no-dev --group tests
6970
- run: mkdir coverage
7071
- name: Test
71-
run: bash scripts/test.sh
72+
run: uv run bash scripts/test.sh
7273
env:
7374
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}
7475
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}
@@ -87,15 +88,14 @@ jobs:
8788
- uses: actions/checkout@v6
8889
- uses: actions/setup-python@v6
8990
with:
90-
python-version: '3.13'
91+
python-version-file: ".python-version"
9192
- name: Setup uv
9293
uses: astral-sh/setup-uv@v7
9394
with:
94-
version: "0.9.6"
9595
enable-cache: true
9696
cache-dependency-glob: |
97-
requirements**.txt
9897
pyproject.toml
98+
uv.lock
9999
- name: Get coverage files
100100
uses: actions/download-artifact@v7
101101
with:
@@ -109,17 +109,17 @@ jobs:
109109
with:
110110
limit-access-to-actor: true
111111
- name: Install Dependencies
112-
run: uv pip install -r requirements-tests.txt
112+
run: uv sync --locked --no-dev --group tests
113113
- run: ls -la coverage
114-
- run: coverage combine coverage
115-
- run: coverage html --title "Coverage for ${{ github.sha }}"
114+
- run: uv run coverage combine coverage
115+
- run: uv run coverage html --title "Coverage for ${{ github.sha }}"
116116
- name: Store coverage HTML
117117
uses: actions/upload-artifact@v6
118118
with:
119119
name: coverage-html
120120
path: htmlcov
121121
include-hidden-files: true
122-
- run: coverage report --fail-under=100
122+
- run: uv run coverage report --fail-under=100
123123

124124
# https://github.com/marketplace/actions/alls-green#why
125125
alls-green: # This job does nothing and is only used for the branch protection

.python-version

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

pyproject.toml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,23 @@ classifiers = [
3131
"Programming Language :: Python :: 3.14",
3232
]
3333
dependencies = [
34-
"prek>=0.2.24,<1.0.0",
3534
"typer>=0.12.0",
3635
"rich>=13.0.0",
3736
"typing-extensions>=4.8.0",
3837
"rich-toolkit>=0.15.1",
3938
]
4039

41-
[project.optional-dependencies]
40+
[dependency-groups]
4241
dev = [
43-
"pytest>=8.0.0",
44-
"coverage[toml]>=7.0.0",
45-
"mypy>=1.8.0",
46-
"ruff>=0.3.0",
42+
{ include-group = "tests" },
43+
"prek>=0.2.24,<1.0.0",
44+
]
45+
tests = [
46+
"coverage[toml]>=7.6.1",
47+
"mypy==1.19.1",
48+
"pytest>=8.3.5",
49+
"ruff==0.14.10",
50+
"smokeshow>=0.5.0",
4751
]
4852

4953
[project.scripts]
@@ -117,6 +121,5 @@ keep-runtime-typing = true
117121
[tool.pdm.build]
118122
source-includes = [
119123
"tests/",
120-
"requirements*.txt",
121124
"scripts/",
122125
]

requirements-tests.txt

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

0 commit comments

Comments
 (0)