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

CI: we decide the pyln-testing version to be installed #635

Merged
merged 1 commit into from
Jan 3, 2025
Merged
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
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
Loading