Skip to content

Commit 1a12eb9

Browse files
committed
ci: update github actions to use uv instead of poetry
1 parent 70396c3 commit 1a12eb9

File tree

8 files changed

+59
-74
lines changed

8 files changed

+59
-74
lines changed

.github/workflows/ci-master-scheduled.yml

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,33 +22,21 @@ jobs:
2222
steps:
2323
- uses: actions/checkout@v4
2424

25-
- uses: actions/setup-python@v4
25+
- name: Install uv
26+
uses: astral-sh/setup-uv@v5
2627
with:
27-
python-version: ${{ matrix.python_version }}
28-
29-
- name: Install Poetry
30-
run: python -m pip install poetry poetry-dynamic-versioning
28+
enable-cache: true
29+
cache-dependency-glob: "uv.lock"
3130

32-
- uses: actions/cache@v3
33-
name: Cache Poetry dependencies
31+
- uses: actions/setup-python@v5
3432
with:
35-
path: |
36-
~/.cache
37-
~/.local/share/virtualenvs/
38-
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
39-
restore-keys: |
40-
${{ runner.os }}-poetry-
41-
42-
- name: Get dependencies
43-
run: poetry install
33+
python-version: ${{ matrix.python_version }}
4434

4535
- name: Lint
46-
continue-on-error: true
47-
run: |
48-
# stop the build if there are Python syntax errors or undefined names
49-
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
50-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
51-
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
36+
uses: astral-sh/ruff-action@v3
37+
38+
- name: Check format
39+
run: ruff format --check
5240

5341
- name: Travis Test - Start agent
5442
id: start_agent
@@ -61,7 +49,7 @@ jobs:
6149
6250
- name: Travis Test - Install dependencies
6351
run: |
64-
poetry build
52+
uv build
6553
python -m pip install $(find dist -iname "*.whl" | head -1)
6654
6755
- name: Travis Test - Secure APIs
@@ -75,7 +63,7 @@ jobs:
7563
SDC_SECURE_TOKEN: ${{ secrets.STAGING_SECURE_API_TOKEN }}
7664
SDC_MONITOR_URL: "https://app-staging.sysdigcloud.com"
7765
SDC_SECURE_URL: "https://secure-staging.sysdig.com"
78-
run: poetry run mamba -f documentation
66+
run: uv run mamba -f documentation
7967

8068
- name: Travis Test - Stop agent
8169
run: ./test/stop_agent.sh

.github/workflows/ci-pull-request.yml

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -25,40 +25,29 @@ jobs:
2525
steps:
2626
- uses: actions/checkout@v4
2727

28-
- uses: actions/setup-python@v4
28+
- name: Install uv
29+
uses: astral-sh/setup-uv@v5
2930
with:
30-
python-version: ${{ matrix.python_version }}
31-
32-
- name: Install Poetry
33-
run: python -m pip install poetry poetry-dynamic-versioning
31+
enable-cache: true
32+
cache-dependency-glob: "uv.lock"
3433

35-
- uses: actions/cache@v3
36-
name: Cache Poetry dependencies
34+
- uses: actions/setup-python@v5
3735
with:
38-
path: |
39-
~/.cache
40-
~/.local/share/virtualenvs/
41-
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
42-
restore-keys: |
43-
${{ runner.os }}-poetry-
44-
45-
- name: Get dependencies
46-
run: poetry install
36+
python-version: ${{ matrix.python_version }}
4737

4838
- name: Lint
49-
run: |
50-
# stop the build if there are Python syntax errors or undefined names
51-
poetry run flake8
52-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
53-
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
39+
uses: astral-sh/ruff-action@v3
40+
41+
- name: Check format
42+
run: ruff format --check
5443

5544
- name: Test in staging
5645
env:
5746
SDC_MONITOR_TOKEN: ${{ secrets.STAGING_MONITOR_API_TOKEN }}
5847
SDC_SECURE_TOKEN: ${{ secrets.STAGING_SECURE_API_TOKEN }}
5948
SDC_MONITOR_URL: "https://app-staging.sysdigcloud.com"
6049
SDC_SECURE_URL: "https://secure-staging.sysdig.com"
61-
run: poetry run mamba -f documentation -t integration
50+
run: uv run mamba -f documentation -t integration
6251

6352
test-release:
6453
runs-on: ubuntu-latest
@@ -81,14 +70,12 @@ jobs:
8170
run: git-chglog -c .github/git-chglog/config.yml -o RELEASE_CHANGELOG.md $(git describe --tags $(git rev-list --tags --max-count=1))
8271

