hydra-core 1.4.0.dev4__tar.gz → 1.4.0.dev6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. {hydra_core-1.4.0.dev4/hydra_core.egg-info → hydra_core-1.4.0.dev6}/PKG-INFO +7 -10
  2. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/README.md +5 -7
  3. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/__init__.py +1 -1
  4. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/_internal/config_loader_impl.py +135 -38
  5. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/_internal/config_repository.py +16 -8
  6. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/_internal/core_plugins/bash_completion.py +6 -1
  7. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/_internal/core_plugins/structured_config_source.py +0 -1
  8. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/_internal/defaults_list.py +68 -38
  9. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/_internal/grammar/grammar_functions.py +1 -1
  10. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/_internal/hydra.py +47 -17
  11. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/_internal/instantiate/_instantiate2.py +389 -64
  12. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/compose.py +7 -5
  13. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/conf/__init__.py +3 -6
  14. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/core/default_element.py +33 -16
  15. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/core/override_parser/overrides_parser.py +2 -2
  16. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/core/override_parser/overrides_visitor.py +2 -1
  17. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/core/plugins.py +6 -1
  18. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/core/utils.py +174 -6
  19. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/plugins/completion_plugin.py +1 -1
  20. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/launcher_common_tests.py +3 -3
  21. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/test_utils.py +3 -3
  22. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/utils.py +4 -0
  23. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/version.py +30 -18
  24. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6/hydra_core.egg-info}/PKG-INFO +7 -10
  25. hydra_core-1.4.0.dev6/hydra_core.egg-info/requires.txt +1 -0
  26. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/pyproject.toml +50 -25
  27. hydra_core-1.4.0.dev6/requirements/requirements.txt +1 -0
  28. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/tests/test_basic_sweeper.py +21 -2
  29. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/tests/test_callbacks.py +29 -0
  30. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/tests/test_completion.py +54 -0
  31. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/tests/test_compose.py +95 -3
  32. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/tests/test_config_loader.py +232 -2
  33. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/tests/test_config_repository.py +34 -1
  34. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/tests/test_hydra.py +117 -4
  35. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/tests/test_hydra_cli_errors.py +1 -1
  36. hydra_core-1.4.0.dev6/tests/test_plugin_interface.py +106 -0
  37. hydra_core-1.4.0.dev4/hydra_core.egg-info/requires.txt +0 -2
  38. hydra_core-1.4.0.dev4/requirements/requirements.txt +0 -2
  39. hydra_core-1.4.0.dev4/tests/test_plugin_interface.py +0 -52
  40. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/LICENSE +0 -0
  41. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/MANIFEST.in +0 -0
  42. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/build_helpers/__init__.py +0 -0
  43. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/build_helpers/bin/__init__.py +0 -0
  44. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/build_helpers/bin/antlr-4.11.1-complete.jar +0 -0
  45. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/build_helpers/build_helpers.py +0 -0
  46. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/build_helpers/test_helpers.py +0 -0
  47. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/_internal/__init__.py +0 -0
  48. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/_internal/callbacks.py +0 -0
  49. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/_internal/config_search_path_impl.py +0 -0
  50. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/_internal/core_plugins/__init__.py +0 -0
  51. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/_internal/core_plugins/basic_launcher.py +0 -0
  52. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/_internal/core_plugins/basic_sweeper.py +0 -0
  53. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/_internal/core_plugins/file_config_source.py +0 -0
  54. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/_internal/core_plugins/fish_completion.py +0 -0
  55. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/_internal/core_plugins/importlib_resources_config_source.py +0 -0
  56. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/_internal/core_plugins/zsh_completion.py +0 -0
  57. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/_internal/deprecation_warning.py +0 -0
  58. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/_internal/grammar/__init__.py +0 -0
  59. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/_internal/grammar/functions.py +0 -0
  60. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/_internal/grammar/utils.py +0 -0
  61. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/_internal/instantiate/__init__.py +0 -0
  62. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/_internal/sources_registry.py +0 -0
  63. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/_internal/utils.py +0 -0
  64. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/conf/hydra/env/default.yaml +0 -0
  65. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/conf/hydra/help/default.yaml +0 -0
  66. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/conf/hydra/hydra_help/default.yaml +0 -0
  67. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/conf/hydra/hydra_logging/default.yaml +0 -0
  68. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/conf/hydra/hydra_logging/disabled.yaml +0 -0
  69. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/conf/hydra/hydra_logging/hydra_debug.yaml +0 -0
  70. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/conf/hydra/hydra_logging/none.yaml +0 -0
  71. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/conf/hydra/job_logging/default.yaml +0 -0
  72. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/conf/hydra/job_logging/disabled.yaml +0 -0
  73. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/conf/hydra/job_logging/none.yaml +0 -0
  74. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/conf/hydra/job_logging/stdout.yaml +0 -0
  75. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/conf/hydra/output/default.yaml +0 -0
  76. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/core/__init__.py +0 -0
  77. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/core/config_loader.py +0 -0
  78. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/core/config_search_path.py +0 -0
  79. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/core/config_store.py +0 -0
  80. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/core/global_hydra.py +0 -0
  81. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/core/hydra_config.py +0 -0
  82. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/core/object_type.py +0 -0
  83. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/core/override_parser/__init__.py +0 -0
  84. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/core/override_parser/types.py +0 -0
  85. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/core/singleton.py +0 -0
  86. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/errors.py +0 -0
  87. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/experimental/__init__.py +0 -0
  88. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/experimental/callback.py +0 -0
  89. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/experimental/callbacks.py +0 -0
  90. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/experimental/compose.py +0 -0
  91. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/experimental/initialize.py +0 -0
  92. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/extra/pytest_plugin.py +0 -0
  93. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/grammar/.gitignore +0 -0
  94. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/grammar/OverrideLexer.g4 +0 -0
  95. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/grammar/OverrideParser.g4 +0 -0
  96. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/grammar/__init__.py +0 -0
  97. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/grammar/gen/.gitignore +0 -0
  98. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/grammar/gen/OverrideLexer.interp +0 -0
  99. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/grammar/gen/OverrideLexer.py +0 -0
  100. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/grammar/gen/OverrideLexer.tokens +0 -0
  101. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/grammar/gen/OverrideParser.interp +0 -0
  102. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/grammar/gen/OverrideParser.py +0 -0
  103. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/grammar/gen/OverrideParser.tokens +0 -0
  104. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/grammar/gen/OverrideParserListener.py +0 -0
  105. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/grammar/gen/OverrideParserVisitor.py +0 -0
  106. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/initialize.py +0 -0
  107. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/main.py +0 -0
  108. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/plugins/__init__.py +0 -0
  109. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/plugins/config_source.py +0 -0
  110. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/plugins/launcher.py +0 -0
  111. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/plugins/plugin.py +0 -0
  112. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/plugins/search_path_plugin.py +0 -0
  113. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/plugins/sweeper.py +0 -0
  114. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/py.typed +0 -0
  115. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/__init__.py +0 -0
  116. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/a_module.py +0 -0
  117. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/completion.py +0 -0
  118. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/config_source_common_tests.py +0 -0
  119. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/__init__.py +0 -0
  120. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/accessing_hydra_config.yaml +0 -0
  121. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/completion_test/additional_searchpath.yaml +0 -0
  122. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/completion_test/config.yaml +0 -0
  123. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/completion_test/group/dict.yaml +0 -0
  124. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/completion_test/group/list.yaml +0 -0
  125. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/completion_test/hydra/launcher/fairtask.yaml +0 -0
  126. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/completion_test/missing_default.yaml +0 -0
  127. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/completion_test/test_hydra/launcher/fairtask.yaml +0 -0
  128. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/completion_test_additional_file/additional_group/file_opt_additional.yaml +0 -0
  129. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/completion_test_additional_file/group/file_opt.yaml +0 -0
  130. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/completion_test_additional_package/__init__.py +0 -0
  131. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/completion_test_additional_package/additional_group/pkg_opt_additional.yaml +0 -0
  132. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/completion_test_additional_package/group/pkg_opt.yaml +0 -0
  133. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/compose.yaml +0 -0
  134. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/conf.zip +0 -0
  135. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/config.yaml +0 -0
  136. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/config.yml +0 -0
  137. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/custom_resolver.yaml +0 -0
  138. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/db/mysql.yaml +0 -0
  139. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/db/postgresql.yaml +0 -0
  140. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/db/validated_mysql.yaml +0 -0
  141. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/db/validated_postgresql.yaml +0 -0
  142. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/db_conf.yaml +0 -0
  143. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/defaults_not_list.yaml +0 -0
  144. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/group1/abc.cde.yaml +0 -0
  145. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/group1/file1.yaml +0 -0
  146. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/group1/file2.yaml +0 -0
  147. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/group2/file1.yaml +0 -0
  148. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/group2/file2.yaml +0 -0
  149. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/missing-default.yaml +0 -0
  150. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/missing-optional-default.yaml +0 -0
  151. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/missing_init_py/.gitignore +0 -0
  152. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/missing_init_py/test.yaml +0 -0
  153. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/optional-default.yaml +0 -0
  154. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/overriding_output_dir.yaml +0 -0
  155. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/overriding_run_dir.yaml +0 -0
  156. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/package_tests/__init__.py +0 -0
  157. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/package_tests/group1/option1.yaml +0 -0
  158. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/package_tests/group1/option2.yaml +0 -0
  159. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/package_tests/group2/option1.yaml +0 -0
  160. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/package_tests/group2/option2.yaml +0 -0
  161. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/package_tests/pkg_override.yaml +0 -0
  162. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/package_tests/two_packages_one_group.yaml +0 -0
  163. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/schema_key_error.yaml +0 -0
  164. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/schema_validation_error.yaml +0 -0
  165. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/some_config.yaml +0 -0
  166. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/top_level_list/file1.yaml +0 -0
  167. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/configs/unspecified_mandatory_default.yaml +0 -0
  168. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/test_utils/example_app.py +0 -0
  169. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra/types.py +0 -0
  170. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra_core.egg-info/SOURCES.txt +0 -0
  171. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra_core.egg-info/dependency_links.txt +0 -0
  172. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra_core.egg-info/entry_points.txt +0 -0
  173. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/hydra_core.egg-info/top_level.txt +0 -0
  174. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/setup.cfg +0 -0
  175. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/setup.py +0 -0
  176. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/tests/test_basic_launcher.py +0 -0
  177. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/tests/test_config_search_path.py +0 -0
  178. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/tests/test_core_utils.py +0 -0
  179. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/tests/test_env_defaults.py +0 -0
  180. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/tests/test_errors.py +0 -0
  181. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/tests/test_hydra_context_warnings.py +0 -0
  182. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/tests/test_internal_utils.py +0 -0
  183. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/tests/test_overrides_parser.py +0 -0
  184. {hydra_core-1.4.0.dev4 → hydra_core-1.4.0.dev6}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hydra-core
