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

Fix Astropy and scikit-learn test #3

Open
wants to merge 5 commits into
base: main-old
Choose a base branch
from
Open
Show file tree
Hide file tree
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
31 changes: 22 additions & 9 deletions harness/constants.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
MAP_VERSION_TO_INSTALL_SKLEARN = {
k: {
"python": "3.6",
"packages": "numpy scipy cython pytest pandas matplotlib",
"packages": "numpy scipy Cython==0.27 pytest pandas matplotlib",
"install": "pip install -v --no-use-pep517 --no-build-isolation -e .",
}
for k in ["0.20", "0.21", "0.22"]
for k in ["0.20"]
}
MAP_VERSION_TO_INSTALL_SKLEARN.update(
{
k: {
"python": "3.7",
"packages": "numpy scipy cython pytest pandas matplotlib",
"packages": "numpy scipy Cython==0.29 pytest pandas matplotlib",
JustinLin610 marked this conversation as resolved.
Show resolved Hide resolved
"install": "pip install -v --no-use-pep517 --no-build-isolation -e .",
}
for k in ["0.23", "0.24"]
for k in ["0.21", "0.22", "0.23", "0.24"]
}
)
MAP_VERSION_TO_INSTALL_SKLEARN.update(
{
k: {
"python": "3.9",
"packages": "numpy scipy cython pytest pandas matplotlib joblib threadpoolctl",
"packages": "numpy scipy Cython==0.29 pytest pandas matplotlib joblib threadpoolctl",
dorbanianas marked this conversation as resolved.
Show resolved Hide resolved
"install": "pip install -v --no-use-pep517 --no-build-isolation -e .",
}
for k in ["1.0", "1.1", "1.2", "1.3", "1.4"]
Expand Down Expand Up @@ -215,12 +215,25 @@
].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]"}
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"]
k: {
"python": "3.9",
"install": "python setup.py install",
"pip_packages": "pytest extension-helpers numpy",
}
for k in ["0.1", "0.2", "0.3", "0.4", "1.1", "1.2", "1.3", "3.0", "3.1", "3.2"]
}

MAP_VERSION_TO_INSTALL_ASTROPY.update(
{
k: {
"python": "3.9",
"install": "pip install -e .[test]",
"pip_packages": "pytest extension-helpers numpy",
}
for k in ["4.1", "4.2", "4.3", "5.0", "5.1", "5.2"]
}
)

MAP_VERSION_TO_INSTALL_SYMPY = {
k: {
"python": "3.9",
Expand Down
13 changes: 12 additions & 1 deletion harness/context_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,12 +321,23 @@ 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}"
full_cmd = f"{activate_cmd} && echo 'activate successful'"
if pkgs != "":
install_cmd = f"pip install {pkgs}"
full_cmd += f" && {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