Skip to content

Commit 71ff7bf

Browse files
committed
chore: switch to uv
1 parent cb6bdfe commit 71ff7bf

File tree

7 files changed

+1148
-1567
lines changed

7 files changed

+1148
-1567
lines changed

.github/workflows/docs.yml

+10-26
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ on:
1111
- mkdocs.yml
1212
workflow_dispatch:
1313

14-
permissions:
15-
contents: write
16-
1714
jobs:
1815
deploy:
16+
permissions:
17+
contents: write
1918
runs-on: ubuntu-latest
2019
steps:
2120
- name: Checkout
@@ -26,30 +25,15 @@ jobs:
2625
git config user.name github-actions[bot]
2726
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
2827
29-
- name: Set up Python 3.12
30-
uses: actions/setup-python@v5
31-
with:
32-
python-version: '3.12'
33-
34-
- name: Install pipx
35-
run: python -m pip install pipx
36-
37-
- name: Install poetry
38-
run: pipx install poetry
39-
40-
- name: Setup a local virtual environment
41-
run: |
42-
poetry config virtualenvs.create true --local
43-
poetry config virtualenvs.in-project true --local
28+
- name: Install uv
29+
id: setup-uv
30+
uses: astral-sh/setup-uv@v3
4431

45-
- uses: actions/cache@v4
46-
name: Define a cache for the venv based on the dependencies lock file
47-
with:
48-
key: ubuntu-latest-${{ hashFiles('poetry.lock') }}
49-
path: ./.venv
32+
- name: Install Python 3.12
33+
run: uv python install 3.12
5034

51-
- name: Install dependencies
52-
run: poetry install --all-extras --sync
35+
- name: Install the project
36+
run: uv sync --all-extras --python 3.12
5337

5438
- name: Deploy docs
55-
run: poetry run mkdocs gh-deploy --force
39+
run: uv run mkdocs gh-deploy --force

.github/workflows/lint-and-type-check.yml

+10-25
Original file line numberDiff line numberDiff line change
@@ -28,36 +28,21 @@ jobs:
2828
- name: Checkout
2929
uses: actions/checkout@v4
3030

31-
- name: Setup Python
32-
uses: actions/setup-python@v5
33-
with:
34-
python-version: "3.12"
31+
- name: Install uv
32+
id: setup-uv
33+
uses: astral-sh/setup-uv@v3
3534

36-
- name: Install pipx
37-
run: python -m pip install pipx
35+
- name: Install Python 3.12
36+
run: uv python install 3.12
3837

39-
- name: Install poetry
40-
run: pipx install poetry
41-
42-
- name: Setup a local virtual environment
43-
run: |
44-
poetry config virtualenvs.create true --local
45-
poetry config virtualenvs.in-project true --local
46-
47-
- uses: actions/cache@v4
48-
name: Define a cache for the venv based on the dependencies lock file
49-
with:
50-
key: 3.12-${{ hashFiles('poetry.lock') }}
51-
path: ./.venv
52-
53-
- name: Install the project dependencies
54-
run: poetry install --all-extras --sync
38+
- name: Install the project
39+
run: uv sync --all-extras --python 3.12
5540

5641
- name: Run mypy
57-
run: poetry run mypy .
42+
run: uv run mypy .
5843

5944
- name: Run ruff lint
60-
run: poetry run ruff check .
45+
run: uv run ruff check .
6146

6247
- name: Run ruff format
63-
run: poetry run ruff format --check .
48+
run: uv run ruff format --check .

.github/workflows/release.yml

+12-12
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ on:
55
tags:
66
- 'v*.*.*'
77

8-
98
jobs:
109
release:
1110
name: Release
@@ -15,26 +14,27 @@ jobs:
1514
permissions:
1615
id-token: write
1716
contents: write
17+
attestations: write
1818
runs-on: ubuntu-latest
1919
steps:
2020
- name: Checkout code
2121
uses: actions/checkout@v4
2222
with:
2323
fetch-depth: 0 # Important for changelog
2424

25-
- name: Set up Python 3.12
26-
uses: actions/setup-python@v5
27-
with:
28-
python-version: '3.12'
25+
- name: Install uv
26+
id: setup-uv
27+
uses: astral-sh/setup-uv@v3
2928

30-
- name: Install pipx
31-
run: python -m pip install pipx
29+
- name: Install Python 3.12
30+
run: uv python install 3.12
3231

33-
- name: Install Poetry
34-
run: pipx install poetry
32+
- name: Build
33+
run: uv build
3534

36-
- name: Build project for distribution
37-
run: poetry build
35+
- uses: actions/attest-build-provenance@v1
36+
with:
37+
subject-path: "dist/*"
3838

3939
- name: Generate changelog with git-cliff
4040
uses: tj-actions/git-cliff@v1
@@ -55,4 +55,4 @@ jobs:
5555
- name: Publish package distributions to PyPI
5656
uses: pypa/gh-action-pypi-publish@release/v1
5757
with:
58-
attestations: true
58+
attestations: true

.github/workflows/test.yml

+13-25
Original file line numberDiff line numberDiff line change
@@ -29,51 +29,39 @@ jobs:
2929
max-parallel: 1
3030
fail-fast: false
3131
matrix:
32-
python-version: ['3.10', '3.11', '3.12']
32+
python-version: ['3.10', '3.11', '3.12', '3.13']
3333
runs-on: ubuntu-latest
3434
steps:
3535
- name: Checkout
3636
uses: actions/checkout@v4
3737

38-
- name: Setup Python
39-
uses: actions/setup-python@v5
40-
with:
41-
python-version: ${{ matrix.python-version }}
42-
43-
- name: Install pipx
44-
run: python -m pip install pipx
38+
- name: Install uv
39+
id: setup-uv
40+
uses: astral-sh/setup-uv@v3
4541

46-
- name: Install poetry
47-
run: pipx install poetry
42+
- name: Install Python ${{ matrix.python-version }}
43+
run: uv python install ${{ matrix.python-version }}
4844

49-
- name: Setup a local virtual environment
50-
run: |
51-
poetry config virtualenvs.create true --local
52-
poetry config virtualenvs.in-project true --local
53-
54-
- uses: actions/cache@v4
55-
name: Define a cache for the venv based on the dependencies lock file
56-
with:
57-
key: ${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
58-
path: ./.venv
45+
- name: Install the project
46+
run: uv sync --all-extras --python ${{ matrix.python-version }}
5947

6048
- name: Install the project dependencies
61-
run: poetry install --all-extras --sync
49+
run: uv install --all-extras --sync
6250

6351
- name: Run tests and generate coverage
6452
env:
6553
SEADEX_EMAIL: ${{ secrets.SEADEX_EMAIL }}
6654
SEADEX_PASSWORD: ${{ secrets.SEADEX_PASSWORD }}
6755
run: |
68-
poetry run coverage run -m pytest -vv
69-
poetry run coverage xml
56+
uv run coverage run -m pytest -vv
57+
uv run coverage xml
7058
7159
- name: Build
72-
run: poetry build
60+
run: uv build
7361

7462
- name: Get version
7563
id: version
76-
run: echo "version=$(poetry run python -c 'import seadex; print(seadex.__version__)')" >> $GITHUB_OUTPUT
64+
run: echo "version=$(uv run python -c 'import seadex; print(seadex.__version__)')" >> $GITHUB_OUTPUT
7765

7866
- uses: actions/upload-artifact@v4
7967
with:

0 commit comments

Comments
 (0)