Skip to content

Commit

Permalink
Fix Astropy and scikit-learn test
Browse files Browse the repository at this point in the history
  • Loading branch information
dorbanianas committed Mar 31, 2024
1 parent cb47eaf commit 8a4d216
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion harness/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
].append("sed -i 's/Jinja2>=2.3/Jinja2<3.1/' setup.py")

MAP_VERSION_TO_INSTALL_ASTROPY = {
k: {"python": "3.9", "install": "pip install -e .[test]"}
k: {"python": "3.9", "install": "python setup.py install"}
for k in
["0.1", "0.2", "0.3", "0.4", "1.1", "1.2", "1.3", "3.0", "3.1", "3.2"] + \
["4.1", "4.2", "4.3", "5.0", "5.1", "5.2"]
Expand Down
11 changes: 10 additions & 1 deletion harness/context_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,12 +321,21 @@ def __enter__(self):
os.remove(path_to_reqs)
else:
# Create environment + install dependencies
cmd = f"{exec_cmd} create -n {env_name} python={install['python']} {pkgs} -y"
cmd = f"{exec_cmd} create -n {env_name} python={install['python']} -y"
logger_testbed.info(
f"[Testbed] Creating environment {env_name}; Command: {cmd}"
)
self.exec(cmd.split(" "))

# Activate the environment and install the packages
activate_cmd = f". {path_activate} {env_name}"
install_cmd = f"pip install {pkgs}"
full_cmd = f"{activate_cmd} && echo 'activate successful' && {install_cmd}"
logger_testbed.info(
f"[Testbed] Installing environment dependencies {pkgs}; Command: {full_cmd}"
)
self.exec(full_cmd, shell=True)

# Install additional packages if specified
if "pip_packages" in install:
cmd = f"source {path_activate} {env_name} && pip install {install['pip_packages']}"
Expand Down

0 comments on commit 8a4d216

Please sign in to comment.