From 010d63e6553d258f115a3d53a5e9fdbf251b58f9 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Sun, 19 Apr 2026 09:57:00 +0100 Subject: [PATCH 1/3] Use pytest-beartype-tests plugin for test beartype Replace manual pytest_collection_modifyitems hooks with the https://github.com/adamtheturtle/pytest-beartype-tests dev dependency. --- conftest.py | 9 --------- pyproject.toml | 5 ++++- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/conftest.py b/conftest.py index d9e95510..8e5442cf 100644 --- a/conftest.py +++ b/conftest.py @@ -7,7 +7,6 @@ from pathlib import Path import pytest -from beartype import beartype from mock_vws import MockVWS from mock_vws.database import CloudDatabase from sybil import Sybil @@ -18,14 +17,6 @@ ) -@beartype -def pytest_collection_modifyitems(items: list[pytest.Item]) -> None: - """Apply the beartype decorator to all collected test functions.""" - for item in items: - if isinstance(item, pytest.Function): - item.obj = beartype(obj=item.obj) - - @pytest.fixture(name="make_image_file") def fixture_make_image_file( *, diff --git a/pyproject.toml b/pyproject.toml index 6d5ce09a..26fc3d82 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -88,6 +88,7 @@ optional-dependencies.dev = [ "vws-test-fixtures==2023.3.5", "yamlfix==1.19.1", "zizmor==1.24.1", + "pytest-beartype-tests==2026.4.19.1", ] optional-dependencies.release = [ "check-wheel-contents==0.6.3" ] urls.Documentation = "https://vws-python.github.io/vws-python/" @@ -364,7 +365,6 @@ ignore_names = [ "HTTPXTransport", # pytest configuration "pytest_collect_file", - "pytest_collection_modifyitems", "pytest_plugins", # pytest fixtures - we name fixtures like this for this purpose "fixture_*", @@ -402,3 +402,6 @@ exclude = [ ".venv" ] [tool.yamlfix] section_whitelines = 1 whitelines = 1 + +[dependency-groups] +dev = [] From e86ba237f4a5e5ac8bb1a8a08b0ac042513107c6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci-lite[bot]" <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Date: Sun, 19 Apr 2026 08:58:11 +0000 Subject: [PATCH 2/3] [pre-commit.ci lite] apply automatic fixes --- pyproject.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 26fc3d82..c9aadf7e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,6 +61,7 @@ optional-dependencies.dev = [ "pyroma==5.0.1", "pytest==9.0.3", "pytest-asyncio==1.3.0", + "pytest-beartype-tests==2026.4.19.1", "pytest-cov==7.1.0", "pyyaml==6.0.3", "ruff==0.15.11", @@ -88,12 +89,14 @@ optional-dependencies.dev = [ "vws-test-fixtures==2023.3.5", "yamlfix==1.19.1", "zizmor==1.24.1", - "pytest-beartype-tests==2026.4.19.1", ] optional-dependencies.release = [ "check-wheel-contents==0.6.3" ] urls.Documentation = "https://vws-python.github.io/vws-python/" urls.Source = "https://github.com/VWS-Python/vws-python" +[dependency-groups] +dev = [] + [tool.setuptools] zip-safe = false package-data.vws = [ @@ -402,6 +405,3 @@ exclude = [ ".venv" ] [tool.yamlfix] section_whitelines = 1 whitelines = 1 - -[dependency-groups] -dev = [] From 95b5a4695bc73defb4aa66bdc4e184b538d35e1f Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Sun, 19 Apr 2026 10:12:02 +0100 Subject: [PATCH 3/3] Pin pytest-beartype-tests to git revision (Sybil-safe) Use git+https dependency until the next PyPI release includes https://github.com/adamtheturtle/pytest-beartype-tests/commit/bc81d99. --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c9aadf7e..933b59d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,7 +61,7 @@ optional-dependencies.dev = [ "pyroma==5.0.1", "pytest==9.0.3", "pytest-asyncio==1.3.0", - "pytest-beartype-tests==2026.4.19.1", + "pytest-beartype-tests", "pytest-cov==7.1.0", "pyyaml==6.0.3", "ruff==0.15.11", @@ -118,6 +118,7 @@ bdist_wheel.universal = true version_scheme = "post-release" [tool.uv] +sources.pytest-beartype-tests = { git = "https://github.com/adamtheturtle/pytest-beartype-tests.git", rev = "bc81d99" } sources.torch = { index = "pytorch-cpu" } sources.torchvision = { index = "pytorch-cpu" } index = [ { name = "pytorch-cpu", url = "https://download.pytorch.org/whl/cpu", explicit = true } ]