diff --git a/noxfile.py b/noxfile.py index 693717dfe59..fa1f062e16c 100644 --- a/noxfile.py +++ b/noxfile.py @@ -578,7 +578,12 @@ def test_selected_plugins(session: Session, selected_plugins: List[Plugin]) -> N # Run tests for all installed plugins for plugin in selected_plugins: session.chdir(plugin.abspath) - run_pytest(session) + run_pytest( + session, + ".", + "-W ignore:pkg_resources is deprecated as an API.", + *session.posargs, + ) @nox.session(python="3.8") # type: ignore diff --git a/plugins/hydra_ray_launcher/hydra_plugins/hydra_ray_launcher/_config.py b/plugins/hydra_ray_launcher/hydra_plugins/hydra_ray_launcher/_config.py index 01432b0bfbe..e4e1ac09eb8 100644 --- a/plugins/hydra_ray_launcher/hydra_plugins/hydra_ray_launcher/_config.py +++ b/plugins/hydra_ray_launcher/hydra_plugins/hydra_ray_launcher/_config.py @@ -3,11 +3,11 @@ from dataclasses import dataclass, field from enum import Enum, IntEnum from importlib import import_module +from importlib.metadata import version from typing import Any, Dict, List, Optional from hydra.core.config_store import ConfigStore from omegaconf import OmegaConf -from pkg_resources import get_distribution @dataclass @@ -178,11 +178,11 @@ def _pip_pkgs_default_factory() -> Dict[str, str]: "hydra_core": "${ray_pkg_version:hydra}", "ray": "${ray_pkg_version:ray}", "cloudpickle": "${ray_pkg_version:cloudpickle}", - "hydra_ray_launcher": get_distribution("hydra_ray_launcher").version, + "hydra_ray_launcher": version("hydra_ray_launcher"), } if sys.version_info < (3, 8): - d["pickle5"] = get_distribution("pickle5").version + d["pickle5"] = version("pickle5") return d diff --git a/plugins/hydra_ray_launcher/hydra_plugins/hydra_ray_launcher/ray_aws_launcher.py b/plugins/hydra_ray_launcher/hydra_plugins/hydra_ray_launcher/ray_aws_launcher.py index efb33c72625..267974ed54b 100644 --- a/plugins/hydra_ray_launcher/hydra_plugins/hydra_ray_launcher/ray_aws_launcher.py +++ b/plugins/hydra_ray_launcher/hydra_plugins/hydra_ray_launcher/ray_aws_launcher.py @@ -1,5 +1,6 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import logging +import warnings from typing import Optional, Sequence from hydra.core.utils import JobReturn @@ -30,6 +31,8 @@ def __init__( create_update_cluster: RayCreateOrUpdateClusterConf, teardown_cluster: RayTeardownClusterConf, ) -> None: + warnings.warn("RayAWSLauncher may not work", DeprecationWarning, stacklevel=2) + self.ray_cfg = ray self.stop_cluster = stop_cluster self.sync_up = sync_up diff --git a/plugins/hydra_ray_launcher/setup.py b/plugins/hydra_ray_launcher/setup.py index 22953d72f41..d9df3ee28b4 100644 --- a/plugins/hydra_ray_launcher/setup.py +++ b/plugins/hydra_ray_launcher/setup.py @@ -20,16 +20,18 @@ "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Operating System :: MacOS", "Operating System :: POSIX :: Linux", ], install_requires=[ - "boto3==1.22.6", - "hydra-core>=1.1.2", - "ray[default]~=1.12", - "aiohttp==3.8.1", - "cloudpickle==2.0.0", - "pickle5==0.0.11; python_version < '3.8'", + "boto3>=1.28,<1.29", + "hydra-core>=1.2", + "ray[default]>=2,<3", + "aiohttp>=3,<4", + "cloudpickle>=3,<4", + "pickle5==0.0.12; python_version < '3.8'", ], include_package_data=True, ) diff --git a/plugins/hydra_ray_launcher/tests/test_ray_aws_launcher.py b/plugins/hydra_ray_launcher/tests/test_ray_aws_launcher.py index bc6a382fbfd..605b06e8cb8 100644 --- a/plugins/hydra_ray_launcher/tests/test_ray_aws_launcher.py +++ b/plugins/hydra_ray_launcher/tests/test_ray_aws_launcher.py @@ -6,11 +6,11 @@ import subprocess import sys import tempfile +from importlib.metadata import version from pathlib import Path from typing import Any, Dict, Generator, Optional import boto3 # type: ignore -import pkg_resources from botocore.exceptions import NoCredentialsError, NoRegionError # type: ignore from hydra.core.plugins import Plugins from hydra.plugins.launcher import Launcher @@ -195,11 +195,10 @@ def validate_lib_version(connect_config: Dict[Any, Any]) -> None: # a few lib versions that we care about libs = ["ray", "cloudpickle", "pickle5"] for lib in libs: - local_version = f"{pkg_resources.get_distribution(lib).version}" out = sdk.run_on_cluster( connect_config, cmd=f"pip show {lib} | grep Version", with_output=True ).decode() - assert local_version in out, f"{lib} version mismatch" + assert version(lib) in out, f"{lib} version mismatch" # validate python version info = sys.version_info