Skip to content

Commit 82b7cbc

Browse files
Merge branch 'master' into fix/20972-mlflow-logger-windows-uri-from-master
2 parents de52cd6 + 79ffe50 commit 82b7cbc

File tree

234 files changed

+4979
-2894
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

234 files changed

+4979
-2894
lines changed

.actions/assistant.py

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@
4646

4747

4848
class _RequirementWithComment(Requirement):
49-
strict_string = "# strict"
49+
strict_cmd = "strict"
5050

5151
def __init__(self, *args: Any, comment: str = "", pip_argument: Optional[str] = None, **kwargs: Any) -> None:
5252
super().__init__(*args, **kwargs)
5353
self.comment = comment
5454
assert pip_argument is None or pip_argument # sanity check that it's not an empty str
5555
self.pip_argument = pip_argument
56-
self.strict = self.strict_string in comment.lower()
56+
self.strict = self.strict_cmd in comment.lower()
5757

5858
def adjust(self, unfreeze: str) -> str:
5959
"""Remove version restrictions unless they are strict.
@@ -62,25 +62,26 @@ def adjust(self, unfreeze: str) -> str:
6262
'arrow<=1.2.2,>=1.2.0'
6363
>>> _RequirementWithComment("arrow<=1.2.2,>=1.2.0", comment="# strict").adjust("none")
6464
'arrow<=1.2.2,>=1.2.0 # strict'
65-
>>> _RequirementWithComment("arrow<=1.2.2,>=1.2.0", comment="# my name").adjust("all")
66-
'arrow>=1.2.0'
65+
>>> _RequirementWithComment('arrow<=1.2.2,>=1.2.0; python_version >= "3.10"', comment="# my name").adjust("all")
66+
'arrow>=1.2.0; python_version >= "3.10"'
6767
>>> _RequirementWithComment("arrow>=1.2.0, <=1.2.2", comment="# strict").adjust("all")
6868
'arrow<=1.2.2,>=1.2.0 # strict'
69-
>>> _RequirementWithComment("arrow").adjust("all")
70-
'arrow'
69+
>>> _RequirementWithComment('arrow; python_version >= "3.10"').adjust("all")
70+
'arrow; python_version >= "3.10"'
7171
>>> _RequirementWithComment("arrow>=1.2.0, <=1.2.2", comment="# cool").adjust("major")
7272
'arrow<2.0,>=1.2.0'
7373
>>> _RequirementWithComment("arrow>=1.2.0, <=1.2.2", comment="# strict").adjust("major")
7474
'arrow<=1.2.2,>=1.2.0 # strict'
75-
>>> _RequirementWithComment("arrow>=1.2.0").adjust("major")
76-
'arrow>=1.2.0'
75+
>>> _RequirementWithComment('arrow>=1.2.0; python_version >= "3.10"').adjust("major")
76+
'arrow>=1.2.0; python_version >= "3.10"'
7777
>>> _RequirementWithComment("arrow").adjust("major")
7878
'arrow'
7979
8080
"""
8181
out = str(self)
8282
if self.strict:
83-
return f"{out} {self.strict_string}"
83+
return f"{out} # {self.strict_cmd}"
84+
8485
specs = [(spec.operator, spec.version) for spec in self.specifier]
8586
if unfreeze == "major":
8687
for operator, version in specs:
@@ -459,6 +460,25 @@ def generate_docker_tags(
459460
tags = [f"{docker_project}:{tag}" for tag in tags]
460461
print(",".join(tags))
461462

463+
@staticmethod
464+
def prune_pytest_as_errors(
465+
pyproject_toml: str = "pyproject.toml", errors: tuple = ("FutureWarning", "DeprecationWarning")
466+
) -> None:
467+
"""Prune pytest warnings as errors from the pyproject.toml file."""
468+
import tomlkit
469+
470+
with open(pyproject_toml, encoding="utf-8") as fopen:
471+
content = fopen.read()
472+
pyproject = tomlkit.parse(content)
473+
filterwarnings = pyproject.get("tool", {}).get("pytest", {}).get("ini_options", {}).get("filterwarnings", [])
474+
if not filterwarnings:
475+
return
476+
filterwarnings = [wrn for wrn in filterwarnings if not any(f"error::{err}" in wrn for err in errors)]
477+
pyproject["tool"]["pytest"]["ini_options"]["filterwarnings"] = filterwarnings
478+
479+
with open(pyproject_toml, "w", encoding="utf-8") as fopen:
480+
fopen.write(tomlkit.dumps(pyproject))
481+
462482

463483
if __name__ == "__main__":
464484
import jsonargparse

.azure/README.md

Lines changed: 0 additions & 70 deletions
This file was deleted.

.azure/gpu-benchmarks.yml

Lines changed: 0 additions & 111 deletions
This file was deleted.

0 commit comments

Comments
 (0)