Skip to content

Commit

Permalink
CI: we decide the pyln-testing version to be installed
Browse files Browse the repository at this point in the history
  • Loading branch information
daywalker90 committed Dec 21, 2024
1 parent 65dcbbb commit 6d1a221
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions .ci/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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

Expand All @@ -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(
Expand All @@ -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

Expand All @@ -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']}")
Expand All @@ -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

Expand Down

0 comments on commit 6d1a221

Please sign in to comment.