Skip to content
This repository was archived by the owner on May 7, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ci: update github actions to use uv instead of poetry
  • Loading branch information
tembleking committed May 8, 2025
commit 1a12eb9f1c1ea79993eecc6f7176737f9f5adb98
36 changes: 12 additions & 24 deletions .github/workflows/ci-master-scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,21 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python_version }}

- name: Install Poetry
run: python -m pip install poetry poetry-dynamic-versioning
enable-cache: true
cache-dependency-glob: "uv.lock"

- uses: actions/cache@v3
name: Cache Poetry dependencies
- uses: actions/setup-python@v5
with:
path: |
~/.cache
~/.local/share/virtualenvs/
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-

- name: Get dependencies
run: poetry install
python-version: ${{ matrix.python_version }}

- name: Lint
continue-on-error: true
run: |
# stop the build if there are Python syntax errors or undefined names
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
uses: astral-sh/ruff-action@v3

- name: Check format
run: ruff format --check

- name: Travis Test - Start agent
id: start_agent
Expand All @@ -61,7 +49,7 @@ jobs:

- name: Travis Test - Install dependencies
run: |
poetry build
uv build
python -m pip install $(find dist -iname "*.whl" | head -1)

- name: Travis Test - Secure APIs
Expand All @@ -75,7 +63,7 @@ jobs:
SDC_SECURE_TOKEN: ${{ secrets.STAGING_SECURE_API_TOKEN }}
SDC_MONITOR_URL: "https://app-staging.sysdigcloud.com"
SDC_SECURE_URL: "https://secure-staging.sysdig.com"
run: poetry run mamba -f documentation
run: uv run mamba -f documentation

- name: Travis Test - Stop agent
run: ./test/stop_agent.sh
Expand Down
45 changes: 16 additions & 29 deletions .github/workflows/ci-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,40 +25,29 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python_version }}

- name: Install Poetry
run: python -m pip install poetry poetry-dynamic-versioning
enable-cache: true
cache-dependency-glob: "uv.lock"

- uses: actions/cache@v3
name: Cache Poetry dependencies
- uses: actions/setup-python@v5
with:
path: |
~/.cache
~/.local/share/virtualenvs/
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-

- name: Get dependencies
run: poetry install
python-version: ${{ matrix.python_version }}

- name: Lint
run: |
# stop the build if there are Python syntax errors or undefined names
poetry run flake8
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
uses: astral-sh/ruff-action@v3

- name: Check format
run: ruff format --check

- name: Test in staging
env:
SDC_MONITOR_TOKEN: ${{ secrets.STAGING_MONITOR_API_TOKEN }}
SDC_SECURE_TOKEN: ${{ secrets.STAGING_SECURE_API_TOKEN }}
SDC_MONITOR_URL: "https://app-staging.sysdigcloud.com"
SDC_SECURE_URL: "https://secure-staging.sysdig.com"
run: poetry run mamba -f documentation -t integration
run: uv run mamba -f documentation -t integration

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

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.10

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry poetry-dynamic-versioning
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Build
run: poetry build
run: uv build
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:

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

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

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
22 changes: 13 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,19 @@ jobs:
steps:
- uses: actions/checkout@v4

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry poetry-dynamic-versioning
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.10

- name: Build and publish
run: poetry publish --build -u ${{ secrets.PYPI_USER }} -p ${{ secrets.PYPI_PASSWORD }}
- name: Build
run: uv build

- name: Publish
run: uv publish -u ${{ secrets.PYPI_USER }} -p ${{ secrets.PYPI_PASSWORD }}
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ repos:
args: [ --fix ]
# Run the formatter.
- id: ruff-format

- repo: https://github.com/rhysd/actionlint
rev: v1.7.7
hooks:
- id: actionlint

8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

.PHONY: test
test:
poetry run mamba -f documentation
uv run mamba -f documentation

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

cover: .coverage
poetry run coverage report --include 'sdcclient/*'
uv run coverage report --include 'sdcclient/*'

.PHONY: cover-html
cover-html: .coverage
poetry run coverage html -d coverage --include 'sdcclient/*'
uv run coverage html -d coverage --include 'sdcclient/*'

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ Installation

#### Manual (development only)

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

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

Quick start
-----------
Expand Down
6 changes: 3 additions & 3 deletions docs/quickstart/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ Automatic with PyPI
Manual (development only)
-------------------------

This method requires `Poetry`_ installed.
This method requires `uv`_ installed.

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

::

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