diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e447294eb..a2aeb014a 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 1f7608e24..9439d0e4f 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 aeb538703..5976e1d4a 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 69c4e0e49..32f0afd92 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 27a7acbb8..199ba2ae9 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 ea45198e0..c6a869bf5 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 7621134e8..6c88e5819 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 d4cdc96e8..3abeb5cdc 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 809a4b745..856c92348 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 189b67faf..d1a47f078 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 9651fb4da..4dabe77c2 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 a4b70a672..fd193000f 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 250d06c90..714592a32 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 44def2ece..0244e7018 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 40bef1652..65ba74dbb 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 b1592eabe..68dfabe52 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 2b40666f1..855b2401d 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 444a40325..52863b13c 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 d8810ebb6..abcafe0ce 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 9b2078f2c..7db079e9c 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 18be8562c..f202e9114 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 5776ce957..79b5777cb 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 42f548a6d..a600139b2 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 ab8f34e3d..4a7a25b2b 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 1cceb71f0..f8513bdef 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 3d9030520..d80e23c9e 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 8a2fb240e..37de4e6f6 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 415b41e7f..530656173 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 84531ecc7..bc3ade168 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 e242a318a..6ef9ceedd 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 522ddf75d..0ae0dc316 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 696c8b040..90a6f5cd5 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 95a87d210..18173cf70 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 namedtuple 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 16ef8a6dc..bdd9f611f 100644 --- a/compose/timeparse.py +++ b/compose/timeparse.py @@ -31,9 +31,6 @@ https://golang.org/pkg/time/#ParseDuration # 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 a1e5e6435..4ea163c42 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 0532e16c7..c039263ac 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 b02fc5d80..d31417a55 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 274b499b9..e217b7072 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 f02e15eac..4dea71c14 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 f53d1f3c1..000000000 --- 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 4f5770487..25b39ca74 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 f929a57ee..57b76d5a9 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 a06c49f20..1a28dc19a 100755 --- a/script/test/versions.py +++ b/script/test/versions.py @@ -21,10 +21,6 @@ For example, if the list of versions is: `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 efc144b7f..dad44d72e 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 @@ setup( '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 1ac1b21cf..d3cfb8649 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 9f5853143..868e1e227 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 1365c5bcf..2ecb04523 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 671e65318..43df2c52b 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 a2493fda1..23c9e9a4b 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 cb620a8c9..19d27185c 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 3de16e977..81cb2382f 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 01e2e1d22..e83b8af07 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 492de7b8a..611d0cc94 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 fe70d1f72..f787923ad 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 2a521d4c5..1e02647fb 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 3a9844c4f..e2a899517 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 772c136ee..873c1ff3d 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 7b53ed2b1..cb5f59df1 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 e68572511..07f5a8f50 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 5e387241d..da0abb99f 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 067c74f0b..ac3df2920 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 7a7628903..d67c8ba8a 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 f111f8cdb..1da1676eb 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 a7522f939..c6891bc34 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 4f09c59a6..1f9a168c0 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 7e394d248..507385468 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 91fc3e69d..4efcf865a 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 c39ac0225..430fed6a6 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 e7cc67b04..c0991b9dc 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 626b466d4..452475209 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 b829de196..ab7ad59cf 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 0735bfccb..e4c98b5d6 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 6fdb7d927..b885b239b 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 6391fac86..1ad49c1aa 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 592e22f75..d4e7f3c5d 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 dedd4ee36..f1974c831 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 9915932c3..e56595f18 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 21b88d962..f1febc13e 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 457d85581..8b2f6cfee 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 5f57cfb11..c7cde59ef 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27,py37,pre-commit +envlist = py37,pre-commit [testenv] usedevelop=True