Skip to content

Commit be942f8

Browse files
authored
deps: upgrade & remove unnecessary dependencies (docker#3014)
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>
1 parent bf02626 commit be942f8

File tree

5 files changed

+16
-45
lines changed

5 files changed

+16
-45
lines changed

Diff for: README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ The latest stable version [is available on PyPI](https://pypi.python.org/pypi/do
1010

1111
pip install docker
1212

13-
If you are intending to connect to a docker host via TLS, add `docker[tls]` to your requirements instead, or install with pip:
14-
15-
pip install docker[tls]
13+
> Older versions (< 6.0) required installing `docker[tls]` for SSL/TLS support.
14+
> This is no longer necessary and is a no-op, but is supported for backwards compatibility.
1615
1716
## Usage
1817

Diff for: appveyor.yml

-13
This file was deleted.

Diff for: requirements.txt

+3-13
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
1-
appdirs==1.4.3
2-
asn1crypto==0.22.0
3-
cffi==1.14.4
4-
cryptography==3.4.7
5-
enum34==1.1.6
6-
idna==2.5
7-
ipaddress==1.0.18
81
packaging==21.3
9-
paramiko==2.10.1
10-
pycparser==2.17
11-
pyOpenSSL==18.0.0
12-
pyparsing==2.2.0
2+
paramiko==2.11.0
133
pywin32==304; sys_platform == 'win32'
14-
requests==2.26.0
15-
urllib3==1.26.5
4+
requests==2.28.1
5+
urllib3==1.26.11
166
websocket-client==0.56.0

Diff for: setup.py

+7-12
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,23 @@
1010
SOURCE_DIR = os.path.join(ROOT_DIR)
1111

1212
requirements = [
13-
'packaging',
13+
'packaging >= 14.0',
14+
'requests >= 2.26.0',
15+
'urllib3 >= 1.26.0',
1416
'websocket-client >= 0.32.0',
15-
'requests >= 2.14.2, != 2.18.0',
1617
]
1718

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

22-
# If using docker-py over TLS, highly recommend this option is
23-
# pip-installed or pinned.
24-
25-
# TODO: if pip installing both "requests" and "requests[security]", the
26-
# extra package from the "security" option are not installed (see
27-
# https://github.com/pypa/pip/issues/4391). Once that's fixed, instead of
28-
# installing the extra dependencies, install the following instead:
29-
# 'requests[security] >= 2.5.2, != 2.11.0, != 2.12.2'
30-
'tls': ['pyOpenSSL>=17.5.0', 'cryptography>=3.4.7', 'idna>=2.0.0'],
23+
# This is now a no-op, as similarly the requests[security] extra is
24+
# a no-op as of requests 2.26.0, this is always available/by default now
25+
# see https://github.com/psf/requests/pull/5867
26+
'tls': [],
3127

3228
# Only required when connecting using the ssh:// protocol
3329
'ssh': ['paramiko>=2.4.3'],
34-
3530
}
3631

3732
version = None

Diff for: test-requirements.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
setuptools==58.2.0
2-
coverage==6.0.1
1+
setuptools==63.2.0
2+
coverage==6.4.2
33
flake8==4.0.1
4-
pytest==6.2.5
4+
pytest==7.1.2
55
pytest-cov==3.0.0
6-
pytest-timeout==2.0.1
6+
pytest-timeout==2.1.0

0 commit comments

Comments
 (0)