diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e447294eb7a..a2aeb014a00 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,9 +17,6 @@ sha: v1.3.4 hooks: - id: reorder-python-imports - language_version: 'python2.7' + language_version: 'python3.7' args: - - --add-import - - from __future__ import absolute_import - - --add-import - - from __future__ import unicode_literals + - --py3-plus diff --git a/Dockerfile b/Dockerfile index 1f7608e24ae..9439d0e4f0c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,8 +24,6 @@ RUN apk add --no-cache \ musl-dev \ openssl \ openssl-dev \ - python2 \ - python2-dev \ zlib-dev ENV BUILD_BOOTLOADER=1 @@ -40,7 +38,6 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ libssl-dev \ make \ openssl \ - python2.7-dev \ zlib1g-dev FROM build-${BUILD_PLATFORM} AS build diff --git a/bin/docker-compose b/bin/docker-compose index aeb53870303..5976e1d4aa5 100755 --- a/bin/docker-compose +++ b/bin/docker-compose @@ -1,6 +1,3 @@ #!/usr/bin/env python -from __future__ import absolute_import -from __future__ import unicode_literals - from compose.cli.main import main main() diff --git a/compose/__init__.py b/compose/__init__.py index 69c4e0e49d8..32f0afd92ec 100644 --- a/compose/__init__.py +++ b/compose/__init__.py @@ -1,4 +1,2 @@ -from __future__ import absolute_import -from __future__ import unicode_literals __version__ = '1.26.0dev' diff --git a/compose/__main__.py b/compose/__main__.py index 27a7acbb8d1..199ba2ae9b4 100644 --- a/compose/__main__.py +++ b/compose/__main__.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - from compose.cli.main import main main() diff --git a/compose/cli/colors.py b/compose/cli/colors.py index ea45198e07d..c6a869bf59d 100644 --- a/compose/cli/colors.py +++ b/compose/cli/colors.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - from ..const import IS_WINDOWS_PLATFORM NAMES = [ diff --git a/compose/cli/command.py b/compose/cli/command.py index 7621134e8f7..6c88e58192c 100644 --- a/compose/cli/command.py +++ b/compose/cli/command.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import logging import os import re diff --git a/compose/cli/docker_client.py b/compose/cli/docker_client.py index d4cdc96e8f5..3abeb5cdc3f 100644 --- a/compose/cli/docker_client.py +++ b/compose/cli/docker_client.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import logging import os.path import ssl diff --git a/compose/cli/docopt_command.py b/compose/cli/docopt_command.py index 809a4b7455e..856c9234818 100644 --- a/compose/cli/docopt_command.py +++ b/compose/cli/docopt_command.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - from inspect import getdoc from docopt import docopt diff --git a/compose/cli/errors.py b/compose/cli/errors.py index 189b67faf67..d1a47f07833 100644 --- a/compose/cli/errors.py +++ b/compose/cli/errors.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import contextlib import logging import socket diff --git a/compose/cli/formatter.py b/compose/cli/formatter.py index 9651fb4da44..4dabe77c29e 100644 --- a/compose/cli/formatter.py +++ b/compose/cli/formatter.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import logging import shutil diff --git a/compose/cli/log_printer.py b/compose/cli/log_printer.py index a4b70a67205..fd193000f5c 100644 --- a/compose/cli/log_printer.py +++ b/compose/cli/log_printer.py @@ -1,15 +1,12 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - +import _thread as thread import sys from collections import namedtuple from itertools import cycle +from queue import Empty +from queue import Queue from threading import Thread from docker.errors import APIError -from six.moves import _thread as thread -from six.moves.queue import Empty -from six.moves.queue import Queue from . import colors from compose import utils diff --git a/compose/cli/main.py b/compose/cli/main.py index 250d06c90cf..714592a3236 100644 --- a/compose/cli/main.py +++ b/compose/cli/main.py @@ -1,7 +1,3 @@ -from __future__ import absolute_import -from __future__ import print_function -from __future__ import unicode_literals - import contextlib import functools import json diff --git a/compose/cli/signals.py b/compose/cli/signals.py index 44def2ece65..0244e70189a 100644 --- a/compose/cli/signals.py +++ b/compose/cli/signals.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import signal from ..const import IS_WINDOWS_PLATFORM diff --git a/compose/cli/utils.py b/compose/cli/utils.py index 40bef165202..65ba74dbba5 100644 --- a/compose/cli/utils.py +++ b/compose/cli/utils.py @@ -1,7 +1,3 @@ -from __future__ import absolute_import -from __future__ import division -from __future__ import unicode_literals - import math import os import platform diff --git a/compose/cli/verbose_proxy.py b/compose/cli/verbose_proxy.py index b1592eabe73..68dfabe521c 100644 --- a/compose/cli/verbose_proxy.py +++ b/compose/cli/verbose_proxy.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import functools import logging import pprint diff --git a/compose/config/__init__.py b/compose/config/__init__.py index 2b40666f149..855b2401d94 100644 --- a/compose/config/__init__.py +++ b/compose/config/__init__.py @@ -1,7 +1,4 @@ # flake8: noqa -from __future__ import absolute_import -from __future__ import unicode_literals - from . import environment from .config import ConfigurationError from .config import DOCKER_CONFIG_KEYS diff --git a/compose/config/config.py b/compose/config/config.py index 444a40325ea..52863b13c77 100644 --- a/compose/config/config.py +++ b/compose/config/config.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import functools import io import logging diff --git a/compose/config/environment.py b/compose/config/environment.py index d8810ebb61b..abcafe0ce09 100644 --- a/compose/config/environment.py +++ b/compose/config/environment.py @@ -1,6 +1,5 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - +import codecs +import contextlib import logging import os import re diff --git a/compose/config/errors.py b/compose/config/errors.py index 9b2078f2c6d..7db079e9c78 100644 --- a/compose/config/errors.py +++ b/compose/config/errors.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals VERSION_EXPLANATION = ( diff --git a/compose/config/interpolation.py b/compose/config/interpolation.py index 18be8562cbb..f202e911447 100644 --- a/compose/config/interpolation.py +++ b/compose/config/interpolation.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import logging import re from string import Template diff --git a/compose/config/serialize.py b/compose/config/serialize.py index 5776ce957cb..79b5777cb46 100644 --- a/compose/config/serialize.py +++ b/compose/config/serialize.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import six import yaml diff --git a/compose/config/sort_services.py b/compose/config/sort_services.py index 42f548a6dd1..a600139b2ac 100644 --- a/compose/config/sort_services.py +++ b/compose/config/sort_services.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - from compose.config.errors import DependencyError diff --git a/compose/config/types.py b/compose/config/types.py index ab8f34e3d7f..4a7a25b2bce 100644 --- a/compose/config/types.py +++ b/compose/config/types.py @@ -1,9 +1,6 @@ """ Types for objects parsed from the configuration. """ -from __future__ import absolute_import -from __future__ import unicode_literals - import json import ntpath import os diff --git a/compose/config/validation.py b/compose/config/validation.py index 1cceb71f0a4..f8513bdef58 100644 --- a/compose/config/validation.py +++ b/compose/config/validation.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import json import logging import os diff --git a/compose/const.py b/compose/const.py index 3d9030520b0..d80e23c9ef8 100644 --- a/compose/const.py +++ b/compose/const.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import sys from .version import ComposeVersion diff --git a/compose/container.py b/compose/container.py index 8a2fb240e0d..37de4e6f625 100644 --- a/compose/container.py +++ b/compose/container.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - from functools import reduce import six diff --git a/compose/errors.py b/compose/errors.py index 415b41e7f04..53065617360 100644 --- a/compose/errors.py +++ b/compose/errors.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals class OperationFailedError(Exception): diff --git a/compose/network.py b/compose/network.py index 84531ecc7b8..bc3ade16870 100644 --- a/compose/network.py +++ b/compose/network.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import logging import re from collections import OrderedDict diff --git a/compose/parallel.py b/compose/parallel.py index e242a318ae7..6ef9ceedd35 100644 --- a/compose/parallel.py +++ b/compose/parallel.py @@ -1,18 +1,15 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - +import _thread as thread import logging import operator import sys +from queue import Empty +from queue import Queue from threading import Lock from threading import Semaphore from threading import Thread from docker.errors import APIError from docker.errors import ImageNotFound -from six.moves import _thread as thread -from six.moves.queue import Empty -from six.moves.queue import Queue from compose.cli.colors import green from compose.cli.colors import red diff --git a/compose/progress_stream.py b/compose/progress_stream.py index 522ddf75d19..0ae0dc3161f 100644 --- a/compose/progress_stream.py +++ b/compose/progress_stream.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - from compose import utils diff --git a/compose/project.py b/compose/project.py index 696c8b04023..90a6f5cd53c 100644 --- a/compose/project.py +++ b/compose/project.py @@ -1,14 +1,11 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import datetime +import enum import logging import operator import re from functools import reduce from os import path -import enum import six from docker.errors import APIError from docker.errors import ImageNotFound diff --git a/compose/service.py b/compose/service.py index 95a87d210d2..18173cf7058 100644 --- a/compose/service.py +++ b/compose/service.py @@ -1,6 +1,4 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - +import enum import itertools import json import logging @@ -12,7 +10,6 @@ from collections import OrderedDict from operator import attrgetter -import enum import six from docker.errors import APIError from docker.errors import ImageNotFound diff --git a/compose/timeparse.py b/compose/timeparse.py index 16ef8a6dc91..bdd9f611f3a 100644 --- a/compose/timeparse.py +++ b/compose/timeparse.py @@ -31,9 +31,6 @@ # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -from __future__ import absolute_import -from __future__ import unicode_literals - import re HOURS = r'(?P[\d.]+)h' diff --git a/compose/utils.py b/compose/utils.py index a1e5e6435d8..4ea163c42c3 100644 --- a/compose/utils.py +++ b/compose/utils.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import codecs import hashlib import json.decoder diff --git a/compose/version.py b/compose/version.py index 0532e16c717..c039263acb9 100644 --- a/compose/version.py +++ b/compose/version.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - from distutils.version import LooseVersion diff --git a/compose/volume.py b/compose/volume.py index b02fc5d8030..d31417a550d 100644 --- a/compose/volume.py +++ b/compose/volume.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import logging import re diff --git a/contrib/migration/migrate-compose-file-v1-to-v2.py b/contrib/migration/migrate-compose-file-v1-to-v2.py index 274b499b9d4..e217b7072c3 100755 --- a/contrib/migration/migrate-compose-file-v1-to-v2.py +++ b/contrib/migration/migrate-compose-file-v1-to-v2.py @@ -3,9 +3,6 @@ Migrate a Compose file from the V1 format in Compose 1.5 to the V2 format supported by Compose 1.6+ """ -from __future__ import absolute_import -from __future__ import unicode_literals - import argparse import logging import sys diff --git a/requirements.txt b/requirements.txt index f02e15eac3b..4dea71c14fa 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,4 @@ backports.shutil_get_terminal_size==1.0.0 -backports.ssl-match-hostname==3.5.0.1; python_version < '3' cached-property==1.5.1 certifi==2020.4.5.1 chardet==3.0.4 diff --git a/script/release/release.py b/script/release/release.py deleted file mode 100755 index f53d1f3c181..00000000000 --- a/script/release/release.py +++ /dev/null @@ -1,126 +0,0 @@ -#!/usr/bin/env python3 -from __future__ import absolute_import -from __future__ import unicode_literals - -import re - -import click -from git import Repo -from utils import update_init_py_version -from utils import update_run_sh_version -from utils import yesno - -VALID_VERSION_PATTERN = re.compile(r"^\d+\.\d+\.\d+(-rc\d+)?$") - - -class Version(str): - def matching_groups(self): - match = VALID_VERSION_PATTERN.match(self) - if not match: - return False - - return match.groups() - - def is_ga_version(self): - groups = self.matching_groups() - if not groups: - return False - - rc_suffix = groups[1] - return not rc_suffix - - def validate(self): - return len(self.matching_groups()) > 0 - - def branch_name(self): - if not self.validate(): - return None - - rc_part = self.matching_groups()[0] - ver = self - if rc_part: - ver = ver[:-len(rc_part)] - - tokens = ver.split(".") - tokens[-1] = 'x' - - return ".".join(tokens) - - -def create_bump_commit(repository, version): - print('Creating bump commit...') - repository.commit('-a', '-s', '-m "Bump {}"'.format(version), '--no-verify') - - -def validate_environment(version, repository): - if not version.validate(): - print('Version "{}" has an invalid format. This should follow D+.D+.D+(-rcD+). ' - 'Like: 1.26.0 or 1.26.0-rc1'.format(version)) - return False - - expected_branch = version.branch_name() - if str(repository.active_branch) != expected_branch: - print('Cannot tag in this branch with version "{}". ' - 'Please checkout "{}" to tag'.format(version, version.branch_name())) - return False - return True - - -@click.group() -def cli(): - pass - - -@cli.command() -@click.argument('version') -def tag(version): - """ - Updates the version related files and tag - """ - repo = Repo(".") - version = Version(version) - if not validate_environment(version, repo): - return - - update_init_py_version(version) - update_run_sh_version(version) - - input('Please add the release notes to the CHANGELOG.md file, then press Enter to continue.') - proceed = False - while not proceed: - print(repo.git.diff()) - proceed = yesno('Are these changes ok? y/N ', default=False) - - if repo.git.diff(): - create_bump_commit(repo.git, version) - else: - print('No changes to commit. Exiting...') - return - - repo.create_tag(version) - - print('Please, check the changes. If everything is OK, you just need to push with:\n' - '$ git push --tags upstream {}'.format(version.branch_name())) - - -@cli.command() -@click.argument('version') -def push_latest(version): - """ - TODO Pushes the latest tag pointing to a certain GA version - """ - raise NotImplementedError - - -@cli.command() -@click.argument('version') -def ghtemplate(version): - """ - TODO Generates the github release page content - """ - version = Version(version) - raise NotImplementedError - - -if __name__ == '__main__': - cli() diff --git a/script/release/utils.py b/script/release/utils.py index 4f57704872b..25b39ca7497 100644 --- a/script/release/utils.py +++ b/script/release/utils.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import os import re diff --git a/script/test/all b/script/test/all index f929a57eecc..57b76d5a988 100755 --- a/script/test/all +++ b/script/test/all @@ -11,7 +11,7 @@ docker run --rm \ "$TAG" tox -e pre-commit get_versions="docker run --rm - --entrypoint=/code/.tox/py27/bin/python + --entrypoint=/code/.tox/py37/bin/python $TAG /code/script/test/versions.py docker/docker-ce,moby/moby" @@ -23,7 +23,7 @@ fi BUILD_NUMBER=${BUILD_NUMBER-$USER} -PY_TEST_VERSIONS=${PY_TEST_VERSIONS:-py27,py37} +PY_TEST_VERSIONS=${PY_TEST_VERSIONS:-py37} for version in $DOCKER_VERSIONS; do >&2 echo "Running tests against Docker $version" diff --git a/script/test/versions.py b/script/test/versions.py index a06c49f20b0..1a28dc19ad3 100755 --- a/script/test/versions.py +++ b/script/test/versions.py @@ -21,10 +21,6 @@ `default` would return `1.7.1` and `recent -n 3` would return `1.8.0-rc2 1.7.1 1.6.2` """ -from __future__ import absolute_import -from __future__ import print_function -from __future__ import unicode_literals - import argparse import itertools import operator diff --git a/setup.py b/setup.py index efc144b7fb9..dad44d72e43 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,5 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from __future__ import absolute_import -from __future__ import print_function -from __future__ import unicode_literals - import codecs import os import re @@ -108,8 +104,6 @@ def find_version(*file_paths): 'Environment :: Console', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.6', diff --git a/tests/__init__.py b/tests/__init__.py index 1ac1b21cf74..d3cfb864913 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import sys if sys.version_info >= (2, 7): diff --git a/tests/acceptance/cli_test.py b/tests/acceptance/cli_test.py index 9f5853143d4..868e1e227a6 100644 --- a/tests/acceptance/cli_test.py +++ b/tests/acceptance/cli_test.py @@ -1,7 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import absolute_import -from __future__ import unicode_literals - import datetime import json import os.path diff --git a/tests/helpers.py b/tests/helpers.py index 1365c5bcfb3..2ecb045236f 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -1,7 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - -import contextlib import os from compose.config.config import ConfigDetails diff --git a/tests/integration/environment_test.py b/tests/integration/environment_test.py index 671e65318a6..43df2c52b03 100644 --- a/tests/integration/environment_test.py +++ b/tests/integration/environment_test.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import tempfile from ddt import data diff --git a/tests/integration/network_test.py b/tests/integration/network_test.py index a2493fda1a2..23c9e9a4bda 100644 --- a/tests/integration/network_test.py +++ b/tests/integration/network_test.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import pytest from .testcases import DockerClientTestCase diff --git a/tests/integration/project_test.py b/tests/integration/project_test.py index cb620a8c972..19d27185c9b 100644 --- a/tests/integration/project_test.py +++ b/tests/integration/project_test.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import copy import json import os diff --git a/tests/integration/resilience_test.py b/tests/integration/resilience_test.py index 3de16e977b8..81cb2382fe2 100644 --- a/tests/integration/resilience_test.py +++ b/tests/integration/resilience_test.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import pytest from .. import mock diff --git a/tests/integration/service_test.py b/tests/integration/service_test.py index 01e2e1d22c4..e83b8af07d2 100644 --- a/tests/integration/service_test.py +++ b/tests/integration/service_test.py @@ -1,17 +1,14 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import os import re import shutil import tempfile from distutils.spawn import find_executable +from io import StringIO from os import path import pytest from docker.errors import APIError from docker.errors import ImageNotFound -from six import StringIO from six import text_type from .. import mock diff --git a/tests/integration/state_test.py b/tests/integration/state_test.py index 492de7b8ab1..611d0cc9408 100644 --- a/tests/integration/state_test.py +++ b/tests/integration/state_test.py @@ -2,9 +2,6 @@ Integration tests which cover state convergence (aka smart recreate) performed by `docker-compose up`. """ -from __future__ import absolute_import -from __future__ import unicode_literals - import copy import os import shutil diff --git a/tests/integration/testcases.py b/tests/integration/testcases.py index fe70d1f7246..f787923adde 100644 --- a/tests/integration/testcases.py +++ b/tests/integration/testcases.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import functools import os diff --git a/tests/integration/volume_test.py b/tests/integration/volume_test.py index 2a521d4c5b1..1e02647fb7e 100644 --- a/tests/integration/volume_test.py +++ b/tests/integration/volume_test.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import six from docker.errors import DockerException diff --git a/tests/unit/cli/command_test.py b/tests/unit/cli/command_test.py index 3a9844c4f7c..e2a89951702 100644 --- a/tests/unit/cli/command_test.py +++ b/tests/unit/cli/command_test.py @@ -1,7 +1,4 @@ # ~*~ encoding: utf-8 ~*~ -from __future__ import absolute_import -from __future__ import unicode_literals - import os import pytest diff --git a/tests/unit/cli/docker_client_test.py b/tests/unit/cli/docker_client_test.py index 772c136eefd..873c1ff3d82 100644 --- a/tests/unit/cli/docker_client_test.py +++ b/tests/unit/cli/docker_client_test.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import os import platform import ssl diff --git a/tests/unit/cli/errors_test.py b/tests/unit/cli/errors_test.py index 7b53ed2b15f..cb5f59df19b 100644 --- a/tests/unit/cli/errors_test.py +++ b/tests/unit/cli/errors_test.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import pytest from docker.errors import APIError from requests.exceptions import ConnectionError diff --git a/tests/unit/cli/formatter_test.py b/tests/unit/cli/formatter_test.py index e685725112f..07f5a8f50c5 100644 --- a/tests/unit/cli/formatter_test.py +++ b/tests/unit/cli/formatter_test.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import logging from compose.cli import colors diff --git a/tests/unit/cli/log_printer_test.py b/tests/unit/cli/log_printer_test.py index 5e387241d67..da0abb99f00 100644 --- a/tests/unit/cli/log_printer_test.py +++ b/tests/unit/cli/log_printer_test.py @@ -1,13 +1,10 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import itertools +from queue import Queue import pytest import requests import six from docker.errors import APIError -from six.moves.queue import Queue from compose.cli.log_printer import build_log_generator from compose.cli.log_printer import build_log_presenters diff --git a/tests/unit/cli/main_test.py b/tests/unit/cli/main_test.py index 067c74f0b0e..ac3df2920a7 100644 --- a/tests/unit/cli/main_test.py +++ b/tests/unit/cli/main_test.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import logging import docker diff --git a/tests/unit/cli/utils_test.py b/tests/unit/cli/utils_test.py index 7a762890370..d67c8ba8aff 100644 --- a/tests/unit/cli/utils_test.py +++ b/tests/unit/cli/utils_test.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import unittest from compose.cli.utils import human_readable_file_size diff --git a/tests/unit/cli/verbose_proxy_test.py b/tests/unit/cli/verbose_proxy_test.py index f111f8cdbf2..1da1676eb3c 100644 --- a/tests/unit/cli/verbose_proxy_test.py +++ b/tests/unit/cli/verbose_proxy_test.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import six from compose.cli import verbose_proxy diff --git a/tests/unit/cli_test.py b/tests/unit/cli_test.py index a7522f939b9..c6891bc3412 100644 --- a/tests/unit/cli_test.py +++ b/tests/unit/cli_test.py @@ -1,7 +1,4 @@ # encoding: utf-8 -from __future__ import absolute_import -from __future__ import unicode_literals - import os import shutil import tempfile diff --git a/tests/unit/config/config_test.py b/tests/unit/config/config_test.py index 4f09c59a63b..1f9a168c0a9 100644 --- a/tests/unit/config/config_test.py +++ b/tests/unit/config/config_test.py @@ -1,8 +1,4 @@ # encoding: utf-8 -from __future__ import absolute_import -from __future__ import print_function -from __future__ import unicode_literals - import codecs import os import shutil diff --git a/tests/unit/config/environment_test.py b/tests/unit/config/environment_test.py index 7e394d248f5..50738546899 100644 --- a/tests/unit/config/environment_test.py +++ b/tests/unit/config/environment_test.py @@ -1,8 +1,4 @@ # encoding: utf-8 -from __future__ import absolute_import -from __future__ import print_function -from __future__ import unicode_literals - import codecs import os import shutil diff --git a/tests/unit/config/interpolation_test.py b/tests/unit/config/interpolation_test.py index 91fc3e69db5..4efcf865a60 100644 --- a/tests/unit/config/interpolation_test.py +++ b/tests/unit/config/interpolation_test.py @@ -1,7 +1,4 @@ # encoding: utf-8 -from __future__ import absolute_import -from __future__ import unicode_literals - import pytest from compose.config.environment import Environment diff --git a/tests/unit/config/sort_services_test.py b/tests/unit/config/sort_services_test.py index c39ac022562..430fed6a620 100644 --- a/tests/unit/config/sort_services_test.py +++ b/tests/unit/config/sort_services_test.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import pytest from compose.config.errors import DependencyError diff --git a/tests/unit/config/types_test.py b/tests/unit/config/types_test.py index e7cc67b0422..c0991b9dc14 100644 --- a/tests/unit/config/types_test.py +++ b/tests/unit/config/types_test.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import pytest from compose.config.errors import ConfigurationError diff --git a/tests/unit/container_test.py b/tests/unit/container_test.py index 626b466d4b3..452475209c5 100644 --- a/tests/unit/container_test.py +++ b/tests/unit/container_test.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import docker from .. import mock diff --git a/tests/unit/network_test.py b/tests/unit/network_test.py index b829de196be..ab7ad59cfbd 100644 --- a/tests/unit/network_test.py +++ b/tests/unit/network_test.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import pytest from .. import mock diff --git a/tests/unit/parallel_test.py b/tests/unit/parallel_test.py index 0735bfccb48..e4c98b5d68a 100644 --- a/tests/unit/parallel_test.py +++ b/tests/unit/parallel_test.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import unittest from threading import Lock diff --git a/tests/unit/progress_stream_test.py b/tests/unit/progress_stream_test.py index 6fdb7d92788..b885b239b92 100644 --- a/tests/unit/progress_stream_test.py +++ b/tests/unit/progress_stream_test.py @@ -1,14 +1,10 @@ # ~*~ encoding: utf-8 ~*~ -from __future__ import absolute_import -from __future__ import unicode_literals - import io import os import random import shutil import tempfile - -from six import StringIO +from io import StringIO from compose import progress_stream from tests import unittest diff --git a/tests/unit/project_test.py b/tests/unit/project_test.py index 6391fac863d..1ad49c1aae5 100644 --- a/tests/unit/project_test.py +++ b/tests/unit/project_test.py @@ -1,7 +1,4 @@ # encoding: utf-8 -from __future__ import absolute_import -from __future__ import unicode_literals - import datetime import os import tempfile diff --git a/tests/unit/service_test.py b/tests/unit/service_test.py index 592e22f759f..d4e7f3c5d94 100644 --- a/tests/unit/service_test.py +++ b/tests/unit/service_test.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import docker import pytest from docker.constants import DEFAULT_DOCKER_API_VERSION diff --git a/tests/unit/split_buffer_test.py b/tests/unit/split_buffer_test.py index dedd4ee36bb..f1974c83144 100644 --- a/tests/unit/split_buffer_test.py +++ b/tests/unit/split_buffer_test.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - from .. import unittest from compose.utils import split_buffer diff --git a/tests/unit/timeparse_test.py b/tests/unit/timeparse_test.py index 9915932c300..e56595f1893 100644 --- a/tests/unit/timeparse_test.py +++ b/tests/unit/timeparse_test.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - from compose import timeparse diff --git a/tests/unit/utils_test.py b/tests/unit/utils_test.py index 21b88d962c1..f1febc13e69 100644 --- a/tests/unit/utils_test.py +++ b/tests/unit/utils_test.py @@ -1,7 +1,4 @@ # encoding: utf-8 -from __future__ import absolute_import -from __future__ import unicode_literals - from compose import utils diff --git a/tests/unit/volume_test.py b/tests/unit/volume_test.py index 457d8558174..8b2f6cfeef8 100644 --- a/tests/unit/volume_test.py +++ b/tests/unit/volume_test.py @@ -1,6 +1,3 @@ -from __future__ import absolute_import -from __future__ import unicode_literals - import docker import pytest diff --git a/tox.ini b/tox.ini index 5f57cfb1182..c7cde59ef73 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27,py37,pre-commit +envlist = py37,pre-commit [testenv] usedevelop=True