3
- Version: 1.4.0.dev4
3
+ Version: 1.4.0.dev6
4
4
  Summary: A framework for elegantly configuring complex applications
5
5
  Home-page: https://github.com/facebookresearch/hydra
6
6
  Author: Omry Yadan
@@ -19,8 +19,7 @@ Classifier: Operating System :: Microsoft :: Windows
19
19
  Requires-Python: >=3.10
20
20
  Description-Content-Type: text/markdown
21
21
  License-File: LICENSE
22
- Requires-Dist: omegaconf>=2.4.0.dev11
23
- Requires-Dist: packaging
22
+ Requires-Dist: omegaconf>=2.4.0.dev13
24
23
  Dynamic: author
25
24
  Dynamic: author-email
26
25
  Dynamic: classifier
@@ -46,18 +45,14 @@ Dynamic: summary
46
45
  <p align="center">
47
46
  <a href="https://github.com/facebookresearch/hydra/blob/main/LICENSE"><img src="https://img.shields.io/pypi/l/hydra-core" alt="PyPI - License" /></a>
48
47
  <a href="https://hydra-framework.zulipchat.com/"><img src="https://img.shields.io/badge/zulip-join_chat-brightgreen.svg" alt="Zulip chat" /></a>
49
- <a href="https://github.com/psf/black"><img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code style: black" /></a>
48
+ <a href="https://github.com/astral-sh/ruff"><img src="https://img.shields.io/badge/code%20style-ruff-261230.svg" alt="Code style: Ruff" /></a>
50
49
  </p>
