From 22ab7cc1b74d41dfc1e62336cd56482eb03477ae Mon Sep 17 00:00:00 2001 From: gabriel Date: Sun, 5 Jul 2026 16:35:15 +0200 Subject: [PATCH] chore: move test/dev dependencies from extras to dependency groups Extras are not installed by a plain `uv run`, so `uv run pytest` fell back to any pytest on PATH, testing against whatever silabs_ble_ota that interpreter could import instead of the current tree. As dependency groups (dev includes test), they are synced by default. lint.yml switches from `uv sync --extra dev` to plain `uv sync`, which installs the dev group by default. --- .github/workflows/lint.yml | 2 +- pyproject.toml | 23 ++++++++++++----------- uv.lock | 25 ++++++++++++++++++------- 3 files changed, 31 insertions(+), 19 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 3ab66c6..2e2fd21 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,7 +19,7 @@ jobs: run: uv python install 3.11 - name: Install dependencies - run: uv sync --extra dev + run: uv sync - name: Run ruff run: uv run ruff check . diff --git a/pyproject.toml b/pyproject.toml index e100371..7a51c87 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,17 +34,6 @@ dependencies = [ "bleak-retry-connector>=3.5.0", ] -[project.optional-dependencies] -test = [ - "pytest>=9.0.2", - "pytest-cov>=7.0.0", - "pytest-asyncio>=0.23.0", -] -dev = [ - "mypy>=1.19.1", - "ruff>=0.14.10", -] - [project.urls] Homepage = "https://opendisplay.org" Repository = "https://github.com/OpenDisplay/silabs-ble-ota" @@ -69,3 +58,15 @@ warn_unused_configs = true [tool.pytest.ini_options] testpaths = ["tests"] asyncio_mode = "auto" + +[dependency-groups] +dev = [ + "mypy>=1.19.1", + "ruff>=0.14.10", + { include-group = "test" }, +] +test = [ + "pytest>=9.0.2", + "pytest-cov>=7.0.0", + "pytest-asyncio>=0.23.0", +] diff --git a/uv.lock b/uv.lock index 204cc73..90257d1 100644 --- a/uv.lock +++ b/uv.lock @@ -592,9 +592,12 @@ dependencies = [ { name = "bleak-retry-connector" }, ] -[package.optional-dependencies] +[package.dev-dependencies] dev = [ { name = "mypy" }, + { name = "pytest" }, + { name = "pytest-asyncio" }, + { name = "pytest-cov" }, { name = "ruff" }, ] test = [ @@ -607,13 +610,21 @@ test = [ requires-dist = [ { name = "bleak", specifier = ">=1.0.1" }, { name = "bleak-retry-connector", specifier = ">=3.5.0" }, - { name = "mypy", marker = "extra == 'dev'", specifier = ">=1.19.1" }, - { name = "pytest", marker = "extra == 'test'", specifier = ">=9.0.2" }, - { name = "pytest-asyncio", marker = "extra == 'test'", specifier = ">=0.23.0" }, - { name = "pytest-cov", marker = "extra == 'test'", specifier = ">=7.0.0" }, - { name = "ruff", marker = "extra == 'dev'", specifier = ">=0.14.10" }, ] -provides-extras = ["test", "dev"] + +[package.metadata.requires-dev] +dev = [ + { name = "mypy", specifier = ">=1.19.1" }, + { name = "pytest", specifier = ">=9.0.2" }, + { name = "pytest-asyncio", specifier = ">=0.23.0" }, + { name = "pytest-cov", specifier = ">=7.0.0" }, + { name = "ruff", specifier = ">=0.14.10" }, +] +test = [ + { name = "pytest", specifier = ">=9.0.2" }, + { name = "pytest-asyncio", specifier = ">=0.23.0" }, + { name = "pytest-cov", specifier = ">=7.0.0" }, +] [[package]] name = "tomli"