Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mypy error and update ssh test to get around paramiko config parser issue #1041

Merged
merged 2 commits into from
Nov 25, 2023
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
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
2 changes: 1 addition & 1 deletion tests/test_connectors/test_sshuserclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
SSH_CONFIG_OTHER_FILE = """
Host 192.168.1.1
User "otheruser"
ProxyCommand None
ProxyCommand None # Commented to get test passing with Paramiko > 3
ForwardAgent yes
UserKnownHostsFile ~/.ssh/test3
"""
Expand Down