Skip to content

Commit

Permalink
Fix mypy error
Browse files Browse the repository at this point in the history
Fix error:
pyinfra/api/config.py:57: error: Unsupported operand types for in ("Version" and "Requirement")
Found 1 error in 1 file (checked 122 source files)
  • Loading branch information
maisim committed Nov 22, 2023
1 parent a280e17 commit 7ca7373
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions pyinfra/api/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,12 @@ class ConfigDefaults:
def check_pyinfra_version(version: str):
if not version:
return

running_version = parse_version(__version__)
required_versions = Requirement.parse(
"pyinfra{0}".format(version),
)
required_versions = Requirement.parse("pyinfra{0}".format(version))

if running_version not in required_versions:
if not required_versions.specifier.contains(running_version):
raise PyinfraError(
("pyinfra version requirement not met " "(requires {0}, running {1})").format(
version,
__version__,
),
f"pyinfra version requirement not met (requires {version}, running {__version__})"
)


Expand Down

0 comments on commit 7ca7373

Please sign in to comment.