Skip to content

docker.from_env produces "DeprecationWarning: distutils Version classes are deprecated" warnings. #2928

Closed
@lindycoder

Description

@lindycoder

Hello!

It would seem that setuptools v59.6.0 added a warning when using distutils version: pypa/setuptools@1701579

So with the current setuptools, using from_env produces these warnings

$ PYTHONWARNINGS=default docker-warnings/bin/python
Python 3.9.9 (main, Nov 26 2021, 20:52:48)
[Clang 13.0.0 (clang-1300.0.29.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import docker
>>> docker.from_env()
/private/tmp/docker-warnings/lib/python3.9/site-packages/docker/utils/utils.py:52: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  s1 = StrictVersion(v1)
/private/tmp/docker-warnings/lib/python3.9/site-packages/docker/utils/utils.py:53: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  s2 = StrictVersion(v2)
<docker.client.DockerClient object at 0x10d89d9d0>

Just raising the flag to fix before it's too late ;)

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions