Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/build-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ on:
paths:
- "Containerfile"
- "pyproject.toml"
- "poetry.lock"
- "uv.lock"
- "sdwire/**"
- "tests/e2e/**"
- ".github/workflows/build-container.yml"
pull_request:
paths:
- "Containerfile"
- "pyproject.toml"
- "poetry.lock"
- "uv.lock"
- "sdwire/**"
- "tests/e2e/**"
- ".github/workflows/build-container.yml"
Expand Down
23 changes: 8 additions & 15 deletions .github/workflows/pypi_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install pipx
run: |
sudo apt update
sudo apt install pipx
pipx ensurepath
- name: Install Poetry
run: |
pipx install poetry==1.8.3
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Build
run: |
poetry build
uv build
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -54,13 +44,16 @@ jobs:
run: |
python -m venv /tmp/sut
/tmp/sut/bin/pip install dist/*.whl
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Install the test harness
env:
UV_PROJECT_ENVIRONMENT: /tmp/harness
run: |
# system python, so the harness can import gi from python3-gi
/usr/bin/python3 -m venv --system-site-packages /tmp/harness
pipx install poetry
# only the locked e2e group, the CLI under test comes from the wheel
VIRTUAL_ENV=/tmp/harness poetry install --only e2e --no-root
uv sync --locked --only-group e2e --no-install-project
- name: Run e2e tests
env:
SDWIRE_CMD: /tmp/sut/bin/sdwire
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ echo auto | sudo tee /sys/bus/usb/devices/2-8/power/control

## Testing

Unit tests: `poetry run pytest tests`.
Unit tests: `uv run pytest tests`.

End-to-end tests run the installed CLI against simulated devices (umockdev) or
real hardware. See [tests/e2e/README.md](tests/e2e/README.md).
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Build-Depends: debhelper-compat (= 13),
python3-all,
python3-click,
python3-ftdi,
python3-poetry,
python3-hatchling,
python3-usb
Testsuite: autopkgtest-pkg-python
Standards-Version: 4.6.2
Expand Down
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ python3.pkgs.buildPythonApplication {
src = ./.;

nativeBuildInputs = with python3.pkgs; [
poetry-core
hatchling
pythonRelaxDepsHook
];

Expand Down
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
devShells.default = pkgs.mkShell {
packages = with pkgs; [
python3
poetry
uv
(self.packages.${system}.default)
];
};
Expand Down
331 changes: 0 additions & 331 deletions poetry.lock

This file was deleted.

56 changes: 34 additions & 22 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,32 +1,44 @@
[tool.poetry]
[project]
name = "sdwire"
version = "0.4.0"
description = "CLI application to interact with Badgerd SDWire devices"
authors = ["Talha Can Havadar <havadartalha@gmail.com>"]
license = "GPL-3"
authors = [{ name = "Talha Can Havadar", email = "havadartalha@gmail.com" }]
requires-python = ">=3.12,<4"
readme = "README.md"
packages = [{ include = "sdwire" }]
license = "GPL-3.0-only"
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dependencies = [
"click>=8.1.7,<9",
"pyusb>=1.2.1,<2",
"pyftdi>=0.56.0,<0.57",
]

[tool.poetry.dependencies]
python = "^3.12"
click = "^8.1.7"
pyusb = "^1.2.1"
pyftdi = "^0.56.0"
[project.scripts]
sdwire = "sdwire:main.main"

[dependency-groups]
dev = [
"black>=24.8.0,<25",
"pytest>=9.2.0,<10",
]
# harness of the end-to-end tests (tests/e2e), installed on its own in CI
e2e = [
"pytest>=9.2.0,<10",
"pytest-timeout>=2.4.0,<3",
"syrupy>=6.1.1,<7",
]

[tool.poetry.group.dev.dependencies]
black = ">=24.8,<27.0"
pytest = "^9.2.0"
[tool.hatch.build.targets.sdist]
include = ["sdwire"]

# harness of the end-to-end tests (tests/e2e), installed on its own in CI
[tool.poetry.group.e2e.dependencies]
pytest = "^9.2.0"
pytest-timeout = "^2.4.0"
syrupy = "^6.1.1"
[tool.hatch.build.targets.wheel]
include = ["sdwire"]

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.scripts]
sdwire = "sdwire:main.main"
requires = ["hatchling"]
build-backend = "hatchling.build"
2 changes: 1 addition & 1 deletion tests/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ user so permission errors are real:
```
python3 -m venv /tmp/sut && /tmp/sut/bin/pip install .
python3 -m venv --system-site-packages /tmp/harness
VIRTUAL_ENV=/tmp/harness poetry install --only e2e --no-root
UV_PROJECT_ENVIRONMENT=/tmp/harness uv sync --locked --only-group e2e --no-install-project
SDWIRE_CMD=/tmp/sut/bin/sdwire umockdev-wrapper /tmp/harness/bin/pytest tests/e2e
```

Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/framework/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ def expected_version() -> str | None:
"""
pyproject = Path(__file__).parents[3] / "pyproject.toml"
if pyproject.is_file():
return tomllib.loads(pyproject.read_text())["tool"]["poetry"]["version"]
return tomllib.loads(pyproject.read_text())["project"]["version"]
return None
Loading
Loading