From 942c62c749aa2f456218767863ec3838a6fe160e Mon Sep 17 00:00:00 2001 From: daywalker90 <8257956+daywalker90@users.noreply.github.com> Date: Sat, 21 Dec 2024 13:42:49 +0100 Subject: [PATCH] CI: we decide the pyln-testing version to be installed --- .ci/test.py | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/.ci/test.py b/.ci/test.py index 06a3c63cf..e3df90600 100644 --- a/.ci/test.py +++ b/.ci/test.py @@ -29,14 +29,14 @@ def prepare_env(p: Plugin, directory: Path, env: dict, workflow: str) -> bool: if p.framework == "pip": return prepare_env_pip(p, directory, workflow) elif p.framework == "poetry": - return prepare_env_poetry(p, directory) + return prepare_env_poetry(p, directory, workflow) elif p.framework == "generic": return prepare_generic(p, directory, env, workflow) else: raise ValueError(f"Unknown framework {p.framework}") -def prepare_env_poetry(p: Plugin, directory: Path) -> bool: +def prepare_env_poetry(p: Plugin, directory: Path, workflow: str) -> bool: logging.info("Installing a new poetry virtualenv") pip3 = directory / "bin" / "pip3" @@ -91,6 +91,11 @@ def prepare_env_poetry(p: Plugin, directory: Path) -> bool: stderr=subprocess.STDOUT, ) + if workflow == "nightly": + install_dev_pyln_testing(pip3) + else: + install_pyln_testing(pip3) + subprocess.check_call([pip3, "freeze"]) return True @@ -99,11 +104,6 @@ def prepare_env_pip(p: Plugin, directory: Path, workflow: str) -> bool: print("Installing a new pip virtualenv") pip_path = directory / "bin" / "pip3" - if workflow == "nightly": - install_dev_pyln_testing(pip_path) - else: - install_pyln_testing(pip_path) - # Now install all the requirements print(f"Installing requirements from {p.details['requirements']}") subprocess.check_call( @@ -118,6 +118,11 @@ def prepare_env_pip(p: Plugin, directory: Path, workflow: str) -> bool: stderr=subprocess.STDOUT, ) + if workflow == "nightly": + install_dev_pyln_testing(pip_path) + else: + install_pyln_testing(pip_path) + subprocess.check_call([pip_path, "freeze"]) return True @@ -126,11 +131,6 @@ def prepare_generic(p: Plugin, directory: Path, env: dict, workflow: str) -> boo print("Installing a new generic virtualenv") pip_path = directory / "bin" / "pip3" - if workflow == "nightly": - install_dev_pyln_testing(pip_path) - else: - install_pyln_testing(pip_path) - # Now install all the requirements if p.details["requirements"].exists(): print(f"Installing requirements from {p.details['requirements']}") @@ -147,6 +147,11 @@ def prepare_generic(p: Plugin, directory: Path, env: dict, workflow: str) -> boo stderr=subprocess.STDOUT, ) + if workflow == "nightly": + install_dev_pyln_testing(pip_path) + else: + install_pyln_testing(pip_path) + subprocess.check_call([pip_path, "freeze"]) return True