51
50
 
52
51
  <p align="center">
53
52
  <i>A framework for elegantly configuring complex applications.</i>
54
53
  </p>
55
54
  <p align="center">
56
- <i>Check the <a href="https://hydra.cc/">website</a> for more information,<br>
57
- or click the thumbnail below for a one-minute video introduction to Hydra.</i>
58
- </p>
59
- <p align="center">
60
- <a href="https://www.youtube.com/watch?v=Slc3gRQpnBI" target="_blank"><img src="https://raw.githubusercontent.com/facebookresearch/hydra/main/website/static/img/Hydra-Readme-video-thumbnail.jpg" alt="1 minute overview" width="240" height="180" border="10" /></a>
55
+ <i>Check the <a href="https://hydra.cc/">website</a> for more information.</i>
61
56
  </p>
62
57
 
63
58
  ----------------------
@@ -67,8 +62,10 @@ Dynamic: summary
67
62
  #### Development
68
63
 
69
64
  **Hydra 1.4** is the current development version of Hydra.
65
+ - Hydra 1.4 is coming soon. Until the stable release is available, you can
66
+ install Hydra from development releases on PyPI.
70
67
  - [Documentation](https://hydra.cc/docs/intro/)
71
- - Installation from source : `pip install git+https://github.com/facebookresearch/hydra.git`
68
+ - Installation: `pip install --pre --upgrade hydra-core`
72
69
  - Supported Python versions: 3.10 through 3.14.
73
70
 
74
71
  #### Stable
@@ -10,18 +10,14 @@
10
10
  <p align="center">
11
11
  <a href="https://github.com/facebookresearch/hydra/blob/main/LICENSE"><img src="https://img.shields.io/pypi/l/hydra-core" alt="PyPI - License" /></a>
12
12
  <a href="https://hydra-framework.zulipchat.com/"><img src="https://img.shields.io/badge/zulip-join_chat-brightgreen.svg" alt="Zulip chat" /></a>
13
- <a href="https://github.com/psf/black"><img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code style: black" /></a>
13
+ <a href="https://github.com/astral-sh/ruff"><img src="https://img.shields.io/badge/code%20style-ruff-261230.svg" alt="Code style: Ruff" /></a>
14
14
  </p>
15
15
 
16
16
  <p align="center">
17
17
  <i>A framework for elegantly configuring complex applications.</i>
18
18
  </p>
19
19
  <p align="center">
20
- <i>Check the <a href="https://hydra.cc/">website</a> for more information,<br>
21
- or click the thumbnail below for a one-minute video introduction to Hydra.</i>
22
- </p>
23
- <p align="center">
24
- <a href="https://www.youtube.com/watch?v=Slc3gRQpnBI" target="_blank"><img src="https://raw.githubusercontent.com/facebookresearch/hydra/main/website/static/img/Hydra-Readme-video-thumbnail.jpg" alt="1 minute overview" width="240" height="180" border="10" /></a>
20
+ <i>Check the <a href="https://hydra.cc/">website</a> for more information.</i>
25
21
  </p>
26
22
 
27
23
  ----------------------
@@ -31,8 +27,10 @@
31
27
  #### Development
32
28
 
33
29
  **Hydra 1.4** is the current development version of Hydra.
30
+ - Hydra 1.4 is coming soon. Until the stable release is available, you can
31
+ install Hydra from development releases on PyPI.
34
32
  - [Documentation](https://hydra.cc/docs/intro/)
35
- - Installation from source : `pip install git+https://github.com/facebookresearch/hydra.git`
33
+ - Installation: `pip install --pre --upgrade hydra-core`
36
34
  - Supported Python versions: 3.10 through 3.14.
37
35
 
38
36
  #### Stable
@@ -1,7 +1,7 @@
1
1
  # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
2
2
 
3
3
  # Source of truth for Hydra's version
4
- __version__ = "1.4.0.dev4"
4
+ __version__ = "1.4.0.dev6"
5
5
  from hydra import utils
6
6
  from hydra.errors import MissingConfigException
7
7
  from hydra.main import main
@@ -1,7 +1,6 @@
1
1
  # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
2
2
  import copy
3
3
  import os
4
- import re
5
4
  import sys
6
5
  import warnings
7
6
  from textwrap import dedent
@@ -18,6 +17,7 @@ from omegaconf import (
18
17
  from omegaconf.errors import (
19
18
  ConfigAttributeError,
20
19
  ConfigKeyError,
20
+ MissingMandatoryValue,
21
21
  OmegaConfBaseException,
22
22
  )
23
23
 
@@ -53,6 +53,7 @@ class ConfigLoaderImpl(ConfigLoader):
53
53
  ) -> None:
54
54
  self.config_search_path = config_search_path
55
55
  self.repository = ConfigRepository(config_search_path=config_search_path)
56
+ self._active_repository: Optional[IConfigRepository] = None
56
57
 
57
58
  @staticmethod
58
59
  def validate_sweep_overrides_legal(
@@ -142,6 +143,41 @@ class ConfigLoaderImpl(ConfigLoader):
142
143
  run_mode: RunMode,
143
144
  from_shell: bool = True,
144
145
  validate_sweep_overrides: bool = True,
146
+ ) -> DictConfig:
147
+ return self._load_configuration(
148
+ config_name=config_name,
149
+ overrides=overrides,
150
+ run_mode=run_mode,
151
+ from_shell=from_shell,
152
+ validate_sweep_overrides=validate_sweep_overrides,
153
+ activate_config_repository=False,
154
+ )
155
+
156
+ def _load_configuration_with_active_repository(
157
+ self,
158
+ config_name: Optional[str],
159
+ overrides: List[str],
160
+ run_mode: RunMode,
161
+ from_shell: bool = True,
162
+ validate_sweep_overrides: bool = True,
163
+ ) -> DictConfig:
164
+ return self._load_configuration(
165
+ config_name=config_name,
166
+ overrides=overrides,
167
+ run_mode=run_mode,
168
+ from_shell=from_shell,
169
+ validate_sweep_overrides=validate_sweep_overrides,
170
+ activate_config_repository=True,
171
+ )
172
+
173
+ def _load_configuration(
174
+ self,
175
+ config_name: Optional[str],
176
+ overrides: List[str],
177
+ run_mode: RunMode,
178
+ from_shell: bool,
179
+ validate_sweep_overrides: bool,
180
+ activate_config_repository: bool,
145
181
  ) -> DictConfig:
146
182
  try:
147
183
  return self._load_configuration_impl(
@@ -150,6 +186,7 @@ class ConfigLoaderImpl(ConfigLoader):
150
186
  run_mode=run_mode,
151
187
  from_shell=from_shell,
152
188
  validate_sweep_overrides=validate_sweep_overrides,
189
+ activate_config_repository=activate_config_repository,
153
190
  )
154
191
  except OmegaConfBaseException as e:
155
192
  raise ConfigCompositionException().with_traceback(sys.exc_info()[2]) from e
@@ -242,6 +279,7 @@ class ConfigLoaderImpl(ConfigLoader):
242
279
  run_mode: RunMode,
243
280
  from_shell: bool = True,
244
281
  validate_sweep_overrides: bool = True,
282
+ activate_config_repository: bool = False,
245
283
  ) -> DictConfig:
246
284
  from hydra import __version__, version
247
285
 
@@ -279,13 +317,11 @@ class ConfigLoaderImpl(ConfigLoader):
279
317
 
280
318
  # Apply command line overrides after enabling strict flag
281
319
  ConfigLoaderImpl._apply_overrides_to_config(config_overrides, cfg)
282
- app_overrides = []
283
320
  for override in parsed_overrides:
284
321
  if override.is_hydra_override():
285
322
  cfg.hydra.overrides.hydra.append(override.input_line)
286
323
  else:
287
324
  cfg.hydra.overrides.task.append(override.input_line)
288
- app_overrides.append(override)
289
325
 
290
326
  with open_dict(cfg.hydra):
291
327
  cfg.hydra.runtime.choices.update(defaults_list.overrides.known_choices)
@@ -304,14 +340,11 @@ class ConfigLoaderImpl(ConfigLoader):
304
340
  if "name" not in cfg.hydra.job:
305
341
  cfg.hydra.job.name = JobRuntime().get("name")
306
342
 
307
- cfg.hydra.job.override_dirname = get_overrides_dirname(
308
- overrides=app_overrides,
309
- kv_sep=cfg.hydra.job.config.override_dirname.kv_sep,
310
- item_sep=cfg.hydra.job.config.override_dirname.item_sep,
311
- exclude_keys=cfg.hydra.job.config.override_dirname.exclude_keys,
312
- )
313
343
  cfg.hydra.job.config_name = config_name
314
344
 
345
+ if activate_config_repository:
346
+ self._active_repository = caching_repo
347
+
315
348
  return cfg
316
349
 
317
350
  def load_sweep_config(
@@ -326,6 +359,10 @@ class ConfigLoaderImpl(ConfigLoader):
326
359
  overrides=overrides,
327
360
  run_mode=RunMode.RUN,
328
361
  )
362
+ ConfigLoaderImpl._ensure_sweep_config_controller_unchanged(
363
+ master_config=master_config,
364
+ sweep_config=sweep_config,
365
+ )
329
366
 
330
367
  # Copy old config cache to ensure we get the same resolved values (for things
331
368
  # like timestamps etc). Since `oc.env` does not cache environment variables
@@ -334,6 +371,36 @@ class ConfigLoaderImpl(ConfigLoader):
334
371
 
335
372
  return sweep_config
336
373
 
374
+ @staticmethod
375
+ def _ensure_sweep_config_controller_unchanged(
376
+ master_config: DictConfig, sweep_config: DictConfig
377
+ ) -> None:
378
+ controller_groups = (
379
+ ("hydra/launcher", "launcher"),
380
+ ("hydra/sweeper", "sweeper"),
381
+ )
382
+ master_choices = master_config.hydra.runtime.choices
383
+ sweep_choices = sweep_config.hydra.runtime.choices
384
+ for group, node in controller_groups:
385
+ master_choice = master_choices.get(group)
386
+ sweep_choice = sweep_choices.get(group)
387
+ if master_choice != sweep_choice:
388
+ # Bandit mistakes this user-facing message for a SQL snippet.
389
+ raise ConfigCompositionException(
390
+ f"'{group}' must be selected before the sweep starts, " # nosec B608
391
+ f"but a swept job config changed it from "
392
+ f"'{master_choice}' to '{sweep_choice}'. Select it in "
393
+ "the primary config or from the command line."
394
+ )
395
+ if not OmegaConf.structural_equality(
396
+ master_config.hydra[node], sweep_config.hydra[node]
397
+ ):
398
+ raise ConfigCompositionException(
399
+ f"'hydra.{node}' must be configured before the sweep starts, "
400
+ "but a swept job config changed it. Configure it in the "
401
+ "primary config or from the command line."
402
+ )
403
+
337
404
  def get_search_path(self) -> ConfigSearchPath:
338
405
  return self.config_search_path
339
406
 
@@ -351,29 +418,62 @@ class ConfigLoaderImpl(ConfigLoader):
351
418
  value = override.value()
352
419
  try:
353
420
  if override.is_delete():
354
- config_val = OmegaConf.select(cfg, key, throw_on_missing=False)
355
- if config_val is None:
421
+ config_val_not_found = object()
422
+ config_val_missing = object()
423
+ last_dot = key.rfind(".")
424
+ parent: Container = cfg
425
+ parent_missing = False
426
+ if last_dot != -1:
427
+ parent_key = key[0:last_dot]
428
+ selected_parent = OmegaConf.select(
429
+ cfg,
430
+ parent_key,
431
+ default=config_val_not_found,
432
+ throw_on_missing=False,
433
+ )
434
+ if isinstance(selected_parent, Container):
435
+ parent = selected_parent
436
+ else:
437
+ parent_missing = True
438
+
439
+ try:
440
+ config_val = OmegaConf.select(
441
+ cfg,
442
+ key,
443
+ default=config_val_not_found,
444
+ throw_on_missing=True,
445
+ )
446
+ except MissingMandatoryValue:
447
+ config_val = config_val_missing
448
+
449
+ if parent_missing or config_val is config_val_not_found:
450
+ # Bandit mistakes this user-facing message for a SQL snippet.
356
451
  raise ConfigCompositionException(
357
- f"Could not delete from config. '{override.key_or_group}'"
452
+ f"Could not delete from config. '{override.key_or_group}'" # nosec B608
358
453
  " does not exist."
359
454
  )
360
- elif value is not None and value != config_val:
455
+ config_val_for_match = (
456
+ "???" if config_val is config_val_missing else config_val
457
+ )
458
+ if (
459
+ override.value_type is not None
460
+ and value != config_val_for_match
461
+ ):
462
+ # Bandit mistakes this user-facing message for a SQL snippet.
361
463
  raise ConfigCompositionException(
362
- "Could not delete from config. The value of"
363
- f" '{override.key_or_group}' is {config_val} and not"
464
+ "Could not delete from config. The value of" # nosec B608
465
+ f" '{override.key_or_group}' is {config_val_for_match} and not"
364
466
  f" {value}."
365
467
  )
366
468
 
367
- last_dot = key.rfind(".")
368
469
  with open_dict(cfg):
369
470
  if last_dot == -1:
370
471
  del cfg[key]
371
472
  else:
372
- node = OmegaConf.select(cfg, key[0:last_dot])
373
473
  node_key: Union[str, int] = key[last_dot + 1 :]
374
- if isinstance(node, ListConfig):
474
+ if isinstance(parent, ListConfig):
375
475
  node_key = int(node_key)
376
- del node[node_key]
476
+ del parent[node_key]
377
477
 
378
478
  elif override.is_add():
379
479
  if OmegaConf.select(
@@ -382,11 +482,13 @@ class ConfigLoaderImpl(ConfigLoader):
382
482
  OmegaConf.update(cfg, key, value, merge=True, force_add=True)
383
483
  else:
384
484
  assert override.input_line is not None
385
- raise ConfigCompositionException(dedent(f"""\
485
+ raise ConfigCompositionException(
486
+ dedent(f"""\
386
487
  Could not append to config. An item is already at '{override.key_or_group}'.
387
488
  Either remove + prefix: '{override.input_line[1:]}'
388
489
  Or add a second + to add or override '{override.key_or_group}': '+{override.input_line}'
389
- """))
490
+ """)
491
+ )
390
492
  elif override.is_force_add():
391
493
  OmegaConf.update(cfg, key, value, merge=True, force_add=True)
392
494
  elif override.is_list_extend():
@@ -440,12 +542,14 @@ class ConfigLoaderImpl(ConfigLoader):
440
542
  try:
441
543
  url = "https://hydra.cc/docs/1.2/upgrades/1.0_to_1.1/automatic_schema_matching"
442
544
  if "defaults" in schema.config:
443
- raise ConfigCompositionException(dedent(f"""\
545
+ raise ConfigCompositionException(
546
+ dedent(f"""\
444
547
  '{config_path}' is validated against ConfigStore schema with the same name.
445
548
  This behavior is deprecated in Hydra 1.1 and will be removed in Hydra 1.2.
446
549
  In addition, the automatically matched schema contains a defaults list.
447
550
  This combination is no longer supported.
448
- See {url} for migration instructions."""))
551
+ See {url} for migration instructions.""")
552
+ )
449
553
  else:
450
554
  deprecation_warning(
451
555
  dedent(f"""\
@@ -529,6 +633,12 @@ class ConfigLoaderImpl(ConfigLoader):
529
633
  config_name: Optional[str] = None,
530
634
  overrides: Optional[List[str]] = None,
531
635
  ) -> List[str]:
636
+ if (
637
+ config_name is None
638
+ and overrides is None
639
+ and self._active_repository is not None
640
+ ):
641
+ return self._active_repository.get_group_options(group_name, results_filter)
532
642
  if overrides is None:
533
643
  overrides = []
534
644
  _, caching_repo = self._parse_overrides_and_create_caching_repo(
@@ -571,6 +681,8 @@ class ConfigLoaderImpl(ConfigLoader):
571
681
  return cfg
572
682
 
573
683
  def get_sources(self) -> List[ConfigSource]:
684
+ if self._active_repository is not None:
685
+ return self._active_repository.get_sources()
574
686
  return self.repository.get_sources()
575
687
 
576
688
  def compute_defaults_list(
@@ -590,18 +702,3 @@ class ConfigLoaderImpl(ConfigLoader):
590
702
  skip_missing=run_mode == RunMode.MULTIRUN,
591
703
  )
592
704
  return defaults_list
593
-
594
-
595
- def get_overrides_dirname(
596
- overrides: List[Override], exclude_keys: List[str], item_sep: str, kv_sep: str
597
- ) -> str:
598
- lines = []
599
- for override in overrides:
600
- if override.key_or_group not in exclude_keys:
601
- line = override.input_line
602
- assert line is not None
603
- lines.append(line)
604
-
605
- lines.sort()
606
- ret = re.sub(pattern="[=]", repl=kv_sep, string=item_sep.join(lines))
607
- return ret
@@ -51,6 +51,8 @@ class IConfigRepository(ABC):
51
51
 
52
52
 
53
53
  class ConfigRepository(IConfigRepository):
54
+ _KNOWN_DEFAULTS_LIST_KEYWORDS = ("optional", "override")
55
+
54
56
  config_search_path: ConfigSearchPath
55
57
  sources: List[ConfigSource]
56
58
 
@@ -199,7 +201,9 @@ class ConfigRepository(IConfigRepository):
199
201
  assert isinstance(key, str)
200
202
  config_group, package, _package2 = self._split_group(key)
201
203
  keywords = ConfigRepository.Keywords()
202
- self._extract_keywords_from_config_group(config_group, keywords)
204
+ self._extract_keywords_from_config_group(
205
+ config_path, config_group, keywords
206
+ )
203
207
 
204
208
  if not version.base_at_least("1.2"):
205
209
  if not keywords.optional and old_optional is not None:
@@ -301,18 +305,22 @@ class ConfigRepository(IConfigRepository):
301
305
 
302
306
  @staticmethod
303
307
  def _extract_keywords_from_config_group(
304
- group: str, keywords: "ConfigRepository.Keywords"
308
+ config_path: str, group: str, keywords: "ConfigRepository.Keywords"
305
309
  ) -> None:
306
- elements = group.split(" ")
310
+ elements = group.split()
311
+ if not elements:
312
+ raise ValueError(f"In {config_path}: Missing group name in defaults list")
307
313
  group = elements[-1]
308
314
  elements = elements[0:-1]
309
- for idx, e in enumerate(elements):
310
- if e == "optional":
315
+ for keyword in elements:
316
+ if keyword not in ConfigRepository._KNOWN_DEFAULTS_LIST_KEYWORDS:
317
+ raise ValueError(
318
+ f"In {config_path}: Unsupported keyword '{keyword}' in defaults list"
319
+ )
320
+ if keyword == "optional":
311
321
  keywords.optional = True
312
- elif e == "override":
322
+ elif keyword == "override":
313
323
  keywords.override = True
314
- else:
315
- break
316
324
  keywords.group = group
317
325
 
318
326
 
@@ -22,11 +22,16 @@ class BashCompletion(CompletionPlugin):
22
22
  if (( ${#words[@]} < 2 )); then
23
23
  return
24
24
  fi
25
+ if [[ "${words[1]}" == -* ]]; then
26
+ return
27
+ fi
25
28
  file_path=$(pwd)/${words[1]}
26
29
  if [ ! -f "$file_path" ]; then
27
30
  return
28
31
  fi
29
- grep "@hydra.main" $file_path -q
32
+ if ! grep -Fq -- "@hydra.main" "$file_path"; then
33
+ return
34
+ fi
30
35
  helper="${words[0]} ${words[1]}"
31
36
  else
32
37
  helper="${words[0]}"
@@ -9,7 +9,6 @@ from hydra.plugins.config_source import ConfigResult, ConfigSource
9
9
 
10
10
 
11
11
  class StructuredConfigSource(ConfigSource):
12
-
13
12
  def __init__(self, provider: str, path: str) -> None:
14
13
  super().__init__(provider=provider, path=path)
15
14
  # Import the module, the __init__ there is expected to register the configs.
@@ -72,25 +72,30 @@ class Overrides:
72
72
  if override.is_sweep_override():
73
73
  continue
74
74
  is_group = repo.group_exists(override.key_or_group)
75
+ is_config = repo.config_exists(override.key_or_group)
75
76
  value = override.value()
76
77
  is_dict = isinstance(override.value(), dict)
77
- if is_dict or not is_group:
78
+ if override.is_delete() and (is_group or is_config):
79
+ key = override.get_key_element()[1:]
80
+ if is_group:
81
+ if value is not None and not isinstance(value, str):
82
+ raise ValueError(
83
+ f"Config group override deletion value must be a string : {override}"
84
+ )
85
+ self.deletions[key] = Deletion(name=value)
86
+ else:
87
+ if value is not None:
88
+ raise ValueError(
89
+ f"Config path deletion does not support a value : {override}"
90
+ )
91
+ self.deletions[key] = Deletion(name=None)
92
+ elif is_dict or not is_group:
78
93
  self.config_overrides.append(override)
79
94
  elif override.is_force_add():
80
95
  # This could probably be made to work if there is a compelling use case.
81
96
  raise ConfigCompositionException(
82
97
  f"force-add of config groups is not supported: '{override.input_line}'"
83
98
  )
84
- elif override.is_delete():
85
- key = override.get_key_element()[1:]
86
- value = override.value()
87
- if value is not None and not isinstance(value, str):
88
- raise ValueError(
89
- f"Config group override deletion value must be a string : {override}"
90
- )
91
-
92
- self.deletions[key] = Deletion(name=value)
93
-
94
99
  elif not isinstance(value, (str, list)):
95
100
  raise ValueError(
96
101
  f"Config group override must be a string or a list. Got {type(value).__name__}"
@@ -193,22 +198,28 @@ class Overrides:
193
198
  self.known_choices_per_group[group].add(key)
194
199
 
195
200
  def is_deleted(self, default: InputDefault) -> bool:
196
- if not isinstance(default, GroupDefault):
197
- return False
198
- key = default.get_override_key()
199
- if key in self.deletions:
200
- deletion = self.deletions[key]
201
- if deletion.name is None:
202
- return True
203
- else:
204
- return deletion.name == default.get_name()
201
+ if isinstance(default, GroupDefault):
202
+ key = default.get_override_key()
203
+ if key in self.deletions:
204
+ deletion = self.deletions[key]
205
+ if deletion.name is None:
206
+ return True
207
+ else:
208
+ return deletion.name == default.get_name()
209
+ elif isinstance(default, ConfigDefault):
210
+ key = default.get_config_path()
211
+ if key in self.deletions:
212
+ return self.deletions[key].name is None
205
213
  return False
206
214
 
207
215
  def delete(self, default: InputDefault) -> None:
208
- assert isinstance(default, GroupDefault)
209
- default.deleted = True
210
-
211
- key = default.get_override_key()
216
+ if isinstance(default, GroupDefault):
217
+ default.deleted = True
218
+ key = default.get_override_key()
219
+ else:
220
+ assert isinstance(default, ConfigDefault)
221
+ default.deleted = True
222
+ key = default.get_config_path()
212
223
  self.deletions[key].used = True
213
224
 
214
225
 
@@ -326,7 +337,7 @@ def _check_not_missing(
326
337
  return False
327
338
 
328
339
 
329
- def _create_interpolation_map(
340
+ def _create_legacy_interpolation_map(
330
341
  overrides: Overrides,
331
342
  defaults_list: List[InputDefault],
332
343
  self_added: bool,
@@ -391,9 +402,11 @@ def _update_overrides(
391
402
  pcp = parent.get_config_path()
392
403
  okey = last_override_seen.get_override_key()
393
404
  oval = last_override_seen.get_name()
394
- raise ConfigCompositionException(dedent(f"""\
405
+ raise ConfigCompositionException(
406
+ dedent(f"""\
395
407
  In {pcp}: Override '{okey} : {oval}' is defined before '{d.get_override_key()}: {d.get_name()}'.
396
- Overrides must be at the end of the defaults list"""))
408
+ Overrides must be at the end of the defaults list""")
409
+ )
397
410
 
398
411
  if isinstance(d, GroupDefault):
399
412
  if legacy_hydra_override:
@@ -413,10 +426,12 @@ def _update_overrides(
413
426
  if interpolated_subtree:
414
427
  # Since interpolations are deferred for until all the config groups are already set,
415
428
  # Their subtree may not contain config group overrides
416
- raise ConfigCompositionException(dedent(f"""\
429
+ raise ConfigCompositionException(
430
+ dedent(f"""\
417
431
  {parent.get_config_path()}: Default List Overrides are not allowed in the subtree
418
432
  of an in interpolated config group (override {d.get_override_key()}={d.get_name()}).
419
- """))
433
+ """)
434
+ )
420
435
  overrides.add_override(parent.get_config_path(), d)
421
436
 
422
437
 
@@ -541,14 +556,23 @@ def _create_defaults_tree_impl(
541
556
  )
542
557
 
543
558
  assert d.group is not None
544
- node = ConfigDefault(
545
- path=d.group + "/" + item,
546
- package=d.package,
547
- optional=d.is_optional(),
548
- )
549
- node.update_parent(
550
- parent.get_group_path(), parent.get_final_package()
551
- )
559
+ if d.is_external_append():
560
+ node = ConfigDefault(
561
+ path=f"{d.get_group_path()}/{item}",
562
+ package=d.package,
563
+ optional=d.is_optional(),
564
+ )
565
+ # External appends are already absolute in Hydra's config namespace.
566
+ node.update_parent("", "")
567
+ else:
568
+ node = ConfigDefault(
569
+ path=f"{d.group}/{item}",
570
+ package=d.package,
571
+ optional=d.is_optional(),
572
+ )
573
+ node.update_parent(
574
+ parent.get_group_path(), parent.get_final_package()
575
+ )
552
576
  new_root = DefaultsTreeNode(node=node, parent=root)
553
577
  add_child(children, new_root)
554
578
 
@@ -561,7 +585,13 @@ def _create_defaults_tree_impl(
561
585
  add_child(children, new_root)
562
586
 
563
587
  # processed deferred interpolations
564
- known_choices = _create_interpolation_map(overrides, defaults_list, self_added)
588
+ known_choices = OmegaConf.create(overrides.known_choices)
589
+ # TODO: Remove Hydra 1.1 compatibility in
590
+ # https://github.com/facebookresearch/hydra/issues/3221.
591
+ if not version.base_at_least("1.2"):
592
+ known_choices = _create_legacy_interpolation_map(
593
+ overrides, defaults_list, self_added
594
+ )
565
595
 
566
596
  for idx, dd in enumerate(children):
567
597
  if isinstance(dd, InputDefault) and dd.is_interpolation():
@@ -204,7 +204,7 @@ def cast_bool(*args: CastType, value: Optional[CastType] = None) -> Any:
204
204
 
205
205
 
206
206
  def choice(
207
- *args: Union[str, int, float, bool, Dict[Any, Any], List[Any], ChoiceSweep]
207
+ *args: Union[str, int, float, bool, Dict[Any, Any], List[Any], ChoiceSweep],
208
208
  ) -> ChoiceSweep:
209
209
  """
210
210
  A choice sweep over the specified values