Skip to content

Commit 46e1627

Browse files
chore: migrate to uv
1 parent a63567c commit 46e1627

5 files changed

Lines changed: 1467 additions & 2129 deletions

File tree

.github/workflows/publish.yml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,29 @@ jobs:
88
publish:
99
runs-on: ubuntu-latest
1010
steps:
11-
- name: Set PATH
12-
run: echo "${HOME}/.local/bin" >> $GITHUB_PATH
13-
1411
- uses: actions/checkout@v4
15-
- name: Set up Python
16-
uses: actions/setup-python@v4
12+
13+
- name: Install uv
14+
# Pinned to a full release commit (setup-uv no longer publishes
15+
# floating major tags). Bump deliberately. v8.2.0
16+
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39
1717
with:
1818
python-version: "3.12"
19+
enable-cache: true
1920

2021
- name: Install dependencies
21-
run: |
22-
curl -sSL https://install.python-poetry.org | python - --version 1.8.5
23-
poetry install
22+
run: uv sync --locked
2423

2524
- name: Run tests
26-
run: |
27-
poetry run pytest
25+
run: uv run pytest
26+
27+
- name: Set version from release tag
28+
run: uv version "$(git tag --points-at HEAD)"
2829

2930
- name: Build wheels
30-
run: |
31-
poetry version $(git tag --points-at HEAD)
32-
poetry build
31+
run: uv build
3332

3433
- name: Upload
3534
env:
36-
USERNAME: __token__
37-
PASSWORD: ${{ secrets.PYPI_TOKEN }}
38-
run: |
39-
poetry publish --username=$USERNAME --password=$PASSWORD
35+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
36+
run: uv publish

.github/workflows/test.yml

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,24 @@ jobs:
1010
python-version: ["3.9", "3.10", "3.11", "3.12"]
1111

1212
steps:
13-
- name: Set PATH
14-
run: echo "${HOME}/.local/bin" >> $GITHUB_PATH
15-
1613
- uses: actions/checkout@v4
17-
- name: Set up Python ${{ matrix.python-version }}
18-
uses: actions/setup-python@v4
19-
with:
20-
python-version: ${{ matrix.python-version }}
2114

22-
- name: Cache pip
23-
uses: actions/cache@v4
15+
- name: Install uv
16+
# Pinned to a full release commit (setup-uv no longer publishes
17+
# floating major tags). Bump deliberately. v8.2.0
18+
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39
2419
with:
25-
path: ~/.cache/pip
26-
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('poetry.lock') }}-${ GITHUB_REF }
27-
restore-keys: |
28-
${{ runner.os }}-pip-
29-
${{ runner.os }}-
20+
python-version: ${{ matrix.python-version }}
21+
enable-cache: true
3022

3123
- name: Install dependencies
32-
run: |
33-
curl -sSL https://install.python-poetry.org | python - --version 1.8.5
34-
poetry install
24+
run: uv sync --locked
3525

3626
- name: Run tests
37-
run: |
38-
poetry run pytest
27+
run: uv run pytest
3928

4029
- name: Build wheels
41-
run: |
42-
poetry build
30+
run: uv build
4331

4432
build-docs:
4533
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)