Skip to content
Open
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
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ repos:
- id: detect-private-key

- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
rev: v2.4.2
hooks:
- id: codespell
additional_dependencies: [tomli]
#args: ["--write-changes"] # uncomment if you want to get automatic fixing

- repo: https://github.com/PyCQA/docformatter
rev: v1.7.7
rev: v1.7.8
hooks:
- id: docformatter
# TODO: remove language_version pin after new docformatter release with python 3.14 support
Expand All @@ -49,15 +49,15 @@ repos:
exclude: CHANGELOG.md

- repo: https://github.com/JoC0de/pre-commit-prettier
rev: v3.8.1
rev: v3.8.3
hooks:
- id: prettier
files: \.(json|yml|yaml|toml)
# https://prettier.io/docs/en/options.html#print-width
args: ["--print-width=120"]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.4
rev: v0.15.12
hooks:
- id: ruff
args: ["--fix"]
Expand All @@ -70,7 +70,7 @@ repos:
- id: sphinx-lint

- repo: https://github.com/tox-dev/pyproject-fmt
rev: v2.16.2
rev: v2.21.1
hooks:
- id: pyproject-fmt
additional_dependencies: [tox]
Expand Down
24 changes: 11 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ quiet-level = 3
# also adding links until they ignored by its: nature
# https://github.com/codespell-project/codespell/issues/2243#issuecomment-1732019960
# ignore-words-list = ""

[tool.docformatter]
recursive = true
# this need to be shorter as some docstings are r"""...
Expand All @@ -114,6 +113,17 @@ ignore = [
".github/*",
]

# [tool.coverage.run]
# parallel = true
# concurrency = ['thread']
# relative_files = true
[tool.mypy]
files = [
"src/lightning_utilities",
]
disallow_untyped_defs = true
ignore_missing_imports = true

[tool.pytest]
ini_options.norecursedirs = [
".git",
Expand Down Expand Up @@ -142,15 +152,3 @@ report.exclude_lines = [
"pass",
"pragma: no cover",
]

# [tool.coverage.run]
# parallel = true
# concurrency = ['thread']
# relative_files = true

[tool.mypy]
files = [
"src/lightning_utilities",
]
disallow_untyped_defs = true
ignore_missing_imports = true
4 changes: 2 additions & 2 deletions src/lightning_utilities/core/rank_zero.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ def rank_zero_only(fn: Callable[P, T], default: T) -> Callable[P, T]: ...
def rank_zero_only(fn: Callable[P, T], default: Optional[T] = None) -> Callable[P, Optional[T]]:
"""Decorator to run the wrapped function only on global rank 0.

Set ``rank_zero_only.rank`` before use. On non-zero ranks, the function is skipped and the provided
``default`` is returned (or ``None`` if not given).
Set ``rank_zero_only.rank`` before use. On non-zero ranks, the function is skipped and the provided ``default`` is
returned (or ``None`` if not given).

"""

Expand Down
5 changes: 2 additions & 3 deletions src/lightning_utilities/docs/retriever.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
def _download_file(file_url: str, folder: str) -> str:
"""Download a file from a URL into the given folder.

If a file with the same name already exists, it will be overwritten.
Returns the basename of the downloaded file. Network-related exceptions from
``requests.get`` (e.g., timeouts or connection errors) may propagate to the caller.
If a file with the same name already exists, it will be overwritten. Returns the basename of the downloaded file.
Network-related exceptions from ``requests.get`` (e.g., timeouts or connection errors) may propagate to the caller.

"""
fname = os.path.basename(file_url)
Expand Down
4 changes: 2 additions & 2 deletions src/lightning_utilities/install/requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#
"""Utilities to parse and adjust Python requirements files.

This module parses requirement lines while preserving inline comments and pip arguments and
supports relaxing version pins based on a chosen unfreeze strategy: "none", "major", or "all".
This module parses requirement lines while preserving inline comments and pip arguments and supports relaxing version
pins based on a chosen unfreeze strategy: "none", "major", or "all".

"""

Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/cli/test_command_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

def test_version():
"""Prints the help message for the requirements commands."""
return_code = subprocess.call([sys.executable, "-m", "lightning_utilities.cli", "version"]) # noqa: S603
return_code = subprocess.call([sys.executable, "-m", "lightning_utilities.cli", "version"])
assert return_code == 0


Expand Down
Loading