Skip to content

Fix urllib3 dependency version to match the docker-py #13859

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

Closed
wants to merge 1 commit into from

Conversation

karamanolev
Copy link

Per https://github.com/docker/docker-py/blob/main/pyproject.toml#L34C6-L34C17, docker-py depends on urllib3 >= 1.26.0 and depending on >= 2 here can cause breakages due to version incompatibility in projects.

Per https://github.com/docker/docker-py/blob/main/pyproject.toml#L34C6-L34C17, docker-py depends on urllib3 >= 1.26.0 and depending on >= 2 here can cause breakages due to version incompatibility in projects.
@AlexWaygood
Copy link
Member

Unfortunately we can't make the change you're proposing, as urllib3<2 does not have a py.typed file, which means that mypy and some other type checkers may not infer any type information from it even if it's correctly installed. (See some extended discussion in #10825 regarding a similar issue.)

It does sound unfortunate that these stubs depend on urllib3>=2 if the runtime package these stubs are for cannot be used with urllib3>=2. An alternative here might be to have the docker-py stubs depend on the legacy types-urllib3 package, which provides type hints for urllib3<2. But the disadvantage of that is that types-urllib3 can no longer be updated (the source files for that package were deleted from typeshed long ago).

@AlexWaygood
Copy link
Member

Per https://github.com/docker/docker-py/blob/main/pyproject.toml#L34C6-L34C17, docker-py depends on urllib3 >= 1.26.0

Ah, I misread your message. This doesn't say that docker-py can't be installed with urllib3 — it just doesn't require urllib3>2. I assume you have some other package you're trying to install into the same environment that's causing the incompatibility with urllib3>2?

@karamanolev
Copy link
Author

karamanolev commented Apr 21, 2025

@AlexWaygood Yes, my case is that indeed another one of our dependencies depends on urllib3<2. Therefore pip gives me a conflict message due to the impossibility to satisfy both, obviously. I'm not a typeshed guru, so I just didn't know why this had >2 while the base package needs only >1.26.0, but if you say it's required, I'll just close this PR and disable docker-py checking for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants