Skip to content

Commit e46a70d

Browse files
committed
update
1 parent bf0f738 commit e46a70d

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

.actions/assistant.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -464,19 +464,19 @@ def prune_pytest_as_errors(
464464
pyproject_toml: str = "pyproject.toml", errors: tuple = ("FutureWarning", "DeprecationWarning")
465465
) -> None:
466466
"""Prune pytest warnings as errors from the pyproject.toml file."""
467-
import toml
467+
import tomlkit
468468

469469
with open(pyproject_toml, encoding="utf-8") as fopen:
470-
pyproject = toml.load(fopen)
470+
content = fopen.read()
471+
pyproject = tomlkit.parse(content)
471472
filterwarnings = pyproject.get("tool", {}).get("pytest", {}).get("ini_options", {}).get("filterwarnings", [])
472473
if not filterwarnings:
473474
return
474-
print(filterwarnings)
475-
print([f"error::{err}" for err in errors])
476475
filterwarnings = [wrn for wrn in filterwarnings if not any(f"error::{err}" in wrn for err in errors)]
477476
pyproject["tool"]["pytest"]["ini_options"]["filterwarnings"] = filterwarnings
477+
478478
with open(pyproject_toml, "w", encoding="utf-8") as fopen:
479-
toml.dump(pyproject, fopen)
479+
fopen.write(tomlkit.dumps(pyproject))
480480

481481

482482
if __name__ == "__main__":

.github/workflows/ci-tests-fabric.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ jobs:
106106
uv pip install "pyyaml==5.4" --no-build-isolation
107107
# This script removes any line containing "error::FutureWarning" from pyproject.toml
108108
uv pip install -r requirements/ci.txt
109-
uv pip list # debugging
110109
python .actions/assistant.py prune_pytest_as_errors
111110
112111
- name: Adjust PyTorch versions in requirements files

.github/workflows/ci-tests-pytorch.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ jobs:
105105
uv pip install "pyyaml==5.4" --no-build-isolation
106106
# This script removes any line containing "error::FutureWarning" from pyproject.toml
107107
uv pip install -r requirements/ci.txt
108-
uv pip list # debugging
109108
python .actions/assistant.py prune_pytest_as_errors
110109
111110
- name: Adjust PyTorch versions in requirements files

0 commit comments

Comments
 (0)