Skip to content

Commit ad725be

Browse files
committed
Migrate from Poetry to uv
1 parent db741ea commit ad725be

File tree

8 files changed

+3497
-5157
lines changed

8 files changed

+3497
-5157
lines changed

.github/workflows/constraints-poetry.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/constraints.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
pip==25.0.1
1+
bump-my-version==1.1.1
22
nox==2025.2.9
3-
nox-poetry==1.2.0
4-
virtualenv==20.29.2

.github/workflows/release.yml

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,44 +16,40 @@ jobs:
1616
with:
1717
fetch-depth: 2
1818

19-
- name: Set up Python
20-
uses: actions/setup-python@v5
19+
- name: Install the pinned version of uv
20+
uses: astral-sh/setup-uv@v5
2121
with:
22-
python-version: "3.12"
22+
python-version: 3.13
23+
pyproject-file: "${{ github.workspace }}/pyproject.toml"
2324

24-
- name: Upgrade pip
25+
- name: Install bumpversion
2526
run: |
26-
pip install --constraint=.github/workflows/constraints.txt pip
27-
pip --version
28-
29-
- name: Install Poetry
30-
run: |
31-
pip install --constraint=.github/workflows/constraints-poetry.txt poetry
32-
poetry --version
27+
uv tool install --constraint=.github/workflows/constraints.txt bump-my-version
28+
bump-my-version --version
3329
3430
- name: Check if there is a parent commit
3531
id: check-parent-commit
3632
run: |
37-
echo "::set-output name=sha::$(git rev-parse --verify --quiet HEAD^)"
33+
echo "sha=$(git rev-parse --verify --quiet HEAD^)" >> $GITHUB_OUTPUT
3834
3935
- name: Detect and tag new version
4036
id: check-version
4137
if: steps.check-parent-commit.outputs.sha
4238
uses: salsify/[email protected]
4339
with:
4440
version-command: |
45-
bash -o pipefail -c "poetry version | awk '{ print \$2 }'"
41+
bump-my-version show current_version
4642
4743
- name: Bump version for developmental release
4844
if: "! steps.check-version.outputs.tag"
4945
run: |
50-
poetry version patch &&
51-
version=$(poetry version | awk '{ print $2 }') &&
52-
poetry version $version.dev.$(date +%s)
46+
bump-my-version bump patch &&
47+
version=$(bump-my-version show current_version) &&
48+
bump-my-version bump --new-version $version.dev$(date +%s)
5349
5450
- name: Build package
5551
run: |
56-
poetry build --ansi
52+
uv build
5753
5854
- name: Publish package on PyPI
5955
if: steps.check-version.outputs.tag

.github/workflows/tests.yml

Lines changed: 14 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -42,30 +42,15 @@ jobs:
4242
with:
4343
python-version: ${{ matrix.python }}
4444

45-
- name: Upgrade pip
46-
run: |
47-
pip install -c ${{ github.workspace }}/.github/workflows/constraints.txt pip
48-
pip --version
49-
50-
- name: Upgrade pip in virtual environments
51-
shell: python
52-
run: |
53-
import os
54-
import pip
55-
56-
with open(os.environ["GITHUB_ENV"], mode="a") as io:
57-
print(f"VIRTUALENV_PIP={pip.__version__}", file=io)
58-
59-
- name: Install Poetry
60-
run: |
61-
pipx install --pip-args="-c ${{ github.workspace }}/.github/workflows/constraints-poetry.txt" poetry
62-
pipx inject poetry poetry-plugin-export
63-
poetry --version
45+
- name: Install the pinned version of uv
46+
uses: astral-sh/setup-uv@v5
47+
with:
48+
python-version: ${{ matrix.python }}
49+
pyproject-file: ${{ github.workspace }}/pyproject.toml
6450

6551
- name: Install Nox
6652
run: |
67-
pipx install --pip-args="-c ${{ github.workspace }}/.github/workflows/constraints.txt" nox
68-
pipx inject --pip-args="-c ${{ github.workspace }}/.github/workflows/constraints.txt" nox nox-poetry
53+
uv tool install -c "${{ github.workspace }}/.github/workflows/constraints.txt" nox
6954
nox --version
7055
7156
- name: Compute pre-commit cache key
@@ -75,13 +60,14 @@ jobs:
7560
run: |
7661
import hashlib
7762
import sys
63+
import os
7864
7965
python = "py{}.{}".format(*sys.version_info[:2])
8066
payload = sys.version.encode() + sys.executable.encode()
8167
digest = hashlib.sha256(payload).hexdigest()
8268
result = "${{ runner.os }}-{}-{}-pre-commit".format(python, digest[:8])
8369
84-
print("::set-output name=result::{}".format(result))
70+
print("result={}".format(result), file=open(os.environ['GITHUB_OUTPUT'], 'a'))
8571
8672
- name: Restore pre-commit cache
8773
uses: actions/cache@v4
@@ -118,26 +104,15 @@ jobs:
118104
- name: Check out the repository
119105
uses: actions/checkout@v4
120106

121-
- name: Set up Python
122-
uses: actions/setup-python@v5
107+
- name: Install the pinned version of uv
108+
uses: astral-sh/setup-uv@v5
123109
with:
124-
python-version: "3.12"
125-
126-
- name: Upgrade pip
127-
run: |
128-
pip install -c ${{ github.workspace }}/.github/workflows/constraints.txt pip
129-
pip --version
130-
131-
- name: Install Poetry
132-
run: |
133-
pipx install --pip-args="-c ${{ github.workspace }}/.github/workflows/constraints-poetry.txt" poetry
134-
pipx inject poetry poetry-plugin-export
135-
poetry --version
110+
python-version: 3.13
111+
pyproject-file: "${{ github.workspace }}/pyproject.toml"
136112

137113
- name: Install Nox
138114
run: |
139-
pipx install --pip-args="-c ${{ github.workspace }}/.github/workflows/constraints.txt" nox
140-
pipx inject --pip-args="-c ${{ github.workspace }}/.github/workflows/constraints.txt" nox nox-poetry
115+
uv tool install -c "${{ github.workspace }}/.github/workflows/constraints.txt" nox
141116
nox --version
142117
143118
- name: Download coverage data
@@ -155,6 +130,6 @@ jobs:
155130
nox --session=coverage -- xml
156131
157132
- name: Upload coverage report
158-
uses: codecov/codecov-action@v5
133+
uses: codecov/codecov-action@v5.1.2
159134
env:
160135
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)