Skip to content

Commit 942c62c

Browse files
daywalker90chrisguida
authored andcommitted
CI: we decide the pyln-testing version to be installed
1 parent 4870ad0 commit 942c62c

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

.ci/test.py

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ def prepare_env(p: Plugin, directory: Path, env: dict, workflow: str) -> bool:
2929
if p.framework == "pip":
3030
return prepare_env_pip(p, directory, workflow)
3131
elif p.framework == "poetry":
32-
return prepare_env_poetry(p, directory)
32+
return prepare_env_poetry(p, directory, workflow)
3333
elif p.framework == "generic":
3434
return prepare_generic(p, directory, env, workflow)
3535
else:
3636
raise ValueError(f"Unknown framework {p.framework}")
3737

3838

39-
def prepare_env_poetry(p: Plugin, directory: Path) -> bool:
39+
def prepare_env_poetry(p: Plugin, directory: Path, workflow: str) -> bool:
4040
logging.info("Installing a new poetry virtualenv")
4141

4242
pip3 = directory / "bin" / "pip3"
@@ -91,6 +91,11 @@ def prepare_env_poetry(p: Plugin, directory: Path) -> bool:
9191
stderr=subprocess.STDOUT,
9292
)
9393

94+
if workflow == "nightly":
95+
install_dev_pyln_testing(pip3)
96+
else:
97+
install_pyln_testing(pip3)
98+
9499
subprocess.check_call([pip3, "freeze"])
95100
return True
96101

@@ -99,11 +104,6 @@ def prepare_env_pip(p: Plugin, directory: Path, workflow: str) -> bool:
99104
print("Installing a new pip virtualenv")
100105
pip_path = directory / "bin" / "pip3"
101106

102-
if workflow == "nightly":
103-
install_dev_pyln_testing(pip_path)
104-
else:
105-
install_pyln_testing(pip_path)
106-
107107
# Now install all the requirements
108108
print(f"Installing requirements from {p.details['requirements']}")
109109
subprocess.check_call(
@@ -118,6 +118,11 @@ def prepare_env_pip(p: Plugin, directory: Path, workflow: str) -> bool:
118118
stderr=subprocess.STDOUT,
119119
)
120120

121+
if workflow == "nightly":
122+
install_dev_pyln_testing(pip_path)
123+
else:
124+
install_pyln_testing(pip_path)
125+
121126
subprocess.check_call([pip_path, "freeze"])
122127
return True
123128

@@ -126,11 +131,6 @@ def prepare_generic(p: Plugin, directory: Path, env: dict, workflow: str) -> boo
126131
print("Installing a new generic virtualenv")
127132
pip_path = directory / "bin" / "pip3"
128133

129-
if workflow == "nightly":
130-
install_dev_pyln_testing(pip_path)
131-
else:
132-
install_pyln_testing(pip_path)
133-
134134
# Now install all the requirements
135135
if p.details["requirements"].exists():
136136
print(f"Installing requirements from {p.details['requirements']}")
@@ -147,6 +147,11 @@ def prepare_generic(p: Plugin, directory: Path, env: dict, workflow: str) -> boo
147147
stderr=subprocess.STDOUT,
148148
)
149149

150+
if workflow == "nightly":
151+
install_dev_pyln_testing(pip_path)
152+
else:
153+
install_pyln_testing(pip_path)
154+
150155
subprocess.check_call([pip_path, "freeze"])
151156
return True
152157

0 commit comments

Comments
 (0)