-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use packaging
instead of distutils
for Version
#2931
Use packaging
instead of distutils
for Version
#2931
Conversation
Signed-off-by: Francesco Casalegno <francesco.casalegno@gmail.com>
@aiordache @ulyssessouza this PR has been open for 2 days but the CI tests is still on hold, because it needs your approval before being run. Could you please give your green light to run the CI workflow (and also provide some feedback on this PR, when you have time)? |
Hello @aiordache @ureyes84 any chance you could have a look at the request by @FrancescoCasalegno above? Thanks! |
Any update on this? We use the |
I use |
For others that are encountering this, you can do a temporary ignore as follows: import warnings
import docker
def get_docker_client():
with warnings.catch_warnings():
# Silence warnings due to use of deprecated methods within dockerpy
# See https://github.com/docker/docker-py/pull/2931
warnings.filterwarnings(
"ignore",
message="distutils Version classes are deprecated.*",
category=DeprecationWarning,
)
return docker.from_env() |
Seems like the maintainers have gone AWOL, maybe someone should fork this repo? |
…ckage After docker package resolves that warning, this commit should be reverted. docker/docker-py#2928 docker/docker-py#2931
…ckage After docker package resolves that warning, this commit should be reverted. docker/docker-py#2928 docker/docker-py#2931
…ckage After docker package resolves that warning, this commit should be reverted. docker/docker-py#2928 docker/docker-py#2931
Thanks @milas ! |
Fixes #2928.
Context
setuptools
has deprecated the usage ofdistutils
Version
classes since version60.3.0
. See pypa/setuptools@1701579 for details.As a consequence, a
warning
is raised any time we try, e.g., to dofrom docker import from_env
. Notice that thiswarning
can be fatal if the user has set a warning filter toerror
mode, which is not too uncommon when running unit tests in CI.Proposed solution
distutils.Version
(and its subclasses) withpackaging.Version
.packaging
to theinstall_requires
.