Skip to content

Commit 5e4fa01

Browse files
committed
refactor: replace poetry with uv
1 parent 6bd324b commit 5e4fa01

13 files changed

Lines changed: 763 additions & 1246 deletions

File tree

.github/workflows/ci.yml

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,63 +10,61 @@ jobs:
1010
build:
1111
name: Build
1212
runs-on: ubuntu-24.04
13+
env:
14+
PYTHON_VERSION: "3.10"
15+
UV_VERSION: "0.11.13"
1316

1417
steps:
1518
- name: Checkout repository
16-
uses: actions/checkout@v6
19+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1720

18-
- name: Setup Python
19-
uses: actions/setup-python@v6
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
2023
with:
21-
python-version: "3.13"
24+
enable-cache: true
25+
version: ${{ env.UV_VERSION }}
2226

23-
- name: Install Poetry
24-
uses: snok/install-poetry@v1
27+
- name: "Set up Python"
28+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # 6.1.0
29+
with:
30+
python-version: ${{ env.PYTHON_VERSION }}
2531

2632
- name: Install dependencies
27-
run: poetry install
33+
run: uv sync --locked --all-extras --dev
2834

2935
- name: Lint
30-
run: poetry run black --check .
36+
run: uv run ruff check .
3137

3238
- name: Build
33-
run: poetry build
39+
run: uv build
3440

35-
# the `coverage xml -i` command is needed to re-write the
36-
# coverage report with relative paths
3741
- name: Test
38-
run: |
39-
poetry run pytest --cov src --cov-report xml tests
40-
poetry run coverage xml -i
42+
run: uv run pytest
4143

4244
test:
4345
name: Test
4446
runs-on: ubuntu-24.04
4547
strategy:
4648
fail-fast: false
4749
matrix:
48-
python-version: ["3.10", "3.11", "3.12", "3.13"]
49-
poetry-version: ["1.8.2"]
50+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
5051

5152
steps:
5253
- name: Checkout repository
53-
uses: actions/checkout@v6
54-
55-
- name: Setup python
56-
uses: actions/setup-python@v6
57-
with:
58-
python-version: "${{ matrix.python-version }}"
54+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5955

60-
- name: Install Poetry
61-
uses: snok/install-poetry@v1
56+
- name: Install uv
57+
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
6258
with:
63-
version: "${{ matrix.poetry-version }}"
59+
enable-cache: true
60+
version: ${{ env.UV_VERSION }}
61+
python-version: ${{ matrix.python-version }}
6462

6563
- name: Install dependencies
66-
run: poetry install
64+
run: uv sync --locked --all-extras --dev
6765

6866
- name: Build
69-
run: poetry build
67+
run: uv build
7068

7169
- name: Test
72-
run: poetry run tox
70+
run: uv run pytest

.github/workflows/codeql-analysis.yml

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

.github/workflows/fortify.yml

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

.github/workflows/publish.yml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,25 @@ jobs:
99
name: Deploy to package index
1010
runs-on: ubuntu-24.04
1111
env:
12-
PYTHON_VERSION: "3.12"
13-
REPOSITORY_USERNAME: ${{ secrets.PYPI_USERNAME }}
14-
REPOSITORY_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
12+
PYTHON_VERSION: "3.10"
13+
UV_VERSION: "0.11.13"
14+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_PASSWORD }}
1515
REPOSITORY_URL: ${{ secrets.PYPI_PUBLISH_URL }}
1616
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
1717
CONDA_ENV_NAME: conda-env
1818

1919
steps:
2020
- name: Checkout repository
21-
uses: actions/checkout@v6
21+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
22+
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
25+
with:
26+
enable-cache: true
27+
version: ${{ env.UV_VERSION }}
2228

2329
- name: Setup Python
24-
uses: actions/setup-python@v6
30+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # 6.1.0
2531
with:
2632
python-version: ${{ env.PYTHON_VERSION }}
2733

@@ -32,21 +38,13 @@ jobs:
3238
activate-environment: ${{ env.CONDA_ENV_NAME }}
3339
python-version: ${{ env.PYTHON_VERSION }}
3440

35-
- name: Install Poetry
36-
uses: snok/install-poetry@v1
37-
38-
- name: Configure Poetry
39-
run: |
40-
poetry config repositories.publish $REPOSITORY_URL
41-
poetry config http-basic.publish $REPOSITORY_USERNAME $REPOSITORY_PASSWORD
42-
4341
- name: Build
4442
run: |
45-
poetry build
43+
uv build
4644
4745
- name: Publish
4846
run: |
49-
poetry publish -r publish
47+
uv publish
5048
5149
- name: Publish to Anaconda
5250
shell: bash -el {0}

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@ target/
8181
profile_default/
8282
ipython_config.py
8383

84-
# pyenv
85-
.python-version
86-
8784
# pipenv
8885
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
8986
# However, in case of collaboration, if having platform-specific dependencies or dependencies

.python-version

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

0 commit comments

Comments
 (0)