Skip to content

Commit

Permalink
deps: upgrade & remove unnecessary dependencies (#3014)
Browse files Browse the repository at this point in the history
The `requirements.txt` and `setup.py` had a lot of extra transitive
dependencies to try and address various SSL shortcomings from the
Python ecosystem.

Thankfully, between modern Python versions (3.6+) and corresponding
`requests` versions (2.26+), this is all unnecessary now!

As a result, a bunch of transitive dependencies have been removed
from `requirements.txt`, the minimum version of `requests` increased,
and the `tls` extra made into a no-op.

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
  • Loading branch information
milas committed Jul 28, 2022
1 parent bf02626 commit be942f8
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 45 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ The latest stable version [is available on PyPI](https://pypi.python.org/pypi/do

pip install docker

If you are intending to connect to a docker host via TLS, add `docker[tls]` to your requirements instead, or install with pip:

pip install docker[tls]
> Older versions (< 6.0) required installing `docker[tls]` for SSL/TLS support.
> This is no longer necessary and is a no-op, but is supported for backwards compatibility.
## Usage

Expand Down
13 changes: 0 additions & 13 deletions appveyor.yml

This file was deleted.

16 changes: 3 additions & 13 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
appdirs==1.4.3
asn1crypto==0.22.0
cffi==1.14.4
cryptography==3.4.7
enum34==1.1.6
idna==2.5
ipaddress==1.0.18
packaging==21.3
paramiko==2.10.1
pycparser==2.17
pyOpenSSL==18.0.0
pyparsing==2.2.0
paramiko==2.11.0
pywin32==304; sys_platform == 'win32'
requests==2.26.0
urllib3==1.26.5
requests==2.28.1
urllib3==1.26.11
websocket-client==0.56.0
19 changes: 7 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,23 @@
SOURCE_DIR = os.path.join(ROOT_DIR)

requirements = [
'packaging',
'packaging >= 14.0',
'requests >= 2.26.0',
'urllib3 >= 1.26.0',
'websocket-client >= 0.32.0',
'requests >= 2.14.2, != 2.18.0',
]

extras_require = {
# win32 APIs if on Windows (required for npipe support)
':sys_platform == "win32"': 'pywin32>=304',

# If using docker-py over TLS, highly recommend this option is
# pip-installed or pinned.

# TODO: if pip installing both "requests" and "requests[security]", the
# extra package from the "security" option are not installed (see
# https://github.com/pypa/pip/issues/4391). Once that's fixed, instead of
# installing the extra dependencies, install the following instead:
# 'requests[security] >= 2.5.2, != 2.11.0, != 2.12.2'
'tls': ['pyOpenSSL>=17.5.0', 'cryptography>=3.4.7', 'idna>=2.0.0'],
# This is now a no-op, as similarly the requests[security] extra is
# a no-op as of requests 2.26.0, this is always available/by default now
# see https://github.com/psf/requests/pull/5867
'tls': [],

# Only required when connecting using the ssh:// protocol
'ssh': ['paramiko>=2.4.3'],

}

version = None
Expand Down
8 changes: 4 additions & 4 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
setuptools==58.2.0
coverage==6.0.1
setuptools==63.2.0
coverage==6.4.2
flake8==4.0.1
pytest==6.2.5
pytest==7.1.2
pytest-cov==3.0.0
pytest-timeout==2.0.1
pytest-timeout==2.1.0

0 comments on commit be942f8

Please sign in to comment.