From a74bc327f85dda8a2df4ea024369d5796c3911be Mon Sep 17 00:00:00 2001 From: jirka Date: Mon, 20 Oct 2025 10:52:53 +0200 Subject: [PATCH 1/4] fix python version in req. for split dependencies --- requirements/fabric/test.txt | 2 +- requirements/pytorch/test.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements/fabric/test.txt b/requirements/fabric/test.txt index 47beedd9d1b93..db21ccf0b244e 100644 --- a/requirements/fabric/test.txt +++ b/requirements/fabric/test.txt @@ -4,7 +4,7 @@ pytest ==8.4.2 pytest-cov ==6.3.0 pytest-timeout ==2.4.0 pytest-rerunfailures ==16.0.1; python_version < "3.10" -pytest-rerunfailures ==16.1; python_version >= "3.10" +pytest-rerunfailures ==16.1; python_version > "3.9" pytest-random-order ==1.2.0 click ==8.1.8; python_version < "3.11" click ==8.3.0; python_version > "3.10" diff --git a/requirements/pytorch/test.txt b/requirements/pytorch/test.txt index f01b4eea34ab7..b623a48f319f2 100644 --- a/requirements/pytorch/test.txt +++ b/requirements/pytorch/test.txt @@ -3,7 +3,7 @@ pytest ==8.4.2 pytest-cov ==6.3.0 pytest-timeout ==2.4.0 pytest-rerunfailures ==16.0.1; python_version < "3.10" -pytest-rerunfailures ==16.1; python_version >= "3.10" +pytest-rerunfailures ==16.1; python_version > "3.9" pytest-random-order ==1.2.0 # needed in tests @@ -20,4 +20,4 @@ uvicorn # for `ServableModuleValidator` # not setting version as re-defined in tensorboard >=2.11, <2.21.0 # for `TensorBoardLogger` -torch-tensorrt; platform_system == "Linux" and python_version >= "3.12" +torch-tensorrt; platform_system == "Linux" and python_version > "3.11" From 7f321129e760697fca19a775b327949861afe1dd Mon Sep 17 00:00:00 2001 From: jirka Date: Mon, 20 Oct 2025 12:21:06 +0200 Subject: [PATCH 2/4] Revert "fix python version in req. for split dependencies" This reverts commit a74bc327f85dda8a2df4ea024369d5796c3911be. --- requirements/fabric/test.txt | 2 +- requirements/pytorch/test.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements/fabric/test.txt b/requirements/fabric/test.txt index db21ccf0b244e..47beedd9d1b93 100644 --- a/requirements/fabric/test.txt +++ b/requirements/fabric/test.txt @@ -4,7 +4,7 @@ pytest ==8.4.2 pytest-cov ==6.3.0 pytest-timeout ==2.4.0 pytest-rerunfailures ==16.0.1; python_version < "3.10" -pytest-rerunfailures ==16.1; python_version > "3.9" +pytest-rerunfailures ==16.1; python_version >= "3.10" pytest-random-order ==1.2.0 click ==8.1.8; python_version < "3.11" click ==8.3.0; python_version > "3.10" diff --git a/requirements/pytorch/test.txt b/requirements/pytorch/test.txt index b623a48f319f2..f01b4eea34ab7 100644 --- a/requirements/pytorch/test.txt +++ b/requirements/pytorch/test.txt @@ -3,7 +3,7 @@ pytest ==8.4.2 pytest-cov ==6.3.0 pytest-timeout ==2.4.0 pytest-rerunfailures ==16.0.1; python_version < "3.10" -pytest-rerunfailures ==16.1; python_version > "3.9" +pytest-rerunfailures ==16.1; python_version >= "3.10" pytest-random-order ==1.2.0 # needed in tests @@ -20,4 +20,4 @@ uvicorn # for `ServableModuleValidator` # not setting version as re-defined in tensorboard >=2.11, <2.21.0 # for `TensorBoardLogger` -torch-tensorrt; platform_system == "Linux" and python_version > "3.11" +torch-tensorrt; platform_system == "Linux" and python_version >= "3.12" From ffeb2ea523e1dac3e7a33002bd4b8c6c02582873 Mon Sep 17 00:00:00 2001 From: jirka Date: Mon, 20 Oct 2025 12:51:02 +0200 Subject: [PATCH 3/4] tests --- .actions/assistant.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.actions/assistant.py b/.actions/assistant.py index 6d1e50e26f587..085b0569b1784 100644 --- a/.actions/assistant.py +++ b/.actions/assistant.py @@ -46,14 +46,14 @@ class _RequirementWithComment(Requirement): - strict_string = "# strict" + strict_cmd = "strict" def __init__(self, *args: Any, comment: str = "", pip_argument: Optional[str] = None, **kwargs: Any) -> None: super().__init__(*args, **kwargs) self.comment = comment assert pip_argument is None or pip_argument # sanity check that it's not an empty str self.pip_argument = pip_argument - self.strict = self.strict_string in comment.lower() + self.strict = self.strict_cmd in comment.lower() def adjust(self, unfreeze: str) -> str: """Remove version restrictions unless they are strict. @@ -62,25 +62,26 @@ def adjust(self, unfreeze: str) -> str: 'arrow<=1.2.2,>=1.2.0' >>> _RequirementWithComment("arrow<=1.2.2,>=1.2.0", comment="# strict").adjust("none") 'arrow<=1.2.2,>=1.2.0 # strict' - >>> _RequirementWithComment("arrow<=1.2.2,>=1.2.0", comment="# my name").adjust("all") - 'arrow>=1.2.0' + >>> _RequirementWithComment('arrow<=1.2.2,>=1.2.0; python_version >= "3.10"', comment="# my name").adjust("all") + 'arrow>=1.2.0; python_version >= "3.10"' >>> _RequirementWithComment("arrow>=1.2.0, <=1.2.2", comment="# strict").adjust("all") 'arrow<=1.2.2,>=1.2.0 # strict' - >>> _RequirementWithComment("arrow").adjust("all") - 'arrow' + >>> _RequirementWithComment('arrow; python_version >= "3.10"').adjust("all") + 'arrow; python_version >= "3.10"' >>> _RequirementWithComment("arrow>=1.2.0, <=1.2.2", comment="# cool").adjust("major") 'arrow<2.0,>=1.2.0' >>> _RequirementWithComment("arrow>=1.2.0, <=1.2.2", comment="# strict").adjust("major") 'arrow<=1.2.2,>=1.2.0 # strict' - >>> _RequirementWithComment("arrow>=1.2.0").adjust("major") - 'arrow>=1.2.0' + >>> _RequirementWithComment('arrow>=1.2.0; python_version >= "3.10"').adjust("major") + 'arrow>=1.2.0; python_version >= "3.10"' >>> _RequirementWithComment("arrow").adjust("major") 'arrow' """ out = str(self) if self.strict: - return f"{out} {self.strict_string}" + return f"{out} # {self.strict_cmd}" + specs = [(spec.operator, spec.version) for spec in self.specifier] if unfreeze == "major": for operator, version in specs: From e6b42a68b5b042f933f9f613ab326fc70227d21f Mon Sep 17 00:00:00 2001 From: jirka Date: Mon, 20 Oct 2025 12:53:38 +0200 Subject: [PATCH 4/4] space --- .actions/assistant.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.actions/assistant.py b/.actions/assistant.py index 085b0569b1784..a278b1dfcd3b3 100644 --- a/.actions/assistant.py +++ b/.actions/assistant.py @@ -80,7 +80,7 @@ def adjust(self, unfreeze: str) -> str: """ out = str(self) if self.strict: - return f"{out} # {self.strict_cmd}" + return f"{out} # {self.strict_cmd}" specs = [(spec.operator, spec.version) for spec in self.specifier] if unfreeze == "major":