From 2acc29cf1c25be7078ebeaf70e9d45f8048198da Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Mon, 4 Jan 2016 15:35:57 -0500 Subject: [PATCH] Remove support for fig.yaml, FIG_FILE, and FIG_PROJECT_NAME. Signed-off-by: Daniel Nephin --- compose/cli/command.py | 15 ++------------- compose/config/config.py | 6 ------ contrib/completion/bash/docker-compose | 2 +- contrib/completion/zsh/_docker-compose | 2 +- tests/unit/cli_test.py | 7 ------- tests/unit/config/config_test.py | 2 -- 6 files changed, 4 insertions(+), 30 deletions(-) diff --git a/compose/cli/command.py b/compose/cli/command.py index 59f6c4bc9..21d6ff0dd 100644 --- a/compose/cli/command.py +++ b/compose/cli/command.py @@ -59,11 +59,7 @@ def get_config_path_from_options(options): if file_option: return file_option - if 'FIG_FILE' in os.environ: - log.warn('The FIG_FILE environment variable is deprecated.') - log.warn('Please use COMPOSE_FILE instead.') - - config_file = os.environ.get('COMPOSE_FILE') or os.environ.get('FIG_FILE') + config_file = os.environ.get('COMPOSE_FILE') return [config_file] if config_file else None @@ -96,14 +92,7 @@ def get_project_name(working_dir, project_name=None): def normalize_name(name): return re.sub(r'[^a-z0-9]', '', name.lower()) - if 'FIG_PROJECT_NAME' in os.environ: - log.warn('The FIG_PROJECT_NAME environment variable is deprecated.') - log.warn('Please use COMPOSE_PROJECT_NAME instead.') - - project_name = ( - project_name or - os.environ.get('COMPOSE_PROJECT_NAME') or - os.environ.get('FIG_PROJECT_NAME')) + project_name = project_name or os.environ.get('COMPOSE_PROJECT_NAME') if project_name is not None: return normalize_name(project_name) diff --git a/compose/config/config.py b/compose/config/config.py index 0c6448331..195665b51 100644 --- a/compose/config/config.py +++ b/compose/config/config.py @@ -88,8 +88,6 @@ DOCKER_VALID_URL_PREFIXES = ( SUPPORTED_FILENAMES = [ 'docker-compose.yml', 'docker-compose.yaml', - 'fig.yml', - 'fig.yaml', ] DEFAULT_OVERRIDE_FILENAME = 'docker-compose.override.yml' @@ -162,10 +160,6 @@ def get_default_config_files(base_dir): log.warn("Found multiple config files with supported names: %s", ", ".join(candidates)) log.warn("Using %s\n", winner) - if winner.startswith("fig."): - log.warn("%s is deprecated and will not be supported in future. " - "Please rename your config file to docker-compose.yml\n" % winner) - return [os.path.join(path, winner)] + get_default_override_file(path) diff --git a/contrib/completion/bash/docker-compose b/contrib/completion/bash/docker-compose index 497a81848..c18e4f6df 100644 --- a/contrib/completion/bash/docker-compose +++ b/contrib/completion/bash/docker-compose @@ -28,7 +28,7 @@ __docker_compose_nospace() { # Support for these filenames might be dropped in some future version. __docker_compose_compose_file() { local file - for file in docker-compose.y{,a}ml fig.y{,a}ml ; do + for file in docker-compose.y{,a}ml ; do [ -e $file ] && { echo $file return diff --git a/contrib/completion/zsh/_docker-compose b/contrib/completion/zsh/_docker-compose index 67ca49bbb..35c2b996f 100644 --- a/contrib/completion/zsh/_docker-compose +++ b/contrib/completion/zsh/_docker-compose @@ -24,7 +24,7 @@ # Support for these filenames might be dropped in some future version. __docker-compose_compose_file() { local file - for file in docker-compose.y{,a}ml fig.y{,a}ml ; do + for file in docker-compose.y{,a}ml ; do [ -e $file ] && { echo $file return diff --git a/tests/unit/cli_test.py b/tests/unit/cli_test.py index 61cef6f6a..a57670976 100644 --- a/tests/unit/cli_test.py +++ b/tests/unit/cli_test.py @@ -42,13 +42,6 @@ class CLITestCase(unittest.TestCase): project_name = get_project_name(None, project_name=name) self.assertEquals('explicitprojectname', project_name) - def test_project_name_from_environment_old_var(self): - name = 'namefromenv' - with mock.patch.dict(os.environ): - os.environ['FIG_PROJECT_NAME'] = name - project_name = get_project_name(None) - self.assertEquals(project_name, name) - def test_project_name_from_environment_new_var(self): name = 'namefromenv' with mock.patch.dict(os.environ): diff --git a/tests/unit/config/config_test.py b/tests/unit/config/config_test.py index 2185b7920..e975cb9d8 100644 --- a/tests/unit/config/config_test.py +++ b/tests/unit/config/config_test.py @@ -1616,8 +1616,6 @@ class GetDefaultConfigFilesTestCase(unittest.TestCase): files = [ 'docker-compose.yml', 'docker-compose.yaml', - 'fig.yml', - 'fig.yaml', ] def test_get_config_path_default_file_in_basedir(self):