Skip to content

Commit

Permalink
[Auto-generated] Update dependencies (#265)
Browse files Browse the repository at this point in the history
Update `pre-commit` hooks.
Update code according to updated ruff rules.


Co-authored-by: Casper Welzel Andersen <[email protected]>
  • Loading branch information
TEAM4-0 and CasperWA authored Jul 1, 2024
1 parent 18a8473 commit 6ca031c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ repos:
# More information can be found in its documentation:
# https://docs.astral.sh/ruff/
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.10
rev: v0.5.0
hooks:
- id: ruff
# Fix what can be fixed in-place and exit with non-zero status if files were
Expand All @@ -69,7 +69,7 @@ repos:
# The project's documentation can be found at:
# https://mypy.readthedocs.io/en/stable/index.html
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.0
rev: v1.10.1
hooks:
- id: mypy

Expand Down
29 changes: 12 additions & 17 deletions ci_cd/utils/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ def _ignore_semver_rules(
f"'patch' (you gave {semver_rules['version-update']!r})."
)

if (
return bool(
("major" in semver_rules["version-update"] and latest[0] != current[0])
or (
"minor" in semver_rules["version-update"]
Expand All @@ -745,10 +745,7 @@ def _ignore_semver_rules(
and latest[0] == current[0]
and latest[1] == current[1]
)
):
return True

return False
)


def ignore_version(
Expand Down Expand Up @@ -783,12 +780,10 @@ def ignore_version(
return True

# semver rules
if "version-update" in semver_rules and _ignore_semver_rules(
current, latest, semver_rules
):
return True

return False
return bool(
"version-update" in semver_rules
and _ignore_semver_rules(current, latest, semver_rules)
)


def regenerate_requirement(
Expand Down Expand Up @@ -1032,12 +1027,12 @@ def _semi_valid_python_version(version: SemanticVersion) -> bool:
f"Invalid Python major version: {version.major}. Expected 1, 2, or 3."
)

if version.minor not in range(12 + 1) or version.patch not in range(18 + 1):
# Either:
# Not a valid Python minor version (0, 1, 2, ..., 12)
# Not a valid Python patch version (0, 1, 2, ..., 18)
return False
return True
# Either:
# Not a valid Python minor version (0, 1, 2, ..., 12)
# Not a valid Python patch version (0, 1, 2, ..., 18)
return not bool(
version.minor not in range(12 + 1) or version.patch not in range(18 + 1)
)


def get_min_max_py_version(
Expand Down

0 comments on commit 6ca031c

Please sign in to comment.