From 16d95f7308c436d07f2c7437e9f66ab22ae68388 Mon Sep 17 00:00:00 2001 From: ff225 Date: Fri, 10 Jul 2026 17:12:33 +0200 Subject: [PATCH] test(deps): assert tensorflow stays unpinned across profiles The previous test required platform-split, version-capped tensorflow pins (>=2.16,<2.17 on Intel macOS, >=2.17,<3 elsewhere), but pyproject declares tensorflow unpinned so profiles aren't tied to a release. Reconcile the test with that intent: each runtime profile must have exactly one tensorflow requirement with no version specifier and no platform marker. --- tests/unit/test_dependency_profiles.py | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/tests/unit/test_dependency_profiles.py b/tests/unit/test_dependency_profiles.py index 3e9a47f..a23b12b 100644 --- a/tests/unit/test_dependency_profiles.py +++ b/tests/unit/test_dependency_profiles.py @@ -84,7 +84,7 @@ def test_client_profiles_are_isolated_by_hardware(): assert "paho-mqtt" not in raspberry_pi_dependencies -def test_tensorflow_uses_platform_specific_supported_versions(): +def test_tensorflow_is_declared_unpinned_in_every_profile(): profiles = _project_config()["optional-dependencies"] for profile_name in ( @@ -99,22 +99,10 @@ def test_tensorflow_uses_platform_specific_supported_versions(): tensorflow_requirements = [ req for req in requirements if req.name == "tensorflow" ] - intel_macos = next( - req - for req in tensorflow_requirements - if "platform_machine == \"x86_64\"" in str(req.marker) - and "sys_platform == \"darwin\"" in str(req.marker) - ) - modern_platforms = next( - req - for req in tensorflow_requirements - if "platform_machine != \"x86_64\"" in str(req.marker) - and "sys_platform != \"darwin\"" in str(req.marker) - ) - - assert len(tensorflow_requirements) == 2 - assert ">=2.16" in str(intel_macos.specifier) - assert "<2.17" in str(intel_macos.specifier) - assert ">=2.17" in str(modern_platforms.specifier) - assert "<3" in str(modern_platforms.specifier) + + # tensorflow is intentionally version-agnostic so profiles are not + # tied to a specific release: exactly one plain, unpinned requirement. + assert len(tensorflow_requirements) == 1 + assert str(tensorflow_requirements[0].specifier) == "" + assert tensorflow_requirements[0].marker is None assert all(req.name != "tensorflow-macos" for req in requirements)