Skip to content

Commit 246f4fa

Browse files
committed
Adjusted workflows to use uv instead of poetry.
1 parent 6509ce8 commit 246f4fa

File tree

5 files changed

+1131
-322
lines changed

5 files changed

+1131
-322
lines changed

.github/workflows/lint.yaml

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ jobs:
3737
with:
3838
files: |
3939
**.py
40-
poetry.lock
40+
uv.lock
4141
4242
- name: Check changed python files
4343
id: changed-python-files
4444
env:
4545
CHANGED_PYTHON_FILES: ${{ steps.raw-changed-python-files.outputs.all_changed_files }}
4646
run: |
47-
if [[ " $CHANGED_PYTHON_FILES " == *" poetry.lock "* ]]; then
48-
# if poetry.lock is changed, we need to check everything
47+
if [[ " $CHANGED_PYTHON_FILES " == *" uv.lock "* ]]; then
48+
# if uv.lock is changed, we need to check everything
4949
CHANGED_PYTHON_FILES="."
5050
fi
5151
echo "all_changed_files=$CHANGED_PYTHON_FILES" >> "$GITHUB_OUTPUT"
@@ -57,19 +57,20 @@ jobs:
5757
needs: changed-files
5858
steps:
5959
- uses: actions/checkout@v5
60-
- name: Install Python tools
61-
uses: BrandonLWhite/pipx-install-action@v1.0.3
62-
- uses: actions/setup-python@v6
60+
- name: Setup Python with uv
61+
uses: astral-sh/setup-uv@v7
6362
with:
6463
python-version: ${{ env.PYTHON_VERSION }}
65-
cache: poetry
64+
enable-cache: true
6665

6766
- name: Install dependencies
68-
run: poetry install --only=lint
67+
run: uv sync --locked --group lint
6968

7069
- name: Check code formatting
7170
# the job output will contain colored diffs with what needs adjusting
72-
run: poe check-format --output-format=github ${{ needs.changed-files.outputs.changed_python_files }}
71+
run: |
72+
source .venv/bin/activate
73+
poe check-format --output-format=github ${{ needs.changed-files.outputs.changed_python_files }}
7374
7475
lint:
7576
if: needs.changed-files.outputs.any_python_changed == 'true'
@@ -78,18 +79,18 @@ jobs:
7879
needs: changed-files
7980
steps:
8081
- uses: actions/checkout@v5
81-
- name: Install Python tools
82-
uses: BrandonLWhite/pipx-install-action@v1.0.3
83-
- uses: actions/setup-python@v6
82+
- name: Setup Python with uv
83+
uses: astral-sh/setup-uv@v7
8484
with:
8585
python-version: ${{ env.PYTHON_VERSION }}
86-
cache: poetry
87-
86+
enable-cache: true
8887
- name: Install dependencies
89-
run: poetry install --only=lint
88+
run: uv sync --locked --group lint
9089

9190
- name: Lint code
92-
run: poe lint --output-format=github ${{ needs.changed-files.outputs.changed_python_files }}
91+
run: |
92+
source .venv/bin/activate
93+
poe lint --output-format=github ${{ needs.changed-files.outputs.changed_python_files }}
9394
9495
mypy:
9596
if: needs.changed-files.outputs.any_python_changed == 'true'
@@ -98,21 +99,18 @@ jobs:
9899
needs: changed-files
99100
steps:
100101
- uses: actions/checkout@v5
101-
- name: Install Python tools
102-
uses: BrandonLWhite/pipx-install-action@v1.0.3
103-
- uses: actions/setup-python@v6
102+
- name: Setup Python with uv
103+
uses: astral-sh/setup-uv@v7
104104
with:
105105
python-version: ${{ env.PYTHON_VERSION }}
106-
cache: poetry
107-
106+
enable-cache: true
108107
- name: Install dependencies
109-
run: poetry install --only=lint
110-
108+
run: uv sync --locked --group test
111109
- name: Type check code
112110
uses: liskin/gh-problem-matcher-wrap@v3
113111
with:
114112
linters: mypy
115-
run: poe check-types --show-column-numbers --no-error-summary .
113+
run: uv run poe check-types --show-column-numbers --no-error-summary .
116114

