Skip to content

Commit 44abdcd

Browse files
Copilotliudger
andcommitted
Update GitHub Actions workflows and documentation to use uv instead of Poetry
Co-authored-by: liudger <4112111+liudger@users.noreply.github.com>
1 parent 8f52535 commit 44abdcd

10 files changed

Lines changed: 72 additions & 2931 deletions

File tree

.github/workflows/linting.yaml

Lines changed: 37 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -17,161 +17,131 @@ jobs:
1717
steps:
1818
- name: ⤵️ Check out code from GitHub
1919
uses: actions/checkout@v4.2.2
20-
- name: 🏗 Set up Poetry
21-
run: pipx install poetry
20+
- name: 🏗 Set up uv
21+
run: pipx install uv
2222
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
2323
id: python
2424
uses: actions/setup-python@v5.6.0
2525
with:
2626
python-version: ${{ env.DEFAULT_PYTHON }}
27-
cache: "poetry"
28-
- name: 🏗 Install workflow dependencies
29-
run: |
30-
poetry config virtualenvs.create true
31-
poetry config virtualenvs.in-project true
3227
- name: 🏗 Install Python dependencies
33-
run: poetry install --no-interaction
28+
run: uv sync --dev
3429
- name: 🚀 Check code for common misspellings
35-
run: poetry run pre-commit run codespell --all-files
30+
run: uv run pre-commit run codespell --all-files
3631

3732
ruff:
3833
name: Ruff
3934
runs-on: ubuntu-latest
4035
steps:
4136
- name: ⤵️ Check out code from GitHub
4237
uses: actions/checkout@v4.2.2
43-
- name: 🏗 Set up Poetry
44-
run: pipx install poetry
38+
- name: 🏗 Set up uv
39+
run: pipx install uv
4540
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
4641
id: python
4742
uses: actions/setup-python@v5.6.0
4843
with:
4944
python-version: ${{ env.DEFAULT_PYTHON }}
50-
cache: "poetry"
51-
- name: 🏗 Install workflow dependencies
52-
run: |
53-
poetry config virtualenvs.create true
54-
poetry config virtualenvs.in-project true
5545
- name: 🏗 Install Python dependencies
56-
run: poetry install --no-interaction
46+
run: uv sync --dev
5747
- name: 🚀 Run ruff linter
58-
run: poetry run ruff check --output-format=github .
48+
run: uv run ruff check --output-format=github .
5949
- name: 🚀 Run ruff formatter
60-
run: poetry run ruff format --check .
50+
run: uv run ruff format --check .
6151

6252
pre-commit-hooks:
6353
name: pre-commit-hooks
6454
runs-on: ubuntu-latest
6555
steps:
6656
- name: ⤵️ Check out code from GitHub
6757
uses: actions/checkout@v4.2.2
68-
- name: 🏗 Set up Poetry
69-
run: pipx install poetry
58+
- name: 🏗 Set up uv
59+
run: pipx install uv
7060
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
7161
id: python
7262
uses: actions/setup-python@v5.6.0
7363
with:
7464
python-version: ${{ env.DEFAULT_PYTHON }}
75-
cache: "poetry"
76-
- name: 🏗 Install workflow dependencies
77-
run: |
78-
poetry config virtualenvs.create true
79-
poetry config virtualenvs.in-project true
8065
- name: 🏗 Install Python dependencies
81-
run: poetry install --no-interaction
66+
run: uv sync --dev
8267
- name: 🚀 Check Python AST
83-
run: poetry run pre-commit run check-ast --all-files
68+
run: uv run pre-commit run check-ast --all-files
8469
- name: 🚀 Check for case conflicts
85-
run: poetry run pre-commit run check-case-conflict --all-files
70+
run: uv run pre-commit run check-case-conflict --all-files
8671
- name: 🚀 Check docstring is first
87-
run: poetry run pre-commit run check-docstring-first --all-files
72+
run: uv run pre-commit run check-docstring-first --all-files
8873
- name: 🚀 Check that executables have shebangs
89-
run: poetry run pre-commit run check-executables-have-shebangs --all-files
74+
run: uv run pre-commit run check-executables-have-shebangs --all-files
9075
- name: 🚀 Check JSON files
91-
run: poetry run pre-commit run check-json --all-files
76+
run: uv run pre-commit run check-json --all-files
9277
- name: 🚀 Check for merge conflicts
93-
run: poetry run pre-commit run check-merge-conflict --all-files
78+
run: uv run pre-commit run check-merge-conflict --all-files
9479
- name: 🚀 Check for broken symlinks
95-
run: poetry run pre-commit run check-symlinks --all-files
80+
run: uv run pre-commit run check-symlinks --all-files
9681
- name: 🚀 Check TOML files
97-
run: poetry run pre-commit run check-toml --all-files
82+
run: uv run pre-commit run check-toml --all-files
9883
- name: 🚀 Check XML files
99-
run: poetry run pre-commit run check-yaml --all-files
84+
run: uv run pre-commit run check-yaml --all-files
10085
- name: 🚀 Check YAML files
101-
run: poetry run pre-commit run check-yaml --all-files
86+
run: uv run pre-commit run check-yaml --all-files
10287
- name: 🚀 Detect Private Keys
103-
run: poetry run pre-commit run detect-private-key --all-files
88+
run: uv run pre-commit run detect-private-key --all-files
10489
- name: 🚀 Check End of Files
105-
run: poetry run pre-commit run end-of-file-fixer --all-files
90+
run: uv run pre-commit run end-of-file-fixer --all-files
10691
- name: 🚀 Trim Trailing Whitespace
107-
run: poetry run pre-commit run trailing-whitespace --all-files
92+
run: uv run pre-commit run trailing-whitespace --all-files
10893

