Skip to content

Commit 262a022

Browse files
committed
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 fc00d6a commit 262a022

12 files changed

Lines changed: 2091 additions & 2498 deletions

.docker/Dockerfile

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

16-
RUN pipx install poetry
16+
RUN pipx install uv
1717

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

2020
FROM debian:stable-slim
2121

.github/dependabot.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,3 @@ updates:
2121
interval: "weekly"
2222
commit-message:
2323
prefix: "Deps"
24-
groups:
25-
github-actions:
26-
patterns:
27-
- "*"

.github/workflows/auto-merge.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
name: Auto-merge squash
2+
23
on: pull_request_target
3-
4+
45
permissions:
56
contents: write
67
pull-requests: write
7-
8+
89
jobs:
910
auto-merge:
1011
uses: greenbone/workflows/.github/workflows/auto-merge.yml@main

.github/workflows/changelog.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ on:
66
jobs:
77
changelog:
88
name: Show changelog since last release
9-
runs-on: 'ubuntu-latest'
9+
runs-on: "ubuntu-latest"
1010
steps:
1111
- name: Checkout code
12-
uses: actions/checkout@v6.0.2
12+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1313
with:
1414
fetch-depth: 0 # for conventional commits and getting all git tags
1515
persist-credentials: false

.github/workflows/ci-python.yml

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,23 @@ on:
99
jobs:
1010
linting:
1111
name: Linting
12+
runs-on: "ubuntu-latest"
1213
strategy:
1314
matrix:
1415
python-version:
1516
- "3.9"
1617
- "3.10"
1718
- "3.11"
1819
- "3.12"
19-
uses: greenbone/workflows/.github/workflows/lint-python.yml@main
20-
with:
21-
linter: ruff check
22-
lint-packages: gvmtools tests
23-
python-version: ${{ matrix.python-version }}
20+
steps:
21+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
22+
- name: Check and lint python packages
23+
uses: greenbone/actions/lint-python@v3
24+
with:
25+
package-manager: uv
26+
packages: gvmtools tests
27+
python-version: ${{ matrix.python-version }}
28+
linter: ruff check
2429

2530
lint-scripts:
2631
name: Lint all scripts
@@ -33,55 +38,60 @@ jobs:
3338
- "3.11"
3439
- "3.12"
3540
steps:
36-
- uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v4.2.2
41+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3742
- name: Set up Python ${{ matrix.python-version }}
38-
uses: greenbone/actions/poetry@v3
43+
uses: greenbone/actions/uv@v3
3944
with:
4045
python-version: ${{ matrix.python-version }}
46+
- name: Install dependencies
47+
run: uv sync
4148
- name: Install additional script dependencies
42-
run: poetry run pip install -r scripts/requirements.txt
49+
run: uv pip install -r scripts/requirements.txt
4350
- name: Check with black
44-
run: poetry run black --check scripts/*.gmp.py
51+
run: uv run black --check scripts/*.gmp.py
4552
- name: Lint scripts
4653
run: |
47-
poetry run ruff check --config scripts/ruff.toml scripts/*.py
54+
uv run ruff check --config scripts/ruff.toml scripts/*.py
4855
4956
test:
5057
name: Unit tests
58+
runs-on: "ubuntu-latest"
5159
strategy:
5260
matrix:
5361
python-version:
5462
- "3.9"
5563
- "3.10"
5664
- "3.11"
5765
- "3.12"
58-
uses: greenbone/workflows/.github/workflows/test-python.yml@main
59-
with:
60-
python-version: ${{ matrix.python-version }}
66+
steps:
67+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
68+
- name: Set up Python ${{ matrix.python-version }}
69+
uses: greenbone/actions/uv@v3
70+
with:
71+
python-version: ${{ matrix.python-version }}
72+
- name: Run unit test
73+
run: |
74+
uv run python -m unittest -v
6175
6276
codecov:
6377
name: Upload coverage to codecov.io
6478
needs: test
6579
runs-on: "ubuntu-latest"
6680
steps:
67-
- uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v4.2.2
81+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6882
- name: Calculate and upload coverage to codecov.io
6983
uses: greenbone/actions/coverage-python@v3
7084
with:
7185
token: ${{ secrets.CODECOV_TOKEN }}
86+
package-manager: uv
7287

7388
build-docs:
7489
name: Build the documentation
7590
runs-on: "ubuntu-latest"
7691
steps:
77-
- uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v4.2.2
78-
- name: Install poetry and dependencies
79-
uses: greenbone/actions/poetry@v3
92+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
93+
- name: Set up Python
94+
uses: greenbone/actions/uv@v3
8095
- name: Build docs
8196
run: |
82-
cd docs
83-
poetry run make html
84-
85-
versioning:
86-
name: Check versioning
87-
uses: greenbone/workflows/.github/workflows/check-version.yml@main
97+
cd docs && uv run make html

.github/workflows/codeql-analysis-python.yml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ name: "CodeQL"
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
pull_request:
7-
branches: [ main ]
7+
branches: [main]
88
paths-ignore:
9-
- '**/*.md'
10-
- '**/*.txt'
9+
- "**/*.md"
10+
- "**/*.txt"
1111
schedule:
12-
- cron: '30 5 * * 0' # 5:30h on Sundays
12+
- cron: "30 5 * * 0" # 5:30h on Sundays
1313

1414
jobs:
1515
analyze:
@@ -23,16 +23,15 @@ jobs:
2323
strategy:
2424
fail-fast: false
2525
matrix:
26-
language: [ 'python' ]
26+
language: ["python"]
2727

2828
steps:
29-
- name: Checkout repository
30-
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v4.2.2
29+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3130

32-
- name: Initialize CodeQL
33-
uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
34-
with:
35-
languages: ${{ matrix.language }}
31+
- name: Initialize CodeQL
32+
uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
33+
with:
34+
languages: ${{ matrix.language }}
3635

37-
- name: Perform CodeQL Analysis
38-
uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
36+
- name: Perform CodeQL Analysis
37+
uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1

.github/workflows/deploy-pypi.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: Deploy on PyPI
22

33
on:
44
release:
5-
types: [created]
5+
types:
6+
- created
67

78
jobs:
89
deploy:

.github/workflows/github-pages.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ name: Deploy docs to GitHub Pages
33
on:
44
# Runs on pushes targeting the default branch
55
push:
6-
branches: [main]
6+
branches:
7+
- main
78

89
# Allows you to run this workflow manually from the Actions tab
910
workflow_dispatch:
@@ -21,4 +22,22 @@ concurrency:
2122

2223
jobs:
2324
deploy:
24-
uses: greenbone/workflows/.github/workflows/docs-python.yml@main
25+
environment:
26+
name: github-pages
27+
url: ${{ steps.deployment.outputs.page_url }}
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
32+
- name: Set up Python
33+
uses: greenbone/actions/uv@v3
34+
- name: Build Documentation
35+
run: |
36+
cd docs && uv run make html
37+
- name: Upload artifact
38+
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
39+
with:
40+
path: docs/build/html
41+
- name: Deploy to GitHub Pages
42+
id: deployment
43+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
with:
4141
release-type-input: ${{ inputs.release-type }}
4242
- name: Checkout code
43-
uses: actions/checkout@v6.0.2
43+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4444
with:
4545
fetch-depth: 0 # for conventional commits and getting all git tags
4646
persist-credentials: false

0 commit comments

Comments
 (0)