117115
docs:
118116
if: needs.changed-files.outputs.any_docs_changed == 'true'
@@ -121,26 +119,29 @@ jobs:
121119
needs: changed-files
122120
steps:
123121
- uses: actions/checkout@v5
124-
- name: Install Python tools
125-
uses: BrandonLWhite/pipx-install-action@v1.0.3
126-
- uses: actions/setup-python@v6
122+
- name: Setup Python with uv
123+
uses: astral-sh/setup-uv@v7
127124
with:
128125
python-version: ${{ env.PYTHON_VERSION }}
129-
cache: poetry
130-
126+
enable-cache: true
131127
- name: Install dependencies
132-
run: poetry install --extras=docs
128+
run: uv sync --locked --extra docs --group lint
133129

134130
- name: Add Sphinx problem matchers
135131
run: |
136132
echo "::add-matcher::.github/problem-matchers/sphinx-build.json"
137133
echo "::add-matcher::.github/problem-matchers/sphinx-lint.json"
138134
139135
- name: Check docs formatting
140-
run: poe format-docs --check
136+
run: |
137+
source .venv/bin/activate
138+
poe format-docs --check
141139
142140
- name: Lint docs
143-
run: poe lint-docs
144-
141+
run: |
142+
source .venv/bin/activate
143+
poe lint-docs
145144
- name: Build docs
146-
run: poe docs -- -e 'SPHINXOPTS=--fail-on-warning --keep-going'
145+
run: |
146+
source .venv/bin/activate
147+
poe docs -- -e 'SPHINXOPTS=--fail-on-warning --keep-going'

.github/workflows/main.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,17 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@v5
2121
- name: Setup Python with uv
22-
# poetry cache requires poetry to already be installed, weirdly
2322
uses: astral-sh/setup-uv@v7
2423
with:
2524
python-version: ${{ matrix.python-version }}
2625
enable-cache: true
2726
- name: Install dependencies with uv
28-
run: uv sync --locked --all-extras --dev
27+
run: uv sync --locked --group test
2928

3029
- name: Test
3130
env:
3231
POETRY_VIRTUALENVS_IN_PROJECT: true
3332
run: |
34-
# Activate the environment
3533
source .venv/bin/activate
3634
poe test-with-coverage
3735

.github/workflows/make_release.yaml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,15 @@ jobs:
1717
name: Bump version, commit and create tag
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: actions/checkout@v4
21-
- name: Install Python tools
22-
uses: BrandonLWhite/pipx-install-action@v1.0.3
23-
- uses: actions/setup-python@v5
20+
- uses: actions/checkout@v5
21+
- name: Setup Python with uv
22+
# poetry cache requires poetry to already be installed, weirdly
23+
uses: astral-sh/setup-uv@v7
2424
with:
2525
python-version: ${{ env.PYTHON_VERSION }}
26-
cache: poetry
27-
26+
enable-cache: true
2827
- name: Bump project version
29-
run: poetry version "${{ env.NEW_VERSION }}"
28+
run: uv version "${{ env.NEW_VERSION }}"
3029

3130
- uses: EndBug/add-and-commit@v9
3231
id: commit_and_tag
@@ -40,19 +39,18 @@ jobs:
4039
runs-on: ubuntu-latest
4140
needs: increment-version
4241
steps:
43-
- uses: actions/checkout@v4
42+
- uses: actions/checkout@v5
4443
with:
4544
ref: ${{ env.NEW_TAG }}
4645

47-
- name: Install Python tools
48-
uses: BrandonLWhite/pipx-install-action@v1.0.3
49-
- uses: actions/setup-python@v5
46+
- name: Setup Python with uv
47+
# poetry cache requires poetry to already be installed, weirdly
48+
uses: astral-sh/setup-uv@v7
5049
with:
5150
python-version: ${{ env.PYTHON_VERSION }}
52-
cache: poetry
53-
51+
enable-cache: true
5452
- name: Build a binary wheel and a source tarball
55-
run: poetry build
53+
run: uv build
5654

5755
- name: Store the package
5856
uses: actions/upload-artifact@v4

pyproject.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,23 @@ dependencies = [
2323

2424
[dependency-groups]
2525
dev = [
26+
{include-group = "test"},
27+
{include-group = "lint"},
28+
]
29+
test = [
2630
"pytest >= 8",
2731
"pytest-cov >= 7.0.0",
32+
{include-group = "poe"},
2833
]
34+
2935
lint = [
3036
"docstrfmt >= 1.11.1",
3137
"mypy >= 1.18.2",
3238
"ruff >= 0.6.4",
3339
"sphinx-lint >= 1.0.0",
40+
{include-group = "poe"},
3441
]
42+
poe = ["poethepoet >= 0.38.0"]
3543

3644
[project.optional-dependencies]
3745
docs = ["sphinx >= 7.4.7"]

0 commit comments

Comments
 (0)