Repository: facebookresearch/hydra (python)

Issue:
[Bug] handle yaml file with dot in the name
# 🐛 Bug

<!-- A clear and concise description of what the bug is. -->
When creating yaml file that has dot in the base name, `config_loader.py` erroneously misses the `.yaml` extension which results in a `hydra.errors.MissingConfigException`.

## To reproduce
configuration groups:
```
├── conf
│   └── lr
│       ├── 0.1.yaml
│       └── 0.01.yaml
└── my_app.py
```
with minimum `my_app.py` setup same as in the tutorial
```
python my_app.py lr=0.1
```
Traceback:
```
Traceback (most recent call last):
  File "app.py", line 9, in <module>
    app()
  File "/home/yjxiao/miniconda3/lib/python3.7/site-packages/hydra/main.py", line 24, in decorated_main
    strict=strict,
  File "/home/yjxiao/miniconda3/lib/python3.7/site-packages/hydra/_internal/utils.py", line 56, in run_hydra
    hydra.run(overrides=args.overrides)
  File "/home/yjxiao/miniconda3/lib/python3.7/site-packages/hydra/_internal/hydra.py", line 103, in run
    cfg = self._load_config(overrides)
  File "/home/yjxiao/miniconda3/lib/python3.7/site-packages/hydra/_internal/hydra.py", line 345, in _load_config
    cfg = self.config_loader.load_configuration(overrides)
  File "/home/yjxiao/miniconda3/lib/python3.7/site-packages/hydra/_internal/config_loader.py", line 56, in load_configuration
    cfg = self._merge_defaults(hydra_cfg, defaults, split_at)
  File "/home/yjxiao/miniconda3/lib/python3.7/site-packages/hydra/_internal/config_loader.py", line 395, in _merge_defaults
    cfg = merge_defaults(cfg, user_list)
  File "/home/yjxiao/miniconda3/lib/python3.7/site-packages/hydra/_internal/config_loader.py", line 374, in merge_defaults
    required=not is_optional,
  File "/home/yjxiao/miniconda3/lib/python3.7/site-packages/hydra/_internal/config_loader.py", line 301, in _merge_config
    raise MissingConfigException(msg, new_cfg, options)
hydra.errors.MissingConfigException: Could not load lr/0.1, available options:
lr:
	0.01
	0.1
```
## Questions
- Currently, I have to edit `config_loader.py` file to add the `.yaml` extension whenever it is missing. Would this cause any unwanted behavior with other features? 
- Is it generally not advisable to name config files with, say, float values? Are there better ways to incorporate float values in the config?

Pull request:
Allow composing config files with dot in their name (foo.bar.yaml)
fixed #271 

Patch:
diff --git a/hydra/_internal/config_loader.py b/hydra/_internal/config_loader.py
index f023ef253e..68bd216be4 100644
--- a/hydra/_internal/config_loader.py
+++ b/hydra/_internal/config_loader.py
@@ -358,9 +358,9 @@ class ConfigLoader:
     def _merge_defaults(self, cfg, defaults, split_at):
         def get_filename(config_name):
             filename, ext = os.path.splitext(config_name)
-            if ext == "":
-                ext = ".yaml"
-            return "{}{}".format(filename, ext)
+            if ext not in (".yaml", ".yml"):
+                config_name = "{}{}".format(config_name, ".yaml")
+            return config_name
 
         def merge_defaults(merged_cfg, def_list):
             cfg_with_list = OmegaConf.create(dict(defaults=def_list))
diff --git a/news/271.bugfix b/news/271.bugfix
new file mode 100644
index 0000000000..b1b58d9ce3
--- /dev/null
+++ b/news/271.bugfix
@@ -0,0 +1,1 @@
+Allow composing config files with dot in their name (foo.bar.yaml)
diff --git a/setup.py b/setup.py
index fa9b09bc38..fb0dec15f1 100644
--- a/setup.py
+++ b/setup.py
@@ -104,7 +104,7 @@ with open("README.md", "r") as fh:
             "Operating System :: Microsoft :: Windows",
         ],
         install_requires=[
-            "omegaconf>=1.4.0rc1",
+            "omegaconf>=1.4.0rc2",
             'pathlib2>=2.2.0;python_version<"3.0"',
         ],
         # Install development dependencies with


Test patch:
diff --git a/hydra/test_utils/configs/group1/abc.cde.yaml b/hydra/test_utils/configs/group1/abc.cde.yaml
new file mode 100644
index 0000000000..52b41c4db7
--- /dev/null
+++ b/hydra/test_utils/configs/group1/abc.cde.yaml
@@ -0,0 +1,1 @@
+abc=cde
\ No newline at end of file
diff --git a/tests/test_conf_loader.py b/tests/test_conf_loader.py
index 7e34c599a1..fc73d336e0 100644
--- a/tests/test_conf_loader.py
+++ b/tests/test_conf_loader.py
@@ -175,6 +175,16 @@ class TestConfigLoader:
         del cfg["hydra"]
         assert cfg == OmegaConf.create({"normal_yaml_config": True, "abc": "cde=12"})
 
+    def test_compose_file_with_dot(self, path):
+        config_loader = ConfigLoader(
+            config_search_path=create_search_path([path]),
+            strict_cfg=False,
+            config_file="compose.yaml",
+        )
+        cfg = config_loader.load_configuration(["group1=abc.cde"])
+        del cfg["hydra"]
+        assert cfg == {"abc=cde": None, "bar": 100}
+
 
 @pytest.mark.parametrize(
     "primary,merged,result",