hydra-core 1.3.2__tar.gz → 1.4.0.dev1__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.
- {hydra-core-1.3.2/hydra_core.egg-info → hydra_core-1.4.0.dev1}/PKG-INFO +5 -3
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/README.md +1 -1
- hydra_core-1.4.0.dev1/build_helpers/bin/antlr-4.11.1-complete.jar +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/build_helpers/build_helpers.py +32 -1
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/build_helpers/test_helpers.py +2 -2
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/__init__.py +1 -1
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/_internal/config_repository.py +7 -14
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/_internal/core_plugins/basic_sweeper.py +1 -1
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/_internal/core_plugins/importlib_resources_config_source.py +5 -3
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/_internal/core_plugins/zsh_completion.py +1 -1
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/_internal/defaults_list.py +2 -2
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/_internal/grammar/grammar_functions.py +1 -1
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/_internal/hydra.py +8 -8
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/_internal/utils.py +1 -1
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/core/config_loader.py +7 -14
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/core/config_search_path.py +1 -2
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/core/config_store.py +3 -4
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/core/override_parser/overrides_parser.py +4 -1
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/core/override_parser/overrides_visitor.py +19 -13
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/core/plugins.py +2 -1
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/core/singleton.py +1 -1
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/errors.py +8 -14
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/experimental/initialize.py +7 -2
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/extra/pytest_plugin.py +24 -28
- hydra_core-1.4.0.dev1/hydra/grammar/gen/OverrideLexer.interp +102 -0
- hydra_core-1.4.0.dev1/hydra/grammar/gen/OverrideLexer.py +228 -0
- hydra_core-1.4.0.dev1/hydra/grammar/gen/OverrideParser.interp +75 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/grammar/gen/OverrideParser.py +87 -94
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/grammar/gen/OverrideParserListener.py +2 -2
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/grammar/gen/OverrideParserVisitor.py +2 -2
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/initialize.py +3 -6
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/plugins/completion_plugin.py +6 -9
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/plugins/config_source.py +3 -6
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/plugins/plugin.py +1 -2
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/plugins/search_path_plugin.py +1 -2
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/test_utils.py +5 -12
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/version.py +5 -1
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1/hydra_core.egg-info}/PKG-INFO +5 -3
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra_core.egg-info/SOURCES.txt +1 -1
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra_core.egg-info/requires.txt +1 -2
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/requirements/requirements.txt +1 -2
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/setup.py +1 -2
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/tests/test_basic_launcher.py +1 -2
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/tests/test_callbacks.py +3 -3
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/tests/test_completion.py +1 -1
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/tests/test_compose.py +11 -2
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/tests/test_config_loader.py +10 -6
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/tests/test_config_repository.py +1 -6
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/tests/test_core_utils.py +4 -4
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/tests/test_hydra.py +2 -2
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/tests/test_overrides_parser.py +0 -1
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/tests/test_plugin_interface.py +2 -4
- hydra-core-1.3.2/build_helpers/bin/antlr-4.9.3-complete.jar +0 -0
- hydra-core-1.3.2/hydra/grammar/gen/OverrideLexer.interp +0 -102
- hydra-core-1.3.2/hydra/grammar/gen/OverrideLexer.py +0 -266
- hydra-core-1.3.2/hydra/grammar/gen/OverrideParser.interp +0 -75
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/LICENSE +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/MANIFEST.in +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/build_helpers/__init__.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/build_helpers/bin/__init__.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/_internal/__init__.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/_internal/callbacks.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/_internal/config_loader_impl.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/_internal/config_search_path_impl.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/_internal/core_plugins/__init__.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/_internal/core_plugins/bash_completion.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/_internal/core_plugins/basic_launcher.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/_internal/core_plugins/file_config_source.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/_internal/core_plugins/fish_completion.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/_internal/core_plugins/structured_config_source.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/_internal/deprecation_warning.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/_internal/grammar/__init__.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/_internal/grammar/functions.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/_internal/grammar/utils.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/_internal/instantiate/__init__.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/_internal/instantiate/_instantiate2.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/_internal/sources_registry.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/compose.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/conf/__init__.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/conf/hydra/env/default.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/conf/hydra/help/default.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/conf/hydra/hydra_help/default.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/conf/hydra/hydra_logging/default.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/conf/hydra/hydra_logging/disabled.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/conf/hydra/hydra_logging/hydra_debug.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/conf/hydra/hydra_logging/none.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/conf/hydra/job_logging/default.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/conf/hydra/job_logging/disabled.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/conf/hydra/job_logging/none.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/conf/hydra/job_logging/stdout.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/conf/hydra/output/default.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/core/__init__.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/core/default_element.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/core/global_hydra.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/core/hydra_config.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/core/object_type.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/core/override_parser/__init__.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/core/override_parser/types.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/core/utils.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/experimental/__init__.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/experimental/callback.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/experimental/callbacks.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/experimental/compose.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/grammar/.gitignore +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/grammar/OverrideLexer.g4 +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/grammar/OverrideParser.g4 +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/grammar/__init__.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/grammar/gen/.gitignore +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/grammar/gen/OverrideLexer.tokens +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/grammar/gen/OverrideParser.tokens +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/main.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/plugins/__init__.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/plugins/launcher.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/plugins/sweeper.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/py.typed +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/__init__.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/a_module.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/completion.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/config_source_common_tests.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/__init__.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/accessing_hydra_config.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/completion_test/additional_searchpath.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/completion_test/config.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/completion_test/group/dict.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/completion_test/group/list.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/completion_test/hydra/launcher/fairtask.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/completion_test/missing_default.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/completion_test/test_hydra/launcher/fairtask.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/completion_test_additional_file/additional_group/file_opt_additional.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/completion_test_additional_file/group/file_opt.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/completion_test_additional_package/__init__.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/completion_test_additional_package/additional_group/pkg_opt_additional.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/completion_test_additional_package/group/pkg_opt.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/compose.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/conf.zip +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/config.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/config.yml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/custom_resolver.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/db/mysql.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/db/postgresql.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/db/validated_mysql.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/db/validated_postgresql.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/db_conf.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/defaults_not_list.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/group1/abc.cde.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/group1/file1.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/group1/file2.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/group2/file1.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/group2/file2.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/missing-default.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/missing-optional-default.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/missing_init_py/.gitignore +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/missing_init_py/test.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/optional-default.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/overriding_output_dir.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/overriding_run_dir.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/package_tests/__init__.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/package_tests/group1/option1.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/package_tests/group1/option2.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/package_tests/group2/option1.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/package_tests/group2/option2.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/package_tests/pkg_override.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/package_tests/two_packages_one_group.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/schema_key_error.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/schema_validation_error.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/some_config.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/top_level_list/file1.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/configs/unspecified_mandatory_default.yaml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/example_app.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/test_utils/launcher_common_tests.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/types.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra/utils.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra_core.egg-info/dependency_links.txt +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra_core.egg-info/entry_points.txt +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/hydra_core.egg-info/top_level.txt +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/pyproject.toml +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/setup.cfg +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/tests/test_basic_sweeper.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/tests/test_config_search_path.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/tests/test_env_defaults.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/tests/test_errors.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/tests/test_hydra_cli_errors.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/tests/test_hydra_context_warnings.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/tests/test_internal_utils.py +0 -0
- {hydra-core-1.3.2 → hydra_core-1.4.0.dev1}/tests/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: hydra-core
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4.0.dev1
|
|
4
4
|
Summary: A framework for elegantly configuring complex applications
|
|
5
5
|
Home-page: https://github.com/facebookresearch/hydra
|
|
6
6
|
Author: Omry Yadan
|
|
@@ -9,7 +9,6 @@ License: MIT
|
|
|
9
9
|
Keywords: command-line configuration yaml tab-completion
|
|
10
10
|
Classifier: License :: OSI Approved :: MIT License
|
|
11
11
|
Classifier: Development Status :: 4 - Beta
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
13
12
|
Classifier: Programming Language :: Python :: 3.8
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.9
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.10
|
|
@@ -19,8 +18,11 @@ Classifier: Operating System :: MacOS
|
|
|
19
18
|
Classifier: Operating System :: Microsoft :: Windows
|
|
20
19
|
Description-Content-Type: text/markdown
|
|
21
20
|
License-File: LICENSE
|
|
21
|
+
Requires-Dist: omegaconf>=2.4.0.dev2
|
|
22
|
+
Requires-Dist: importlib-resources; python_version < "3.9"
|
|
23
|
+
Requires-Dist: packaging
|
|
22
24
|
|
|
23
|
-
<p align="center"><img src="https://raw.githubusercontent.com/facebookresearch/hydra/
|
|
25
|
+
<p align="center"><img src="https://raw.githubusercontent.com/facebookresearch/hydra/main/website/static/img/Hydra-Readme-logo2.svg" alt="logo" width="70%" /></p>
|
|
24
26
|
|
|
25
27
|
<p align="center">
|
|
26
28
|
<a href="https://pypi.org/project/hydra-core/">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<p align="center"><img src="https://raw.githubusercontent.com/facebookresearch/hydra/
|
|
1
|
+
<p align="center"><img src="https://raw.githubusercontent.com/facebookresearch/hydra/main/website/static/img/Hydra-Readme-logo2.svg" alt="logo" width="70%" /></p>
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
4
|
<a href="https://pypi.org/project/hydra-core/">
|
|
Binary file
|
|
@@ -6,7 +6,9 @@ import os
|
|
|
6
6
|
import re
|
|
7
7
|
import shutil
|
|
8
8
|
import subprocess
|
|
9
|
+
from functools import partial
|
|
9
10
|
from os.path import abspath, basename, dirname, exists, isdir, join
|
|
11
|
+
from pathlib import Path
|
|
10
12
|
from typing import List, Optional
|
|
11
13
|
|
|
12
14
|
from setuptools import Command
|
|
@@ -185,7 +187,7 @@ class ANTLRCommand(Command): # type: ignore
|
|
|
185
187
|
command = [
|
|
186
188
|
"java",
|
|
187
189
|
"-jar",
|
|
188
|
-
join(root_dir, "bin/antlr-4.
|
|
190
|
+
join(root_dir, "bin/antlr-4.11.1-complete.jar"),
|
|
189
191
|
"-Dlanguage=Python3",
|
|
190
192
|
"-o",
|
|
191
193
|
join(project_root, "hydra/grammar/gen/"),
|
|
@@ -198,8 +200,37 @@ class ANTLRCommand(Command): # type: ignore
|
|
|
198
200
|
|
|
199
201
|
subprocess.check_call(command)
|
|
200
202
|
|
|
203
|
+
log.info("Replacing imports of antlr4 in generated parsers")
|
|
204
|
+
self._fix_imports()
|
|
205
|
+
|
|
201
206
|
def initialize_options(self) -> None:
|
|
202
207
|
pass
|
|
203
208
|
|
|
204
209
|
def finalize_options(self) -> None:
|
|
205
210
|
pass
|
|
211
|
+
|
|
212
|
+
def _fix_imports(self) -> None:
|
|
213
|
+
"""Fix imports from the generated parsers to use the vendored antlr4 instead"""
|
|
214
|
+
build_dir = Path(__file__).parent.absolute()
|
|
215
|
+
project_root = build_dir.parent
|
|
216
|
+
lib = "antlr4"
|
|
217
|
+
pkgname = 'omegaconf.vendor'
|
|
218
|
+
|
|
219
|
+
replacements = [
|
|
220
|
+
partial( # import antlr4 -> import omegaconf.vendor.antlr4
|
|
221
|
+
re.compile(r'(^\s*)import {}\n'.format(lib), flags=re.M).sub,
|
|
222
|
+
r'\1from {} import {}\n'.format(pkgname, lib)
|
|
223
|
+
),
|
|
224
|
+
partial( # from antlr4 -> from fomegaconf.vendor.antlr4
|
|
225
|
+
re.compile(r'(^\s*)from {}(\.|\s+)'.format(lib), flags=re.M).sub,
|
|
226
|
+
r'\1from {}.{}\2'.format(pkgname, lib)
|
|
227
|
+
),
|
|
228
|
+
]
|
|
229
|
+
|
|
230
|
+
path = project_root / "hydra" / "grammar" / "gen"
|
|
231
|
+
for item in path.iterdir():
|
|
232
|
+
if item.is_file() and item.name.endswith(".py"):
|
|
233
|
+
text = item.read_text('utf8')
|
|
234
|
+
for replacement in replacements:
|
|
235
|
+
text = replacement(text)
|
|
236
|
+
item.write_text(text, 'utf8')
|
|
@@ -112,8 +112,8 @@ def test_find(
|
|
|
112
112
|
scan_exclude=scan_exclude,
|
|
113
113
|
)
|
|
114
114
|
|
|
115
|
-
ret_set =
|
|
116
|
-
expected_set =
|
|
115
|
+
ret_set = {str(Path(x)) for x in ret}
|
|
116
|
+
expected_set = {str(Path(x)) for x in expected}
|
|
117
117
|
assert ret_set == expected_set
|
|
118
118
|
|
|
119
119
|
|
|
@@ -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
|
+
__version__ = "1.4.0.dev1"
|
|
5
5
|
from hydra import utils
|
|
6
6
|
from hydra.errors import MissingConfigException
|
|
7
7
|
from hydra.main import main
|
|
@@ -27,34 +27,27 @@ from .sources_registry import SourcesRegistry
|
|
|
27
27
|
|
|
28
28
|
class IConfigRepository(ABC):
|
|
29
29
|
@abstractmethod
|
|
30
|
-
def get_schema_source(self) -> ConfigSource:
|
|
31
|
-
...
|
|
30
|
+
def get_schema_source(self) -> ConfigSource: ...
|
|
32
31
|
|
|
33
32
|
@abstractmethod
|
|
34
|
-
def load_config(self, config_path: str) -> Optional[ConfigResult]:
|
|
35
|
-
...
|
|
33
|
+
def load_config(self, config_path: str) -> Optional[ConfigResult]: ...
|
|
36
34
|
|
|
37
35
|
@abstractmethod
|
|
38
|
-
def group_exists(self, config_path: str) -> bool:
|
|
39
|
-
...
|
|
36
|
+
def group_exists(self, config_path: str) -> bool: ...
|
|
40
37
|
|
|
41
38
|
@abstractmethod
|
|
42
|
-
def config_exists(self, config_path: str) -> bool:
|
|
43
|
-
...
|
|
39
|
+
def config_exists(self, config_path: str) -> bool: ...
|
|
44
40
|
|
|
45
41
|
@abstractmethod
|
|
46
42
|
def get_group_options(
|
|
47
43
|
self, group_name: str, results_filter: Optional[ObjectType] = ObjectType.CONFIG
|
|
48
|
-
) -> List[str]:
|
|
49
|
-
...
|
|
44
|
+
) -> List[str]: ...
|
|
50
45
|
|
|
51
46
|
@abstractmethod
|
|
52
|
-
def get_sources(self) -> List[ConfigSource]:
|
|
53
|
-
...
|
|
47
|
+
def get_sources(self) -> List[ConfigSource]: ...
|
|
54
48
|
|
|
55
49
|
@abstractmethod
|
|
56
|
-
def initialize_sources(self, config_search_path: ConfigSearchPath) -> None:
|
|
57
|
-
...
|
|
50
|
+
def initialize_sources(self, config_search_path: ConfigSearchPath) -> None: ...
|
|
58
51
|
|
|
59
52
|
|
|
60
53
|
class ConfigRepository(IConfigRepository):
|
|
@@ -30,7 +30,7 @@ class ImportlibResourcesConfigSource(ConfigSource):
|
|
|
30
30
|
|
|
31
31
|
def _read_config(self, res: Any) -> ConfigResult:
|
|
32
32
|
try:
|
|
33
|
-
if
|
|
33
|
+
if isinstance(res, zipfile.Path):
|
|
34
34
|
# zipfile does not support encoding, read() calls returns bytes.
|
|
35
35
|
f = res.open()
|
|
36
36
|
else:
|
|
@@ -38,8 +38,10 @@ class ImportlibResourcesConfigSource(ConfigSource):
|
|
|
38
38
|
header_text = f.read(512)
|
|
39
39
|
if isinstance(header_text, bytes):
|
|
40
40
|
# if header is bytes, utf-8 decode (zipfile path)
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
header_text_str = header_text.decode("utf-8")
|
|
42
|
+
else:
|
|
43
|
+
header_text_str = header_text
|
|
44
|
+
header = ConfigSource._get_header_dict(header_text_str)
|
|
43
45
|
f.seek(0)
|
|
44
46
|
cfg = OmegaConf.load(f)
|
|
45
47
|
return ConfigResult(
|
|
@@ -10,7 +10,7 @@ log = logging.getLogger(__name__)
|
|
|
10
10
|
|
|
11
11
|
class ZshCompletion(CompletionPlugin):
|
|
12
12
|
def __init__(self, config_loader: ConfigLoader):
|
|
13
|
-
super(
|
|
13
|
+
super().__init__(config_loader)
|
|
14
14
|
from hydra._internal.core_plugins.bash_completion import BashCompletion
|
|
15
15
|
|
|
16
16
|
self.delegate = BashCompletion(config_loader)
|
|
@@ -312,7 +312,7 @@ def _check_not_missing(
|
|
|
312
312
|
group_path,
|
|
313
313
|
results_filter=ObjectType.CONFIG,
|
|
314
314
|
)
|
|
315
|
-
opt_list = "\n".join(
|
|
315
|
+
opt_list = "\n".join("\t" + x for x in options)
|
|
316
316
|
msg = dedent(
|
|
317
317
|
f"""\
|
|
318
318
|
You must specify '{override_key}', e.g, {override_key}=<OPTION>
|
|
@@ -778,7 +778,7 @@ def config_not_found_error(repo: IConfigRepository, tree: DefaultsTreeNode) -> N
|
|
|
778
778
|
if isinstance(element, GroupDefault):
|
|
779
779
|
msg = f"Could not find '{element.get_config_path()}'\n"
|
|
780
780
|
if options is not None and len(options) > 0:
|
|
781
|
-
opt_list = "\n".join(
|
|
781
|
+
opt_list = "\n".join("\t" + x for x in options)
|
|
782
782
|
msg = f"{msg}\nAvailable options in '{group}':\n" + opt_list
|
|
783
783
|
else:
|
|
784
784
|
msg = dedent(
|
|
@@ -233,7 +233,7 @@ class Hydra:
|
|
|
233
233
|
|
|
234
234
|
for shell, plugins in shell_to_plugin.items():
|
|
235
235
|
if len(plugins) > 1:
|
|
236
|
-
lst = ",".join(
|
|
236
|
+
lst = ",".join(type(plugin).__name__ for plugin in plugins)
|
|
237
237
|
raise ValueError(f"Multiple plugins installed for {shell} : {lst}")
|
|
238
238
|
|
|
239
239
|
return shell_to_plugin
|
|
@@ -251,7 +251,7 @@ class Hydra:
|
|
|
251
251
|
|
|
252
252
|
def find_plugin(cmd: str) -> CompletionPlugin:
|
|
253
253
|
if cmd not in shell_to_plugin:
|
|
254
|
-
lst = "\n".join(
|
|
254
|
+
lst = "\n".join("\t" + x for x in shell_to_plugin.keys())
|
|
255
255
|
raise ValueError(
|
|
256
256
|
f"No completion plugin for '{cmd}' found, available : \n{lst}"
|
|
257
257
|
)
|
|
@@ -287,7 +287,7 @@ class Hydra:
|
|
|
287
287
|
if parent == "":
|
|
288
288
|
group_name = group
|
|
289
289
|
else:
|
|
290
|
-
group_name = "{}/{}"
|
|
290
|
+
group_name = f"{parent}/{group}"
|
|
291
291
|
files = self.config_loader.get_group_options(group_name, ObjectType.CONFIG)
|
|
292
292
|
dirs = self.config_loader.get_group_options(group_name, ObjectType.GROUP)
|
|
293
293
|
if len(files) > 0:
|
|
@@ -305,10 +305,10 @@ class Hydra:
|
|
|
305
305
|
options = sorted(self.config_loader.get_group_options(group))
|
|
306
306
|
if compact:
|
|
307
307
|
items = ", ".join(options)
|
|
308
|
-
line = "{}: {}"
|
|
308
|
+
line = f"{group}: {items}"
|
|
309
309
|
else:
|
|
310
|
-
items = "\n".join(
|
|
311
|
-
line = "{}:\n{}"
|
|
310
|
+
items = "\n".join(" " + o for o in options)
|
|
311
|
+
line = f"{group}:\n{items}"
|
|
312
312
|
s += line + "\n"
|
|
313
313
|
|
|
314
314
|
return s
|
|
@@ -396,14 +396,14 @@ class Hydra:
|
|
|
396
396
|
if len(plugins) > 0:
|
|
397
397
|
Hydra._log_header(header=f"{plugin_type.__name__}:", prefix="\t")
|
|
398
398
|
for plugin in plugins:
|
|
399
|
-
log.debug("\t\t{
|
|
399
|
+
log.debug(f"\t\t{plugin.__name__}")
|
|
400
400
|
if plugin.__name__ in all_plugins:
|
|
401
401
|
all_plugins.remove(plugin.__name__)
|
|
402
402
|
|
|
403
403
|
if len(all_plugins) > 0:
|
|
404
404
|
Hydra._log_header(header="Generic plugins: ", prefix="\t")
|
|
405
405
|
for plugin_name in all_plugins:
|
|
406
|
-
log.debug("\t\t{}"
|
|
406
|
+
log.debug(f"\t\t{plugin_name}")
|
|
407
407
|
|
|
408
408
|
def _print_search_path(
|
|
409
409
|
self,
|
|
@@ -494,7 +494,7 @@ def _get_completion_help() -> str:
|
|
|
494
494
|
completion_info.append(plugin_cls.help(cmd).format(_get_exec_command()))
|
|
495
495
|
completion_info.append("")
|
|
496
496
|
|
|
497
|
-
completion_help = "\n".join(
|
|
497
|
+
completion_help = "\n".join(f" {x}" if x else x for x in completion_info)
|
|
498
498
|
return completion_help
|
|
499
499
|
|
|
500
500
|
|
|
@@ -23,26 +23,21 @@ class ConfigLoader(ABC):
|
|
|
23
23
|
run_mode: RunMode,
|
|
24
24
|
from_shell: bool = True,
|
|
25
25
|
validate_sweep_overrides: bool = True,
|
|
26
|
-
) -> DictConfig:
|
|
27
|
-
...
|
|
26
|
+
) -> DictConfig: ...
|
|
28
27
|
|
|
29
28
|
@abstractmethod
|
|
30
29
|
def load_sweep_config(
|
|
31
30
|
self, master_config: DictConfig, sweep_overrides: List[str]
|
|
32
|
-
) -> DictConfig:
|
|
33
|
-
...
|
|
31
|
+
) -> DictConfig: ...
|
|
34
32
|
|
|
35
33
|
@abstractmethod
|
|
36
|
-
def get_search_path(self) -> ConfigSearchPath:
|
|
37
|
-
...
|
|
34
|
+
def get_search_path(self) -> ConfigSearchPath: ...
|
|
38
35
|
|
|
39
36
|
@abstractmethod
|
|
40
|
-
def get_sources(self) -> List[ConfigSource]:
|
|
41
|
-
...
|
|
37
|
+
def get_sources(self) -> List[ConfigSource]: ...
|
|
42
38
|
|
|
43
39
|
@abstractmethod
|
|
44
|
-
def list_groups(self, parent_name: str) -> List[str]:
|
|
45
|
-
...
|
|
40
|
+
def list_groups(self, parent_name: str) -> List[str]: ...
|
|
46
41
|
|
|
47
42
|
@abstractmethod
|
|
48
43
|
def get_group_options(
|
|
@@ -51,8 +46,7 @@ class ConfigLoader(ABC):
|
|
|
51
46
|
results_filter: Optional[ObjectType] = ObjectType.CONFIG,
|
|
52
47
|
config_name: Optional[str] = None,
|
|
53
48
|
overrides: Optional[List[str]] = None,
|
|
54
|
-
) -> List[str]:
|
|
55
|
-
...
|
|
49
|
+
) -> List[str]: ...
|
|
56
50
|
|
|
57
51
|
@abstractmethod
|
|
58
52
|
def compute_defaults_list(
|
|
@@ -60,5 +54,4 @@ class ConfigLoader(ABC):
|
|
|
60
54
|
config_name: Optional[str],
|
|
61
55
|
overrides: List[str],
|
|
62
56
|
run_mode: RunMode,
|
|
63
|
-
) -> Any:
|
|
64
|
-
...
|
|
57
|
+
) -> Any: ...
|
|
@@ -28,8 +28,7 @@ class ConfigStoreWithProvider:
|
|
|
28
28
|
group=group, name=name, node=node, package=package, provider=self.provider
|
|
29
29
|
)
|
|
30
30
|
|
|
31
|
-
def __exit__(self, exc_type: Any, exc_value: Any, exc_traceback: Any) -> Any:
|
|
32
|
-
...
|
|
31
|
+
def __exit__(self, exc_type: Any, exc_value: Any, exc_traceback: Any) -> Any: ...
|
|
33
32
|
|
|
34
33
|
|
|
35
34
|
@dataclass
|
|
@@ -133,10 +132,10 @@ class ConfigStore(metaclass=Singleton):
|
|
|
133
132
|
def list(self, path: str) -> List[str]:
|
|
134
133
|
d = self._open(path)
|
|
135
134
|
if d is None:
|
|
136
|
-
raise
|
|
135
|
+
raise OSError(f"Path not found {path}")
|
|
137
136
|
|
|
138
137
|
if not isinstance(d, dict):
|
|
139
|
-
raise
|
|
138
|
+
raise OSError(f"Path points to a file : {path}")
|
|
140
139
|
|
|
141
140
|
return sorted(d.keys())
|
|
142
141
|
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
import sys
|
|
3
3
|
from typing import Any, List, Optional
|
|
4
4
|
|
|
5
|
-
from antlr4.error.Errors import
|
|
5
|
+
from omegaconf.vendor.antlr4.error.Errors import (
|
|
6
|
+
LexerNoViableAltException,
|
|
7
|
+
RecognitionException,
|
|
8
|
+
)
|
|
6
9
|
|
|
7
10
|
from hydra._internal.grammar import grammar_functions
|
|
8
11
|
from hydra._internal.grammar.functions import Functions
|
|
@@ -3,9 +3,13 @@ import sys
|
|
|
3
3
|
import warnings
|
|
4
4
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
5
5
|
|
|
6
|
-
from antlr4 import
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
from omegaconf.vendor.antlr4 import ( # type: ignore[attr-defined]
|
|
7
|
+
ParserRuleContext,
|
|
8
|
+
TerminalNode,
|
|
9
|
+
Token,
|
|
10
|
+
)
|
|
11
|
+
from omegaconf.vendor.antlr4.error.ErrorListener import ErrorListener
|
|
12
|
+
from omegaconf.vendor.antlr4.tree.Tree import TerminalNodeImpl
|
|
9
13
|
|
|
10
14
|
from hydra._internal.grammar.functions import FunctionCall, Functions
|
|
11
15
|
from hydra._internal.grammar.utils import _ESC_QUOTED_STR
|
|
@@ -107,7 +111,8 @@ class HydraOverrideVisitor(OverrideParserVisitor):
|
|
|
107
111
|
item = next(children)
|
|
108
112
|
assert isinstance(item, OverrideParser.DictKeyContext)
|
|
109
113
|
pkey = self.visitDictKey(item)
|
|
110
|
-
|
|
114
|
+
colon = next(children)
|
|
115
|
+
assert self.is_matching_terminal(colon, OverrideLexer.COLON)
|
|
111
116
|
value = next(children)
|
|
112
117
|
assert isinstance(value, OverrideParser.ElementContext)
|
|
113
118
|
return pkey, self.visitElement(value)
|
|
@@ -161,7 +166,7 @@ class HydraOverrideVisitor(OverrideParserVisitor):
|
|
|
161
166
|
if (
|
|
162
167
|
override_type == OverrideType.DEL
|
|
163
168
|
and isinstance(eq_node, TerminalNode)
|
|
164
|
-
and eq_node.symbol.type == Token.EOF
|
|
169
|
+
and eq_node.symbol.type == Token.EOF # type: ignore[attr-defined]
|
|
165
170
|
):
|
|
166
171
|
value = None
|
|
167
172
|
value_type = None
|
|
@@ -212,7 +217,8 @@ class HydraOverrideVisitor(OverrideParserVisitor):
|
|
|
212
217
|
kwargs = {}
|
|
213
218
|
children = ctx.getChildren()
|
|
214
219
|
func_name = next(children).getText()
|
|
215
|
-
|
|
220
|
+
popen = next(children)
|
|
221
|
+
assert self.is_matching_terminal(popen, OverrideLexer.POPEN)
|
|
216
222
|
in_kwargs = False
|
|
217
223
|
while True:
|
|
218
224
|
cur = next(children)
|
|
@@ -242,26 +248,26 @@ class HydraOverrideVisitor(OverrideParserVisitor):
|
|
|
242
248
|
) from e
|
|
243
249
|
|
|
244
250
|
def _createPrimitive(
|
|
245
|
-
self, ctx: ParserRuleContext
|
|
251
|
+
self, ctx: ParserRuleContext # type: ignore[valid-type]
|
|
246
252
|
) -> Optional[Union[QuotedString, int, bool, float, str]]:
|
|
247
253
|
ret: Optional[Union[int, bool, float, str]]
|
|
248
254
|
first_idx = 0
|
|
249
|
-
last_idx = ctx.getChildCount()
|
|
255
|
+
last_idx = ctx.getChildCount() # type: ignore[attr-defined]
|
|
250
256
|
# skip first if whitespace
|
|
251
|
-
if self.is_ws(ctx.getChild(0)):
|
|
257
|
+
if self.is_ws(ctx.getChild(0)): # type: ignore[attr-defined]
|
|
252
258
|
if last_idx == 1:
|
|
253
259
|
# Only whitespaces => this is not allowed.
|
|
254
260
|
raise HydraException(
|
|
255
261
|
"Trying to parse a primitive that is all whitespaces"
|
|
256
262
|
)
|
|
257
263
|
first_idx = 1
|
|
258
|
-
if self.is_ws(ctx.getChild(-1)):
|
|
264
|
+
if self.is_ws(ctx.getChild(-1)): # type: ignore[attr-defined]
|
|
259
265
|
last_idx = last_idx - 1
|
|
260
266
|
num = last_idx - first_idx
|
|
261
267
|
if num > 1:
|
|
262
268
|
# Concatenate, while un-escaping as needed.
|
|
263
269
|
tokens = []
|
|
264
|
-
for i, n in enumerate(ctx.getChildren()):
|
|
270
|
+
for i, n in enumerate(ctx.getChildren()): # type: ignore[attr-defined]
|
|
265
271
|
if n.symbol.type == OverrideLexer.WS and (
|
|
266
272
|
i < first_idx or i >= last_idx
|
|
267
273
|
):
|
|
@@ -274,7 +280,7 @@ class HydraOverrideVisitor(OverrideParserVisitor):
|
|
|
274
280
|
)
|
|
275
281
|
ret = "".join(tokens)
|
|
276
282
|
else:
|
|
277
|
-
node = ctx.getChild(first_idx)
|
|
283
|
+
node = ctx.getChild(first_idx) # type: ignore[attr-defined]
|
|
278
284
|
if node.symbol.type == OverrideLexer.QUOTED_VALUE:
|
|
279
285
|
text = node.getText()
|
|
280
286
|
qc = text[0]
|
|
@@ -358,7 +364,7 @@ class HydraOverrideVisitor(OverrideParserVisitor):
|
|
|
358
364
|
return "".join(tokens)
|
|
359
365
|
|
|
360
366
|
|
|
361
|
-
class HydraErrorListener(ErrorListener):
|
|
367
|
+
class HydraErrorListener(ErrorListener):
|
|
362
368
|
def syntaxError(
|
|
363
369
|
self,
|
|
364
370
|
recognizer: Any,
|
|
@@ -187,13 +187,14 @@ class Plugins(metaclass=Singleton):
|
|
|
187
187
|
assert m is not None
|
|
188
188
|
loaded_mod = m.load_module(modname)
|
|
189
189
|
else:
|
|
190
|
-
spec = importer.find_spec(modname)
|
|
190
|
+
spec = importer.find_spec(modname) # type: ignore[call-arg]
|
|
191
191
|
assert spec is not None
|
|
192
192
|
if modname in sys.modules:
|
|
193
193
|
loaded_mod = sys.modules[modname]
|
|
194
194
|
else:
|
|
195
195
|
loaded_mod = importlib.util.module_from_spec(spec)
|
|
196
196
|
if loaded_mod is not None:
|
|
197
|
+
assert spec.loader is not None
|
|
197
198
|
spec.loader.exec_module(loaded_mod)
|
|
198
199
|
sys.modules[modname] = loaded_mod
|
|
199
200
|
|
|
@@ -10,7 +10,7 @@ class Singleton(type):
|
|
|
10
10
|
|
|
11
11
|
def __call__(cls, *args: Any, **kwargs: Any) -> Any:
|
|
12
12
|
if cls not in cls._instances:
|
|
13
|
-
cls._instances[cls] = super(
|
|
13
|
+
cls._instances[cls] = super().__call__(*args, **kwargs)
|
|
14
14
|
return cls._instances[cls]
|
|
15
15
|
|
|
16
16
|
def instance(cls: Any, *args: Any, **kwargs: Any) -> Any:
|
|
@@ -2,31 +2,26 @@
|
|
|
2
2
|
from typing import Optional, Sequence
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
class HydraException(Exception):
|
|
6
|
-
...
|
|
5
|
+
class HydraException(Exception): ...
|
|
7
6
|
|
|
8
7
|
|
|
9
|
-
class CompactHydraException(HydraException):
|
|
10
|
-
...
|
|
8
|
+
class CompactHydraException(HydraException): ...
|
|
11
9
|
|
|
12
10
|
|
|
13
11
|
class OverrideParseException(CompactHydraException):
|
|
14
12
|
def __init__(self, override: str, message: str) -> None:
|
|
15
|
-
super(
|
|
13
|
+
super().__init__(message)
|
|
16
14
|
self.override = override
|
|
17
15
|
self.message = message
|
|
18
16
|
|
|
19
17
|
|
|
20
|
-
class InstantiationException(CompactHydraException):
|
|
21
|
-
...
|
|
18
|
+
class InstantiationException(CompactHydraException): ...
|
|
22
19
|
|
|
23
20
|
|
|
24
|
-
class ConfigCompositionException(CompactHydraException):
|
|
25
|
-
...
|
|
21
|
+
class ConfigCompositionException(CompactHydraException): ...
|
|
26
22
|
|
|
27
23
|
|
|
28
|
-
class SearchPathException(CompactHydraException):
|
|
29
|
-
...
|
|
24
|
+
class SearchPathException(CompactHydraException): ...
|
|
30
25
|
|
|
31
26
|
|
|
32
27
|
class MissingConfigException(IOError, ConfigCompositionException):
|
|
@@ -36,10 +31,9 @@ class MissingConfigException(IOError, ConfigCompositionException):
|
|
|
36
31
|
missing_cfg_file: Optional[str] = None,
|
|
37
32
|
options: Optional[Sequence[str]] = None,
|
|
38
33
|
) -> None:
|
|
39
|
-
super(
|
|
34
|
+
super().__init__(message)
|
|
40
35
|
self.missing_cfg_file = missing_cfg_file
|
|
41
36
|
self.options = options
|
|
42
37
|
|
|
43
38
|
|
|
44
|
-
class HydraDeprecationError(HydraException):
|
|
45
|
-
...
|
|
39
|
+
class HydraDeprecationError(HydraException): ...
|
|
@@ -46,6 +46,7 @@ class initialize:
|
|
|
46
46
|
config_path=config_path,
|
|
47
47
|
job_name=job_name,
|
|
48
48
|
caller_stack_depth=caller_stack_depth + 1,
|
|
49
|
+
version_base=str(version.getbase()),
|
|
49
50
|
)
|
|
50
51
|
|
|
51
52
|
def __enter__(self, *args: Any, **kwargs: Any) -> None:
|
|
@@ -80,7 +81,9 @@ class initialize_config_module:
|
|
|
80
81
|
deprecation_warning(message=message)
|
|
81
82
|
|
|
82
83
|
self.delegate = real_initialize_config_module(
|
|
83
|
-
config_module=config_module,
|
|
84
|
+
config_module=config_module,
|
|
85
|
+
job_name=job_name,
|
|
86
|
+
version_base=str(version.getbase()),
|
|
84
87
|
)
|
|
85
88
|
|
|
86
89
|
def __enter__(self, *args: Any, **kwargs: Any) -> None:
|
|
@@ -116,7 +119,9 @@ class initialize_config_dir:
|
|
|
116
119
|
deprecation_warning(message=message)
|
|
117
120
|
|
|
118
121
|
self.delegate = real_initialize_config_dir(
|
|
119
|
-
config_dir=config_dir,
|
|
122
|
+
config_dir=config_dir,
|
|
123
|
+
job_name=job_name,
|
|
124
|
+
version_base=str(version.getbase()),
|
|
120
125
|
)
|
|
121
126
|
|
|
122
127
|
def __enter__(self, *args: Any, **kwargs: Any) -> None:
|