Skip to content

Commit

Permalink
Removed Python2 support
Browse files Browse the repository at this point in the history
Closes: docker#6890

Signed-off-by: Bastian Venthur <[email protected]>
  • Loading branch information
venthur committed Jun 3, 2020
1 parent eab3aab commit e8424d5
Show file tree
Hide file tree
Showing 80 changed files with 18 additions and 378 deletions.
7 changes: 2 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ RUN apk add --no-cache \
musl-dev \
openssl \
openssl-dev \
python2 \
python2-dev \
zlib-dev
ENV BUILD_BOOTLOADER=1

Expand All @@ -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
Expand Down
3 changes: 0 additions & 3 deletions bin/docker-compose
Original file line number Diff line number Diff line change
@@ -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()
2 changes: 0 additions & 2 deletions compose/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
from __future__ import absolute_import
from __future__ import unicode_literals

__version__ = '1.26.0dev'
3 changes: 0 additions & 3 deletions compose/__main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import absolute_import
from __future__ import unicode_literals

from compose.cli.main import main

main()
3 changes: 0 additions & 3 deletions compose/cli/colors.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import absolute_import
from __future__ import unicode_literals

from ..const import IS_WINDOWS_PLATFORM

NAMES = [
Expand Down
3 changes: 0 additions & 3 deletions compose/cli/command.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import absolute_import
from __future__ import unicode_literals

import logging
import os
import re
Expand Down
3 changes: 0 additions & 3 deletions compose/cli/docker_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import absolute_import
from __future__ import unicode_literals

import logging
import os.path
import ssl
Expand Down
3 changes: 0 additions & 3 deletions compose/cli/docopt_command.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import absolute_import
from __future__ import unicode_literals

from inspect import getdoc

from docopt import docopt
Expand Down
3 changes: 0 additions & 3 deletions compose/cli/errors.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import absolute_import
from __future__ import unicode_literals

import contextlib
import logging
import socket
Expand Down
3 changes: 0 additions & 3 deletions compose/cli/formatter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import absolute_import
from __future__ import unicode_literals

import logging
import shutil

Expand Down
9 changes: 3 additions & 6 deletions compose/cli/log_printer.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 0 additions & 4 deletions compose/cli/main.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 0 additions & 3 deletions compose/cli/signals.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import absolute_import
from __future__ import unicode_literals

import signal

from ..const import IS_WINDOWS_PLATFORM
Expand Down
4 changes: 0 additions & 4 deletions compose/cli/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals

import math
import os
import platform
Expand Down
3 changes: 0 additions & 3 deletions compose/cli/verbose_proxy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import absolute_import
from __future__ import unicode_literals

import functools
import logging
import pprint
Expand Down
3 changes: 0 additions & 3 deletions compose/config/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 0 additions & 3 deletions compose/config/config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import absolute_import
from __future__ import unicode_literals

import functools
import io
import logging
Expand Down
5 changes: 2 additions & 3 deletions compose/config/environment.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from __future__ import absolute_import
from __future__ import unicode_literals

import codecs
import contextlib
import logging
import os
import re
Expand Down
2 changes: 0 additions & 2 deletions compose/config/errors.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import
from __future__ import unicode_literals


VERSION_EXPLANATION = (
Expand Down
3 changes: 0 additions & 3 deletions compose/config/interpolation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import absolute_import
from __future__ import unicode_literals

import logging
import re
from string import Template
Expand Down
3 changes: 0 additions & 3 deletions compose/config/serialize.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import absolute_import
from __future__ import unicode_literals

import six
import yaml

Expand Down
3 changes: 0 additions & 3 deletions compose/config/sort_services.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import absolute_import
from __future__ import unicode_literals

from compose.config.errors import DependencyError


Expand Down
3 changes: 0 additions & 3 deletions compose/config/types.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 0 additions & 3 deletions compose/config/validation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import absolute_import
from __future__ import unicode_literals

import json
import logging
import os
Expand Down
3 changes: 0 additions & 3 deletions compose/const.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import absolute_import
from __future__ import unicode_literals

import sys

from .version import ComposeVersion
Expand Down
3 changes: 0 additions & 3 deletions compose/container.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import absolute_import
from __future__ import unicode_literals

from functools import reduce

import six
Expand Down
2 changes: 0 additions & 2 deletions compose/errors.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import
from __future__ import unicode_literals


class OperationFailedError(Exception):
Expand Down
3 changes: 0 additions & 3 deletions compose/network.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import absolute_import
from __future__ import unicode_literals

import logging
import re
from collections import OrderedDict
Expand Down
9 changes: 3 additions & 6 deletions compose/parallel.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 0 additions & 3 deletions compose/progress_stream.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import absolute_import
from __future__ import unicode_literals

from compose import utils


Expand Down
5 changes: 1 addition & 4 deletions compose/project.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 1 addition & 4 deletions compose/service.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
from __future__ import absolute_import
from __future__ import unicode_literals

import enum
import itertools
import json
import logging
Expand All @@ -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
Expand Down
3 changes: 0 additions & 3 deletions compose/timeparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -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<hours>[\d.]+)h'
Expand Down
3 changes: 0 additions & 3 deletions compose/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import absolute_import
from __future__ import unicode_literals

import codecs
import hashlib
import json.decoder
Expand Down
3 changes: 0 additions & 3 deletions compose/version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import absolute_import
from __future__ import unicode_literals

from distutils.version import LooseVersion


Expand Down
3 changes: 0 additions & 3 deletions compose/volume.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from __future__ import absolute_import
from __future__ import unicode_literals

import logging
import re

Expand Down
3 changes: 0 additions & 3 deletions contrib/migration/migrate-compose-file-v1-to-v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading

0 comments on commit e8424d5

Please sign in to comment.