Skip to content

Commit 7d78f45

Browse files
bjoernricksgreenbonebot
authored andcommitted
Misc: Replace poetry with uv
Use uv instead of poetry because it has become the de-facto standard and it's way faster.
1 parent 85ae0ec commit 7d78f45

6 files changed

Lines changed: 918 additions & 1079 deletions

File tree

.docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ RUN apt-get update && \
1414
apt-get remove --purge --auto-remove -y && \
1515
rm -rf /var/lib/apt/lists/*
1616

17-
RUN pipx install poetry
17+
RUN pipx install uv
1818

19-
RUN rm -rf dist && /root/.local/bin/poetry build -f wheel
19+
RUN rm -rf dist && /root/.local/bin/uv build --wheel
2020

2121
FROM debian:stable-slim
2222

.github/workflows/ci-python.yml

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
jobs:
1010
linting:
1111
name: Linting
12+
runs-on: "ubuntu-latest"
1213
strategy:
1314
matrix:
1415
python-version:
@@ -17,15 +18,20 @@ jobs:
1718
- "3.12"
1819
- "3.13"
1920
- "3.14"
20-
uses: greenbone/workflows/.github/workflows/lint-python.yml@main
21-
with:
22-
lint-packages: "greenbone tests"
23-
linter: ruff check
24-
formatter: ruff format --diff
25-
python-version: ${{ matrix.python-version }}
21+
steps:
22+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
23+
- name: Check and lint python packages
24+
uses: greenbone/actions/lint-python@v3
25+
with:
26+
package-manager: uv
27+
packages: greenbone tests
28+
python-version: ${{ matrix.python-version }}
29+
linter: ruff check --diff
30+
formatter: ruff format --check --diff
2631

2732
test:
2833
name: Run all tests
34+
runs-on: "ubuntu-latest"
2935
strategy:
3036
matrix:
3137
python-version:
@@ -34,25 +40,37 @@ jobs:
3440
- "3.12"
3541
- "3.13"
3642
- "3.14"
37-
uses: greenbone/workflows/.github/workflows/test-python.yml@main
38-
with:
39-
python-version: ${{ matrix.python-version }}
43+
steps:
44+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
45+
- name: Set up Python ${{ matrix.python-version }}
46+
uses: greenbone/actions/uv@v3
47+
with:
48+
python-version: ${{ matrix.python-version }}
49+
- name: Run unit test
50+
run: |
51+
uv run python -m unittest -v
4052
4153
codecov:
4254
name: Upload coverage to codecov.io
4355
runs-on: "ubuntu-latest"
4456
steps:
45-
- uses: actions/checkout@v6
57+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4658
- name: Install and calculate and upload coverage to codecov.io
4759
uses: greenbone/actions/coverage-python@v3
4860
with:
4961
python-version: "3.10"
62+
package-manager: uv
5063
token: ${{ secrets.CODECOV_TOKEN }}
5164

5265
mypy:
5366
name: Check type information
54-
uses: greenbone/workflows/.github/workflows/typing-python.yml@main
55-
56-
versioning:
57-
name: Check versioning
58-
uses: greenbone/workflows/.github/workflows/check-version.yml@main
67+
runs-on: "ubuntu-latest"
68+
steps:
69+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
70+
- name: Set up Python ${{ matrix.python-version }}
71+
uses: greenbone/actions/uv@v3
72+
with:
73+
python-version: ${{ matrix.python-version }}
74+
- name: Run mypy
75+
run: |
76+
uv run mypy

README.md

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -573,36 +573,26 @@ no-wait = true
573573

574574
## Development
575575

576-
**greenbone-feed-sync** uses [poetry] for its own dependency management and
576+
**greenbone-feed-sync** uses [uv] for its own dependency management and
577577
build process.
578578

579579
First install poetry via pipx
580580

581581
```sh
582-
python3 -m pipx install poetry
582+
python3 -m pipx install uv
583583
```
584584

585-
Afterwards run
586-
587-
```sh
588-
poetry install
589-
```
590-
591-
in the checkout directory of **greenbone-feed-sync** (the directory containing
592-
the `pyproject.toml` file) to install all dependencies including the packages
593-
only required for development.
594-
595585
Afterwards activate the git hooks for auto-formatting and linting via
596586
[autohooks].
597587

598588
```sh
599-
poetry run autohooks activate
589+
uv run autohooks activate
600590
```
601591

602592
Validate the activated git hooks by running
603593

604594
```sh
605-
poetry run autohooks check
595+
uv run autohooks check
606596
```
607597

608598
## Maintainer
@@ -624,9 +614,9 @@ Copyright (C) 2022-2026 [Greenbone AG][Greenbone Networks]
624614
Licensed under the [GNU General Public License v3.0 or later](LICENSE).
625615

626616
[Greenbone Networks]: https://www.greenbone.net/
627-
[poetry]: https://python-poetry.org/
628617
[pip]: https://pip.pypa.io/
629618
[pipx]: https://pypa.github.io/pipx/
630619
[autohooks]: https://github.com/greenbone/autohooks
631620
[TOML]: https://toml.io/
632621
[pypi]: https://pypi.org
622+
[uv]: https://docs.astral.sh/uv/

0 commit comments

Comments
 (0)