Skip to content

Commit 3b078f9

Browse files
committed
migrating to uv
1 parent d26a360 commit 3b078f9

File tree

6 files changed

+683
-995
lines changed

6 files changed

+683
-995
lines changed

.github/workflows/docs.yml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,22 @@ jobs:
1313
# Build the documentation and upload the static HTML files as an artifact.
1414
build:
1515
runs-on: ubuntu-latest
16+
1617
steps:
1718
- uses: actions/checkout@v4
18-
- uses: actions/setup-python@v5
19-
with:
20-
python-version: "3.12"
21-
- name: Install poetry
22-
uses: abatilo/actions-poetry@v4
23-
- name: Setup a local virtual environment (if no poetry.toml file)
24-
run: |
25-
poetry config virtualenvs.create true --local
26-
poetry config virtualenvs.in-project true --local
27-
- uses: actions/cache@v4
28-
name: Define a cache for the virtual environment based on the dependencies lock file
19+
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@v5
2922
with:
30-
path: ./.venv
31-
key: venv-${{ hashFiles('poetry.lock') }}
32-
- name: Install the project dependencies
33-
run: poetry install --with docs
23+
enable-cache: true
24+
cache-dependency-glob: "uv.lock"
25+
26+
- name: Set up environment
27+
run: uv sync --extra docs
28+
3429
- name: Run pdoc
35-
run: poetry run python -m pdoc --logo logo.svg --favicon favicon.ico -o docs/ pyftms
30+
run: uv run python -m pdoc --logo logo.svg --favicon favicon.ico -o docs/ pyftms
31+
3632
- uses: actions/upload-pages-artifact@v3
3733
with:
3834
path: docs/
@@ -42,12 +38,15 @@ jobs:
4238
deploy:
4339
needs: build
4440
runs-on: ubuntu-latest
41+
4542
permissions:
4643
pages: write
4744
id-token: write
45+
4846
environment:
4947
name: github-pages
5048
url: ${{ steps.deployment.outputs.page_url }}
49+
5150
steps:
5251
- id: deployment
5352
uses: actions/deploy-pages@v4

.github/workflows/pypi.yml

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,18 @@ jobs:
2020
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
2121
steps:
2222
- uses: actions/checkout@v4
23-
- uses: actions/setup-python@v5
24-
with:
25-
python-version: "3.12"
26-
- name: Install poetry
27-
uses: abatilo/actions-poetry@v4
28-
29-
- name: Setup a local virtual environment (if no poetry.toml file)
30-
run: |
31-
poetry config virtualenvs.create true --local
32-
poetry config virtualenvs.in-project true --local
3323

34-
- uses: actions/cache@v4
35-
name: Define a cache for the virtual environment based on the dependencies lock file
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v5
3626
with:
37-
path: ./.venv
38-
key: venv-${{ hashFiles('poetry.lock') }}
27+
enable-cache: true
28+
cache-dependency-glob: "uv.lock"
3929

40-
- name: Install the project dependencies
41-
run: poetry install
30+
- name: Set up Python
31+
run: uv python install
4232

43-
- name: Poetry build
44-
run: poetry build
33+
- name: Package build
34+
run: uv build
4535

4636
- name: Publish package distributions to PyPI
4737
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/pytest.yml

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,23 @@ jobs:
1616

1717
strategy:
1818
matrix:
19-
python-version: ["3.12", "3.13"]
19+
python-version:
20+
- "3.12"
21+
- "3.13"
2022

2123
steps:
2224
- uses: actions/checkout@v4
2325

24-
- name: Set up Python ${{ matrix.python-version }}
25-
uses: actions/setup-python@v5
26+
- name: Install uv and set the python version
27+
uses: astral-sh/setup-uv@v5
2628
with:
29+
enable-cache: true
30+
cache-dependency-glob: "uv.lock"
2731
python-version: ${{ matrix.python-version }}
2832

29-
- name: Install poetry
30-
uses: abatilo/actions-poetry@v4
31-
32-
- name: Setup a local virtual environment (if no poetry.toml file)
33-
run: |
34-
poetry config virtualenvs.create true --local
35-
poetry config virtualenvs.in-project true --local
36-
37-
- uses: actions/cache@v4
38-
name: Define a cache for the virtual environment based on the dependencies lock file
39-
with:
40-
path: ./.venv
41-
key: venv-${{ hashFiles('poetry.lock') }}
42-
43-
- name: Install the project dependencies
44-
run: poetry install
33+
- name: Install the project
34+
run: uv sync --all-extras --dev
4535

4636
- uses: pavelzw/pytest-action@v2
4737
with:
48-
custom-pytest: poetry run pytest
38+
custom-pytest: uv run pytest

0 commit comments

Comments
 (0)