Skip to content
Open
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
26 changes: 7 additions & 19 deletions tests/unit/test_dependency_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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)
Loading