10994
pylint:
11095
name: pylint
11196
runs-on: ubuntu-latest
11297
steps:
11398
- name: ⤵️ Check out code from GitHub
11499
uses: actions/checkout@v4.2.2
115-
- name: 🏗 Set up Poetry
116-
run: pipx install poetry
100+
- name: 🏗 Set up uv
101+
run: pipx install uv
117102
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
118103
id: python
119104
uses: actions/setup-python@v5.6.0
120105
with:
121106
python-version: ${{ env.DEFAULT_PYTHON }}
122-
cache: "poetry"
123-
- name: 🏗 Install workflow dependencies
124-
run: |
125-
poetry config virtualenvs.create true
126-
poetry config virtualenvs.in-project true
127107
- name: 🏗 Install Python dependencies
128-
run: poetry install --no-interaction
108+
run: uv sync --dev
129109
- name: 🚀 Run pylint
130-
run: poetry run pre-commit run pylint --all-files
110+
run: uv run pre-commit run pylint --all-files
131111

132112
yamllint:
133113
name: yamllint
134114
runs-on: ubuntu-latest
135115
steps:
136116
- name: ⤵️ Check out code from GitHub
137117
uses: actions/checkout@v4.2.2
138-
- name: 🏗 Set up Poetry
139-
run: pipx install poetry
118+
- name: 🏗 Set up uv
119+
run: pipx install uv
140120
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
141121
id: python
142122
uses: actions/setup-python@v5.6.0
143123
with:
144124
python-version: ${{ env.DEFAULT_PYTHON }}
145-
cache: "poetry"
146-
- name: 🏗 Install workflow dependencies
147-
run: |
148-
poetry config virtualenvs.create true
149-
poetry config virtualenvs.in-project true
150125
- name: 🏗 Install Python dependencies
151-
run: poetry install --no-interaction
126+
run: uv sync --dev
152127
- name: 🚀 Run yamllint
153-
run: poetry run yamllint .
128+
run: uv run yamllint .
154129

155130
prettier:
156131
name: Prettier
157132
runs-on: ubuntu-latest
158133
steps:
159134
- name: ⤵️ Check out code from GitHub
160135
uses: actions/checkout@v4.2.2
161-
- name: 🏗 Set up Poetry
162-
run: pipx install poetry
136+
- name: 🏗 Set up uv
137+
run: pipx install uv
163138
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
164139
id: python
165140
uses: actions/setup-python@v5.6.0
166141
with:
167142
python-version: ${{ env.DEFAULT_PYTHON }}
168-
cache: "poetry"
169-
- name: 🏗 Install workflow dependencies
170-
run: |
171-
poetry config virtualenvs.create true
172-
poetry config virtualenvs.in-project true
173143
- name: 🏗 Install Python dependencies
174-
run: poetry install --no-interaction
144+
run: uv sync --dev
175145
- name: 🏗 Set up Node.js
176146
uses: actions/setup-node@v4.4.0
177147
with:
@@ -180,4 +150,4 @@ jobs:
180150
- name: 🏗 Install NPM dependencies
181151
run: npm install
182152
- name: 🚀 Run prettier
183-
run: poetry run pre-commit run prettier --all-files
153+
run: uv run pre-commit run prettier --all-files

