chore: require pyinfra v3

This commit is contained in:
missytake
2024-07-25 16:22:33 +02:00
committed by holger krekel
parent 023253ad9c
commit 8e847093da
2 changed files with 4 additions and 3 deletions

View File

@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
name = "cmdeploy"
version = "0.2"
dependencies = [
"pyinfra",
"pyinfra>=3",
"pillow",
"qrcode",
"markdown",

View File

@@ -68,8 +68,9 @@ def run_cmd(args, out):
deploy_path = importlib.resources.files(__package__).joinpath("deploy.py").resolve()
pyinf = "pyinfra --dry" if args.dry_run else "pyinfra"
cmd = f"{pyinf} --ssh-user root {args.config.mail_domain} {deploy_path}"
if version.parse(pyinfra.__version__) >= version.parse("3"):
cmd += " -y"
if version.parse(pyinfra.__version__) < version.parse("3"):
out.red("Please re-run scripts/initenv.sh to update pyinfra to version 3.")
return 1
retcode = out.check_call(cmd, env=env)
if retcode == 0: