diff --git a/hydra/_internal/defaults_list.py b/hydra/_internal/defaults_list.py index d24f379c94..418c447159 100644 --- a/hydra/_internal/defaults_list.py +++ b/hydra/_internal/defaults_list.py @@ -381,6 +381,7 @@ def _update_overrides( assert d.group is not None legacy_hydra_override = not d.is_override() and d.group.startswith("hydra/") if legacy_hydra_override: + # DEPRECATED: remove in 1.2 d.override = True url = "https://hydra.cc/docs/next/upgrades/1.0_to_1.1/defaults_list_override" msg = dedent( diff --git a/hydra/_internal/hydra.py b/hydra/_internal/hydra.py index bb27bc9bf1..795d340cf9 100644 --- a/hydra/_internal/hydra.py +++ b/hydra/_internal/hydra.py @@ -64,6 +64,7 @@ def create_main_hydra2( if strict is None: strict = True else: + # DEPRECATED: remove in 1.1 msg = ( "\n@hydra.main(strict) flag is deprecated and will removed in the next version." "\nSee https://hydra.cc/docs/next/upgrades/0.11_to_1.0/strict_mode_flag_deprecated" diff --git a/hydra/core/default_element.py b/hydra/core/default_element.py index d11b745dab..d04c1a4867 100644 --- a/hydra/core/default_element.py +++ b/hydra/core/default_element.py @@ -487,6 +487,7 @@ def is_interpolation(self) -> bool: def resolve_interpolation(self, known_choices: DictConfig) -> None: name = self.get_name() if name is not None: + # DEPRECATED: remove in 1.2 if re.match(_legacy_interpolation_pattern, name) is not None: msg = dedent( f""" diff --git a/hydra/core/utils.py b/hydra/core/utils.py index d0699a72ce..33220ce8a1 100644 --- a/hydra/core/utils.py +++ b/hydra/core/utils.py @@ -198,6 +198,7 @@ def split_config_path( # assuming dir/config.yaml form config_file: Optional[str] = basename(config_path) config_dir: Optional[str] = dirname(config_path) + # DEPRECATED: remove in 1.1 msg = ( "\nUsing config_path to specify the config name is deprecated, specify the config name via config_name" "\nSee https://hydra.cc/docs/next/upgrades/0.11_to_1.0/config_path_changes" diff --git a/hydra/main.py b/hydra/main.py index d4ccc340de..d3dac7cc27 100644 --- a/hydra/main.py +++ b/hydra/main.py @@ -8,6 +8,7 @@ from .types import TaskFunction +# TODO: remove strict flag (deprecated since Hydra 1.0) def main( config_path: Optional[str] = None, config_name: Optional[str] = None, diff --git a/hydra/types.py b/hydra/types.py index ef83da05ac..2cea1a7c1c 100644 --- a/hydra/types.py +++ b/hydra/types.py @@ -21,6 +21,7 @@ class TargetConf: _target_: str = MISSING def __post_init__(self) -> None: + # DEPRECATED: remove in 1.2 msg = "\nTargetConf is deprecated since Hydra 1.1 and will be removed in Hydra 1.2." warnings.warn(message=msg, category=UserWarning) diff --git a/tests/defaults_list/test_defaults_list.py b/tests/defaults_list/test_defaults_list.py index 9be4297bde..679f1d7ff9 100644 --- a/tests/defaults_list/test_defaults_list.py +++ b/tests/defaults_list/test_defaults_list.py @@ -24,106 +24,6 @@ Plugins.instance() -# TODO: (Y) Test with simple config group overrides -# TODO: (Y) Test computed package when there are no package overrides in package header -# TODO: (Y) test with config group overrides overriding config groups @pkg -# TODO: (Y) test overriding config group choices with non-default packages -# packages to test: -# (Y) _global_ -# (Y) _global_.foo -# (Y) _name_ -# TODO: (Y) test with config header package override -# TODO: (Y) test with both config header and defaults list pkg override -# TODO: Support overriding config group values from the defaults list -# - (Y) reconsider support for overriding as before, DECISION: Not happening. -# - (Y) Support marked overrides in primary config only -# - (Y) Support marked override in all configs -# - (Y) Test overriding of config groups with a specified package (@pkg) -# - (Y) Overriding of config groups with a specified package (@pkg) when there are multiple choices from same group -# - (Y) Handle hydra overrides -# TODO: Experiment use case: test the following from a config in an experiment group -# - (Y) Override user config group with and without an external override of the same config group -# - (Y) Experiment specified in primary defaults -# - (Y) Append experiment file from external overrides -# - (Y) Override hydra config group from experiment [+ external override] -# - (Y) Include config with an absolute path -# - (Y) Test final defaults list with an experiment file -# - (Y) Test experiment config as a primary (must have @package _global_ and absolute addressing of config groups) -# TODO: (Y) package header: -# - (Y) Consider making relative. Decision: package header will remain absolute. -# - (Y) Consider deprecating completely. Decision: package will not be deprecated for now -# TODO: (Y) Test use cases for config extension: -# - (Y) Extension from the same config group -# - (Y) Extension from absolute config group -# - (Y) Extension from a nested config group -# TODO: (Y) Test missing ('???') in Defaults List -# TODO: (Y) Support placeholder element -# TODO: Interpolation support -# - (Y) Simple + override -# - (Y) Forward + override -# - (Y) Interpolate with nested groups -# - (Y) Interpolate with group@pkg1 -# - (Y) Test interpolated config with a defaults list -# - (Y) Error if interpolated config defaults list has an overrides -# - (Y) Support and deprecate legacy defaults list interpolation style -# TODO: delete support from overrides -# - (Y) override to null from defaults list -# - (Y) Support delete by group -# - (Y) Support delete by group=value -# - (Y) Test deletion with a specific package -# - (Y) Deletion test with final defaults list -# TODO: Error handling: -# - (Y) Error handling for overrides that did not match any config group in the defaults list -# - (Y) Error if delete override did not delete anything -# - (Y) Duplicate _self_ error -# - (Y) test handling missing configs mentioned in defaults list -# - (Y) Ambiguous overrides should provide valid override keys for group -# - (Y) Test deprecation message when attempting to override hydra configs without override -# - (Y) duplicate entries in final defaults list raises an error -# TODO: Integration -# - (Y) replace old defaults list computation -# - (Y) enable --info=defaults output -# - (Y) ensure all tests are passing -# - (Y) implement --info=defaults-tree output - -# TODO: Followup items -# - (Y) Consider retaining the final choices in the hydra config node to allow interpolation with their values. -# - (Y) Enforce that overrides are at the end of the defaults list -# - (Y) Consider override style of: - override hydra/launcher: submitit -# - (Y) Profile and optimize default tree composition: speed in line with 1.0 -# - (Y) Fix error message when overriding a non-existing config group from the command line to not say "append with +" -# - (Y) Profile and optimize default tree composition: speed in line with 1.0 -# - (Y) Test cases when config group name matches a keyword (optional, override) -# - (Y) Clean up sporadic TODOs in the code - -# TODO: (Y) rename support: -# - (Y) Remove rename support form 1.1 -# - Deprecate rename support in 1.0 - - -# TODO: cleanup -# - (Y) Remove previous implementation of recursive defaults list and rename new_defaults_list to defaults_list etc. -# - (Y) Delete tests and test data of old defaults list impl -# - Clean up package logic from config sources -# - Clean up Hydra 1.0 warnings related to package header - - -# TODO Documentation -# - Update defaults list documentation -# - Create a page describing configuring experiments with Hydra (experiment use case) -# - Create https://hydra.cc/docs/next/upgrades/1.0_to_1.1/default_list_override -# - Update Structured Configs tutorial to utilize recursive defaults as an alternative to automatic schema -# - Consider deprecating automatic schema support in favor of extending a config via recursive defaults -# - Document --info defaults and --info defaults-tree -# - Document hydra.choices -# - Add news fragments for user facing features - - -# TODO: Followup items to explore -# - Consider deprecating automatic schema support in favor of extending a config via recursive defaults ->>>>>>> e19da87be... added hydra.choices node - - @mark.parametrize( # type: ignore "config_path,expected_list", [ diff --git a/website/docs/upgrades/0.11_to_1.0/strict_mode_flag_deprecated.md b/website/docs/upgrades/0.11_to_1.0/strict_mode_flag_deprecated.md index 775e219b26..ca01be1351 100644 --- a/website/docs/upgrades/0.11_to_1.0/strict_mode_flag_deprecated.md +++ b/website/docs/upgrades/0.11_to_1.0/strict_mode_flag_deprecated.md @@ -8,7 +8,7 @@ The strict mode is a flag added to `@hydra.main()` to enable two features: - Command line error detection (overriding a field not in the config) - Runtime config access error detection (accessing/setting a field not in the config) -This flag is now deprecated and the ability to turn it off will be removed in Hydra 1.1. +This flag is now deprecated, and the ability to turn it off will be removed in Hydra 1.1. ## Alternatives to `strict=False` Below are a few common reasons for people disabling strict mode along with recommended alternatives.