.github/workflows/tests.yaml

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,17 @@ jobs:
2020
steps:
2121
- name: ⤵️ Check out code from GitHub
2222
uses: actions/checkout@v4.2.2
23-
- name: 🏗 Set up Poetry
24-
run: pipx install poetry
23+
- name: 🏗 Set up uv
24+
run: pipx install uv
2525
- name: 🏗 Set up Python ${{ matrix.python }}
2626
id: python
2727
uses: actions/setup-python@v5.6.0
2828
with:
2929
python-version: ${{ matrix.python }}
30-
cache: "poetry"
31-
- name: 🏗 Install workflow dependencies
32-
run: |
33-
poetry config virtualenvs.create true
34-
poetry config virtualenvs.in-project true
3530
- name: 🏗 Install dependencies
36-
run: poetry install --no-interaction
31+
run: uv sync --dev
3732
- name: 🚀 Run pytest
38-
run: poetry run pytest --cov=bsblan tests
33+
run: uv run pytest --cov=bsblan tests
3934
- name: ⬆️ Upload coverage artifact
4035
uses: actions/upload-artifact@v4.6.2
4136
with:
@@ -53,24 +48,19 @@ jobs:
5348
fetch-depth: 0
5449
- name: ⬇️ Download coverage data
5550
uses: actions/download-artifact@v4.3.0
56-
- name: 🏗 Set up Poetry
57-
run: pipx install poetry
51+
- name: 🏗 Set up uv
52+
run: pipx install uv
5853
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
5954
id: python
6055
uses: actions/setup-python@v5.6.0
6156
with:
6257
python-version: ${{ env.DEFAULT_PYTHON }}
63-
cache: "poetry"
64-
- name: 🏗 Install workflow dependencies
65-
run: |
66-
poetry config virtualenvs.create true
67-
poetry config virtualenvs.in-project true
6858
- name: 🏗 Install dependencies
69-
run: poetry install --no-interaction
59+
run: uv sync --dev
7060
- name: 🚀 Process coverage results
7161
run: |
72-
poetry run coverage combine coverage*/.coverage*
73-
poetry run coverage xml -i
62+
uv run coverage combine coverage*/.coverage*
63+
uv run coverage xml -i
7464
- name: 🚀 Upload coverage report
7565
uses: codecov/codecov-action@v5.4.3
7666
with:

.github/workflows/typing.yaml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,14 @@ jobs:
1717
steps:
1818
- name: ⤵️ Check out code from GitHub
1919
uses: actions/checkout@v4.2.2
20-
- name: 🏗 Set up Poetry
21-
run: pipx install poetry
20+
- name: 🏗 Set up uv
21+
run: pipx install uv
2222
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
2323
id: python
2424
uses: actions/setup-python@v5.6.0
2525
with:
2626
python-version: ${{ env.DEFAULT_PYTHON }}
27-
cache: "poetry"
28-
- name: 🏗 Install workflow dependencies
29-
run: |
30-
poetry config virtualenvs.create true
31-
poetry config virtualenvs.in-project true
3227
- name: 🏗 Install dependencies
33-
run: poetry install --no-interaction
28+
run: uv sync --dev
3429
- name: 🚀 Run mypy
35-
run: poetry run mypy examples src tests
30+
run: uv run mypy examples src tests

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,34 +137,34 @@ Thank you for being involved! :heart_eyes:
137137

138138
## Setting up development environment
139139

140-
This Python project is fully managed using the [Poetry][poetry] dependency manager.
140+
This Python project is fully managed using the [uv][uv] dependency manager.
141141
But also relies on the use of NodeJS for certain checks during development.
142142

143143
You need at least:
144144

145145
- Python 3.12+
146-
- [Poetry][poetry-install]
146+
- [uv][uv-install]
147147
- NodeJS 22.14.0+ (including NPM)
148148

149149
To install all packages, including all development requirements:
150150

151151
```bash
152152
npm install
153-
poetry install
153+
uv sync --dev
154154
```
155155

156156
As this repository uses the [pre-commit][pre-commit] framework, all changes
157157
are linted and tested with each commit. You can run all checks and tests
158158
manually, using the following command:
159159

160160
```bash
161-
poetry run pre-commit run --all-files
161+
uv run pre-commit run --all-files
162162
```
163163

164164
To run just the Python tests:
165165

166166
```bash
167-
poetry run pytest
167+
uv run pytest
168168
```
169169

170170
## Authors & contributors
@@ -214,6 +214,8 @@ SOFTWARE.
214214
[maintenance-shield]: https://img.shields.io/maintenance/yes/2025.svg
215215
[poetry]: https://python-poetry.org
216216
[poetry-install]: https://python-poetry.org/docs/#installation
217+
[uv]: https://docs.astral.sh/uv/
218+
[uv-install]: https://docs.astral.sh/uv/getting-started/installation/
217219
[pre-commit]: https://pre-commit.com/
218220
[project-stage-shield]: https://img.shields.io/badge/project%20stage-experimental-yellow.svg
219221
[pypi]: https://pypi.org/project/python-bsblan/

0 commit comments

Comments
 (0)