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 CI tests #2921

Merged
merged 4 commits into from
Jul 16, 2024
Merged
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
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ commands:
if [[ -f ~/miniconda3/LICENSE.txt ]] ; then
echo "miniconda installed already."
else
curl -o Miniconda3-py38_4.8.3-MacOSX-x86_64.sh https://repo.anaconda.com/miniconda/Miniconda3-py38_4.8.3-MacOSX-x86_64.sh
bash ./Miniconda3-py38_4.8.3-MacOSX-x86_64.sh -b
curl -o Miniconda3-py39_24.5.0-0-MacOSX-arm64.sh https://repo.anaconda.com/miniconda/Miniconda3-py39_24.5.0-0-MacOSX-arm64.sh
bash ./Miniconda3-py39_24.5.0-0-MacOSX-arm64.sh -b
fi
~/miniconda3/bin/conda init bash
- run:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

def _run_command(command: str) -> str:
print(f"{str(datetime.now())} - Running: {command}")
output = subprocess.getoutput(command)
output = subprocess.getoutput(command) # nosec B605
print(f"{str(datetime.now())} - {output}")
return output

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

def _run_command(command: str) -> str:
print(f"{str( datetime.now() )} - OUT: {command}")
output = subprocess.getoutput(command)
output = subprocess.getoutput(command) # nosec B605
print(f"{str( datetime.now() )} - OUT: {output}")
return output

Expand Down
16 changes: 11 additions & 5 deletions plugins/hydra_ray_launcher/tests/test_ray_aws_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@

import boto3 # type: ignore
import pkg_resources
from botocore.exceptions import NoCredentialsError, NoRegionError # type: ignore
from botocore.exceptions import ( # type: ignore
ClientError,
NoCredentialsError,
NoRegionError,
)
from hydra.core.plugins import Plugins
from hydra.plugins.launcher import Launcher
from hydra.test_utils.launcher_common_tests import (
Expand Down Expand Up @@ -49,7 +53,7 @@
ec2 = boto3.client("ec2")
ec2.describe_regions()
aws_not_configured = False
except (NoCredentialsError, NoRegionError):
except (ClientError, NoCredentialsError, NoRegionError):
aws_not_configured = True


Expand Down Expand Up @@ -129,7 +133,7 @@

def run_command(commands: str) -> str:
log.info(f"running: {commands}")
output = subprocess.getoutput(commands)
output = subprocess.getoutput(commands) # nosec B605
log.info(f"outputs: {output}")
return output

Expand All @@ -139,7 +143,8 @@ def build_ray_launcher_wheel(tmp_wheel_dir: str) -> str:
plugin = "hydra_ray_launcher"
os.chdir(Path("plugins") / plugin)
log.info(f"Build wheel for {plugin}, save wheel to {tmp_wheel_dir}.")
run_command(f"python setup.py sdist bdist_wheel && cp dist/*.whl {tmp_wheel_dir}")
run_command("python setup.py sdist bdist_wheel")
run_command(f"cp dist/*.whl {tmp_wheel_dir}")
log.info("Download all plugin dependency wheels.")
run_command(f"pip download . -d {tmp_wheel_dir}")
plugin_wheel = run_command("ls dist/*.whl").split("/")[-1]
Expand All @@ -149,7 +154,8 @@ def build_ray_launcher_wheel(tmp_wheel_dir: str) -> str:

def build_core_wheel(tmp_wheel_dir: str) -> str:
chdir_hydra_root()
run_command(f"python setup.py sdist bdist_wheel && cp dist/*.whl {tmp_wheel_dir}")
run_command("python setup.py sdist bdist_wheel")
run_command(f"cp dist/*.whl {tmp_wheel_dir}")

# download dependency wheel for hydra-core
run_command(f"pip download -r requirements/requirements.txt -d {tmp_wheel_dir}")
Expand Down
Loading