Skip to content

docker - remove dependency on types-requests because requests ships types - #16498

Open
MaicoTimmerman wants to merge 1 commit into
python:mainfrom
MaicoTimmerman:docker-types-dependency
Open

MaicoTimmerman wants to merge 1 commit into
python:mainfrom
MaicoTimmerman:docker-types-dependency

Conversation

@MaicoTimmerman

Copy link
Copy Markdown
Contributor

Requests 2.34 ships inline type information, so depend on it directly instead of types-requests:

  • types-requests -> requests>=2.34.0: Requests now ships its own type information, so the separate stub package is redundant. As per requests-oauthlib - remove dependency on types-requests because requests now comes with its own type annotations #15813 I've added the lower bound.

  • Sequence[str] -> list[str]: APIClient inherits Session.__attrs__, which Requests declares as list[str]. An overriding mutable attribute must keep the same type.

  • ConnectionPool -> HTTPConnectionPool: Requests declares HTTPAdapter.get_connection_with_tls_context() as returning HTTPConnectionPool. Docker’s override cannot use the broader ConnectionPool return type.

Co-Authored-By: Factory Droid (GPT-5.6 Sol)

@github-actions

This comment has been minimized.

…ypes'

Requests 2.34 ships inline type information, so depend on it directly
instead of types-requests:

- types-requests -> requests>=2.34.0: Requests now ships its own type
  information, so the separate stub package is redundant. As per
  python#15813 I've added the lower
  bound.

- `Sequence[str]` -> `list[str]`: `APIClient` inherits `Session.__attrs__`,
  which Requests declares as `list[str]`. An overriding mutable attribute
  must keep the same type.

- `ConnectionPool` -> `HTTPConnectionPool`: Requests declares
  `HTTPAdapter.get_connection_with_tls_context()` as returning
  `HTTPConnectionPool`. Docker’s override cannot use the broader
  `ConnectionPool` return type.

Co-Authored-By: Factory Droid (GPT-5.6 Sol)
@MaicoTimmerman
MaicoTimmerman force-pushed the docker-types-dependency branch from b6f689e to 018dadc Compare October 30, 2026 19:30
@MaicoTimmerman

Copy link
Copy Markdown
Contributor Author

Hi @srittau, would it be possible to land this MR? It would unblock using the shipped types from requests>=2.34 with types-docker.

@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

This branch has not been deployed

No deployments
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.

1 participant