Skip to content
Merged
Show file tree
Hide file tree
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
19 changes: 19 additions & 0 deletions .actions/assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,25 @@ def generate_docker_tags(
tags = [f"{docker_project}:{tag}" for tag in tags]
print(",".join(tags))

@staticmethod
def prune_pytest_as_errors(
pyproject_toml: str = "pyproject.toml", errors: tuple = ("FutureWarning", "DeprecationWarning")
) -> None:
"""Prune pytest warnings as errors from the pyproject.toml file."""
import tomlkit

with open(pyproject_toml, encoding="utf-8") as fopen:
content = fopen.read()
pyproject = tomlkit.parse(content)
filterwarnings = pyproject.get("tool", {}).get("pytest", {}).get("ini_options", {}).get("filterwarnings", [])
if not filterwarnings:
return
filterwarnings = [wrn for wrn in filterwarnings if not any(f"error::{err}" in wrn for err in errors)]
pyproject["tool"]["pytest"]["ini_options"]["filterwarnings"] = filterwarnings

with open(pyproject_toml, "w", encoding="utf-8") as fopen:
fopen.write(tomlkit.dumps(pyproject))


if __name__ == "__main__":
import jsonargparse
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/ci-tests-fabric.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,14 @@ jobs:
- name: Set min. dependencies
if: ${{ matrix.config.requires == 'oldest' }}
run: |
cd requirements/fabric
uv pip install -U "lightning-utilities[cli]"
python -m lightning_utilities.cli requirements set-oldest --req_files "['base.txt', 'strategies.txt', 'test.txt']"
python -m lightning_utilities.cli requirements set-oldest \
--req_files "['requirements/fabric/base.txt', 'requirements/fabric/strategies.txt', 'requirements/fabric/test.txt']"
uv pip install "cython<3.0" wheel
uv pip install "pyyaml==5.4" --no-build-isolation
# This script removes any line containing "error::FutureWarning" from pyproject.toml
uv pip install -r requirements/ci.txt
python .actions/assistant.py prune_pytest_as_errors

- name: Adjust PyTorch versions in requirements files
if: ${{ matrix.config.requires != 'oldest' }}
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/ci-tests-pytorch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,14 @@ jobs:
- name: Set min. dependencies
if: ${{ matrix.config.requires == 'oldest' }}
run: |
cd requirements/pytorch
uv pip install -U "lightning-utilities[cli]"
python -m lightning_utilities.cli requirements set-oldest --req_files "['base.txt', 'extra.txt', 'strategies.txt', 'examples.txt', 'test.txt']"
python -m lightning_utilities.cli requirements set-oldest \
--req_files "['requirements/pytorch/base.txt', 'requirements/pytorch/extra.txt', 'requirements/pytorch/strategies.txt', 'requirements/pytorch/examples.txt', 'requirements/pytorch/test.txt']"
uv pip install "cython<3.0" wheel
uv pip install "pyyaml==5.4" --no-build-isolation
# This script removes any line containing "error::FutureWarning" from pyproject.toml
uv pip install -r requirements/ci.txt
python .actions/assistant.py prune_pytest_as_errors

- name: Adjust PyTorch versions in requirements files
if: ${{ matrix.config.requires != 'oldest' }}
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ filterwarnings = [
# "error::DeprecationWarning",
"error::FutureWarning",
"ignore::FutureWarning:onnxscript", # Temporary ignore until onnxscript is updated
"ignore:The pynvml package is deprecated:FutureWarning", # Ignore pynvml deprecation warning, since it is not installed by PL directly
]
xfail_strict = true
junit_duration_report = "call"
1 change: 1 addition & 0 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ importlib-metadata <9.0.0
wget
pkginfo ==1.12.1.2
packaging <25.1
tomlkit
Loading