8372
- name: Set up Python
84-
uses: actions/setup-python@v4
73+
uses: actions/setup-python@v5
8574
with:
86-
python-version: 3.8
75+
python-version: 3.10
8776

88-
- name: Install dependencies
89-
run: |
90-
python -m pip install --upgrade pip
91-
pip install poetry poetry-dynamic-versioning
77+
- name: Install uv
78+
uses: astral-sh/setup-uv@v5
9279

9380
- name: Build
94-
run: poetry build
81+
run: uv build

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343

4444
# Initializes the CodeQL tools for scanning.
4545
- name: Initialize CodeQL
46-
uses: github/codeql-action/init@v2
46+
uses: github/codeql-action/init@v3
4747
with:
4848
languages: ${{ matrix.language }}
4949
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -54,7 +54,7 @@ jobs:
5454
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5555
# If this step fails, then you should remove it and run the build manually (see below)
5656
- name: Autobuild
57-
uses: github/codeql-action/autobuild@v2
57+
uses: github/codeql-action/autobuild@v3
5858

5959
# ℹ️ Command-line programs to run using the OS shell.
6060
# 📚 https://git.io/JvXDl
@@ -68,4 +68,4 @@ jobs:
6868
# make release
6969

7070
- name: Perform CodeQL Analysis
71-
uses: github/codeql-action/analyze@v2
71+
uses: github/codeql-action/analyze@v3

.github/workflows/release.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,19 @@ jobs:
4747
steps:
4848
- uses: actions/checkout@v4
4949

50-
- name: Set up Python
51-
uses: actions/setup-python@v4
50+
- name: Install uv
51+
uses: astral-sh/setup-uv@v5
5252
with:
53-
python-version: 3.8
53+
enable-cache: true
54+
cache-dependency-glob: "uv.lock"
5455

55-
- name: Install dependencies
56-
run: |
57-
python -m pip install --upgrade pip
58-
pip install poetry poetry-dynamic-versioning
56+
- name: Set up Python
57+
uses: actions/setup-python@v5
58+
with:
59+
python-version: 3.10
5960

60-
- name: Build and publish
61-
run: poetry publish --build -u ${{ secrets.PYPI_USER }} -p ${{ secrets.PYPI_PASSWORD }}
61+
- name: Build
62+
run: uv build
63+
64+
- name: Publish
65+
run: uv publish -u ${{ secrets.PYPI_USER }} -p ${{ secrets.PYPI_PASSWORD }}

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,9 @@ repos:
77
args: [ --fix ]
88
# Run the formatter.
99
- id: ruff-format
10+
11+
- repo: https://github.com/rhysd/actionlint
12+
rev: v1.7.7
13+
hooks:
14+
- id: actionlint
15+

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
.PHONY: test
44
test:
5-
poetry run mamba -f documentation
5+
uv run mamba -f documentation
66

77
.coverage:
8-
poetry run coverage run $(shell poetry run which mamba) -f documentation || true
8+
uv run coverage run $(shell uv run which mamba) -f documentation || true
99

1010
cover: .coverage
11-
poetry run coverage report --include 'sdcclient/*'
11+
uv run coverage report --include 'sdcclient/*'
1212

1313
.PHONY: cover-html
1414
cover-html: .coverage
15-
poetry run coverage html -d coverage --include 'sdcclient/*'
15+
uv run coverage html -d coverage --include 'sdcclient/*'
1616

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ Installation
1818

1919
#### Manual (development only)
2020

21-
This method requires [Poetry](https://python-poetry.org/) installed
21+
This method requires [uv](https://docs.astral.sh/uv/) installed
2222

2323
git clone https://github.com/sysdiglabs/sysdig-sdk-python.git
2424
cd python-sdc-client
25-
poetry install
25+
uv build
2626

2727
Quick start
2828
-----------

docs/quickstart/install.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ Automatic with PyPI
1111
Manual (development only)
1212
-------------------------
1313

14-
This method requires `Poetry`_ installed.
14+
This method requires `uv`_ installed.
1515

16-
.. _Poetry: https://python-poetry.org/
16+
.. _uv: https://docs.astral.sh/uv/
1717

1818
::
1919

2020
$ git clone https://github.com/sysdiglabs/sysdig-sdk-python.git
2121
$ cd python-sdc-client
22-
$ poetry install
22+
$ uv build

0 commit comments

Comments
 (0)