Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
20 changes: 8 additions & 12 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,15 @@ jobs:
snapd_integration_test:
strategy:
matrix:
os: ["ubuntu-24.04", "ubuntu-22.04"]
os: ["ubuntu-26.04", "ubuntu-24.04", "ubuntu-22.04"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: install python dependencies
run: |
sudo apt-get update

python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install poetry==2.3.1
poetry config virtualenvs.in-project true # so sudo can find the venv
poetry install
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: install uv and dependencies
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
enable-cache: true
- run: uv sync
- name: snapd setup
run: |
sudo apt-get install -y snapd
Expand Down Expand Up @@ -50,4 +46,4 @@ jobs:
- name: integration test
run: |
# access to the snapd socket requires root privileges
sudo "$(which poetry)" run pytest tests/integration
sudo "$(which uv)" run pytest tests/integration
2 changes: 1 addition & 1 deletion .github/workflows/integration-tpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
snapd_integration_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Comment thread
st3v3nmw marked this conversation as resolved.

- name: Install dependencies
run: |
Expand Down
32 changes: 15 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,34 @@ jobs:
name: lint and typecheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: install poetry and dependencies
run: |
python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install poetry==2.3.1
poetry install
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: install uv and dependencies
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
enable-cache: true
- run: uv sync
- name: lint
run: poetry run ruff check .
run: uv run ruff check .
- name: typecheck
run: poetry run mypy snap_http/
run: uv run mypy snap_http/

unit_test:
name: tox unit test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: install poetry and dependencies
run: |
python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install poetry==2.3.1
poetry install
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: install uv and dependencies
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
enable-cache: true
- run: uv sync
- name: install additional python versions
run: |
sudo add-apt-repository ppa:deadsnakes/ppa

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small aside: can uv take care of installing the different python versions?

sudo apt-get install -y python3.8 python3.9 python3.10 python3.11 python3.12 python3.13 python3.14
sudo apt-get install -y python3.8-distutils python3.9-distutils
- name: tox unit test
run: poetry run tox
run: uv run tox

integration_test:
uses: ./.github/workflows/integration-test.yml
1,068 changes: 0 additions & 1,068 deletions poetry.lock

This file was deleted.

57 changes: 37 additions & 20 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,31 +1,52 @@
[tool.poetry]
[project]
name = "snap-http"
version = "1.12.1"
description = "A library for interacting with snapd via its REST API."
authors = ["Mitch Burton <mitch.burton@canonical.com>", "Stephen Mwangi <mail@stephenmwangi.com>"]
readme = "README.md"
exclude = [
"tests/"
authors = [
{ name = "Mitch Burton", email = "mitch.burton@canonical.com" },
{ name = "Stephen Mwangi", email = "mail@stephenmwangi.com" },
]
requires-python = ">=3.8"
readme = "README.md"
license = "GPL-2.0-only"
license-files = ["LICENSE"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]

[tool.poetry.dependencies]
python = ">=3.8"
[dependency-groups]
test = [
"pytest>=8.3.5,<9",
"pytest-cov>=5.0.0,<6",
"pyyaml>=6.0,<7",
"tox>=4.25.0,<5",
]
dev = [
"ruff>=0.14.14,<0.15",
"mypy>=1.14.1,<2",
]

[tool.poetry.group.test.dependencies]
pytest = "^8.3.5"
pytest-cov = "^5.0.0"
pyyaml = "^6.0"
tox = "^4.25.0"
[tool.uv]
default-groups = "all"

[tool.poetry.group.dev.dependencies]
ruff = "^0.14.14"
mypy = "^1.14.1"
[tool.uv.build-backend]
module-root = ""
source-exclude = ["tests/"]
wheel-exclude = ["tests/"]

[build-system]
requires = ["uv_build>=0.12.0,<0.13.0"]
build-backend = "uv_build"

[tool.ruff]
exclude = [
Expand All @@ -36,7 +57,3 @@ exclude = [

[tool.ruff.lint.mccabe]
max-complexity = 10

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
5 changes: 3 additions & 2 deletions tests/integration_tpm/assets/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ mountpoint -q /mnt/host || sudo mount -t 9p -o trans=virtio hostshare /mnt/host
cd /mnt/host/

# run integration_tpm tests
sudo poetry install
sudo poetry run pytest tests/integration_tpm
curl -LsSf https://astral.sh/uv/install.sh | sudo sh
sudo /root/.local/bin/uv sync
sudo /root/.local/bin/uv run pytest tests/integration_tpm
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ env_list =
[testenv]
skip_install = true
allowlist_externals =
poetry
uv
commands_pre =
poetry install
uv sync --group test --active
commands =
poetry run pytest tests/unit --cov snap_http/ --cov-branch \
uv run --active pytest tests/unit --cov snap_http/ --cov-branch \
--cov-report term-missing --cov-fail-under 94 --import-mode importlib
Loading
Loading