Skip to content

Commit

Permalink
Preventing re-initialization of Version
Browse files Browse the repository at this point in the history
  • Loading branch information
shantanutrip committed Aug 22, 2024
1 parent d1a3475 commit 8493136
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,15 +556,18 @@ def tf_full_version(tensorflow_training_latest_version, tensorflow_inference_lat
Fixture exists as such, since TF training and TFS have different latest versions.
Otherwise, this would simply be a single latest version.
"""
if Version(tensorflow_training_latest_version) in SpecifierSet(">=2.16"):
tensorflow_training_latest_version = Version(tensorflow_training_latest_version)
tensorflow_inference_latest_version = Version(tensorflow_inference_latest_version)

if tensorflow_training_latest_version in SpecifierSet(">=2.16"):
return (
f"{Version(tensorflow_training_latest_version).major}"
f".{Version(tensorflow_training_latest_version).minor}"
f"{tensorflow_training_latest_version.major}"
f".{tensorflow_training_latest_version.minor}"
)
return str(
min(
Version(tensorflow_training_latest_version),
Version(tensorflow_inference_latest_version),
tensorflow_training_latest_version,
tensorflow_inference_latest_version,
)
)

Expand Down

0 comments on commit 8493136

Please sign in to comment.