Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 16, 2024
1 parent a3b9b24 commit ef00283
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/tox_ini_fmt/formatter/tox_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ def _handle_min_version(tox: SectionProxy) -> None:
normalize=lambda groups: {k: requires(v) for k, v in groups.items()},
)[0]
]
for _at, entry in enumerate(tox_requires):
for at, entry in enumerate(tox_requires):
if entry.name == "tox":
break
else:
_at = -1
if _at == -1:
at = -1
if at == -1:
tox_requires.append(Requirement(f"tox>={min_version}"))
else:
specifiers = list(tox_requires[_at].specifier)
specifiers = list(tox_requires[at].specifier)
if len(specifiers) == 0 or Version(specifiers[0].version) < Version(min_version):
tox_requires[_at] = Requirement(f"tox>={min_version}")
tox_requires[at] = Requirement(f"tox>={min_version}")
tox["requires"] = "\n".join(str(i) for i in tox_requires)

0 comments on commit ef00283

Please sign in to comment.