NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #3395 most downloaded on PyPI
Typing stubs for docker
Last release 11 days ago
23 Sep 2026
Release timing varies
gaps range from 8 days to 2 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
2 years old
66 releases · first in 2024
Run stubtest on Windows to cover the named pipe transport
Run stubtest on Windows to cover the named pipe transport (#16422)
docker-py installs pywin32 on Windows, so docker.transport.npipeconn and docker.transport.npipesocket import there and stubtest reported the global allowlist entries for them as unused. Move those entries to the linux and darwin allowlists, where the modules fail to import, and add win32 to ci-platforms so the npipe stubs are checked against the runtime.
Add return type for container labels
One column per month.
Add return types for node model operations
Add return types for secret model operations
Use TypedDict and SupportsGet for kwargs_from_context
* Fix context.Context methods
Use optional-dependencies for third-party packages
* Replace NoReturn with Never
NoReturn with Never (#16079)Replace *args and kwargs with explicit parameters
* Update to 7.2.*
Avoid class-scope name collisions in stubs
Avoid class-scope name collisions in stubs (#15994)
Class members such as list, type, cursor, Model, and datetime shadow the builtins, classes, or modules referenced by nearby annotations. ty then resolves those annotations to Unknown, which can hide invalid calls in APIs including docker, sqlite3, psycopg2, Markdown, and requests.
Qualify shadowed builtins and use private aliases for colliding imports and classes. This removes 15 stdlib and 120 third-party collision diagnostics under ty 0.0.58, restores the affected public types, and fixes four existing psycopg2 type assertions.
Upgrade black to 26.5.0
Upgrade black to 26.5.0 (#15801)
[docker] Remove @override decorators
[docker] Remove @override decorators (#15764)
Import some items from typing instead of typing_extensions
Import some items from typing instead of typing_extensions (#15711)
Part of #13782
[docker] Improve type annotations in api.swarm
[docker] Improve type annotations in api.swarm (#15629)
Use dashes instead of underscores for METADATA.toml field names
Use dashes instead of underscores for METADATA.toml field names (#15614)
[docker] Add missing type annotations in docker.types
[docker] Add missing type annotations in docker.types (#15566)
Rename requires to dependencies in METADATA files
[docker] Fix incomplete types in models and add missing method
[docker] Fix incomplete types in models and add missing method (#15565)
Add @type_check_only to stub-only private classes in various third-party stubs
Add @type_check_only to stub-only private classes in various third-party stubs (#15535)
[docker] Fix Container.attach() return type
[docker] Fix Container.attach() return type (#15155)
[docker-py] Add fallback exec_start overload
[docker-py] Add some missing types
[docker-py] Add some missing types (#15084)
[docker-py] Fix the type of Model and Collection client attribute
[docker-py] Fix the type of Model and Collection client attribute (#15083)
[docker-py] Fix Container.top() return type
[docker] Fix some incomplete types
[docker] Fix some incomplete types (#14817)
The source of a mount can be None e.g. if the type is tmpfs. The parse_mount_string also sets source=None in some cases
Fix docker mount source type (#14726)
The source of a mount can be None e.g. if the type is tmpfs. The parse_mount_string also sets source=None in some cases
[docker] Add default value for detach parameter of ContainerCollection.create
[docker] Add default value for detach parameter of ContainerCollection.create (#14666)
Add missing defaults to third-party stubs
Add missing defaults to third-party stubs (#14617)
Mark stub-only private symbols as @type_check_only in third-party stubs
Mark stub-only private symbols as @type_check_only in third-party stubs (#14545)
[docker] load() accepts bytes streams
[docker] load() accepts bytes streams (#14366)
Expand type stubs for Docker container device read/write bps/iops
Expand type stubs for Docker container device read/write bps/iops (#14092)
Replace Incomplete | None = None in third party stubs
Replace Incomplete | None = None in third party stubs (#14063)
Improve docker.types (#13809) Co-authored-by: Avasam
Improve docker.types (#13809)
Co-authored-by: Avasam samuel.06@hotmail.com
Improve docker.utils
Improve docker.utils (#13808)
Fix missed type hints in docker containers.pyi
Fix missed type hints in docker containers.pyi (#13136)
Previously, Container.exec_run and Container.get_archive missed type hints on cmd and path arguments, respectively.
Added type hints based on docstring.
[docker-py] Fix 'volumes' argument type hint for 'run' and 'create' functions in containers.pyi
[docker-py] Fix 'volumes' argument type hint for 'run' and 'create' functions in containers.pyi (#12594)
chunk_size parameter of get_image accepts None
chunk_size parameter of get_image accepts None (#12560)
Bump mypy to 1.11.1
Bump mypy to 1.11.1 (#12463)
[docker] Add restart_policy type annotation to Container model
[docker] Add restart_policy type annotation to Container model (#12366)
[docker] Update ports type annotation
[docker] Update ports type annotation (#12284)
Specify stream type of Docker logs
Specify stream type of Docker logs (#12214)
Co-authored-by: Alex Waygood Alex.Waygood@Gmail.com
Allow users of docker run, create to not give name/version
Allow users of docker run, create to not give name/version (#12234)
Add kwarg types to Docker container run and create
Add more keyword argument types for Docker pull
Add more specific types to Docker network inspect/get equivalent methods
Use more specific types for Docker create_network
Use more specific types for Docker create_network (#12187)
Add some types for Docker.api.network.NetworkApiMixing.create_network parameters
Add some types for Docker.api.network.NetworkApiMixing.create_network parameters (#12156)
See implementation at https://github.com/docker/docker-py/blob/a3652028b1ead708bd9191efb286f909ba6c2a49/docker/api/network.py#L40
[docker] Add a number of types to docker.models.containers.Container
[docker] Add a number of types to docker.models.containers.Container (#12077)
[docker] Annotate Container.stop()
Add types to docker.models.containers.Container.logs
Add types to docker.models.containers.Container.logs (#12044)
Add keyword argument types to docker.models.containers.Container.wait()
Add keyword argument types to docker.models.containers.Container.wait() (#12037)
Add return type for Docker Container wait
Add return type for Docker Container wait (#12036)
Add types to parameters for Docker Network.disconnect
Add types to parameters for Docker Network.disconnect (#12007)
Add types for Docker client from_env kwargs
Add types for Docker client from_env kwargs (#11989)
Fix type of Docker BuildError.build_log
Fix type of Docker BuildError.build_log (#11917)
In working this out I also had a go at changing the json_stream functions used to create every BuildError in docker-py.
There are two BuildErrors raised in docker-py, both in
https://github.com/docker/docker-py/blob/b6464dbed92b14b2c61d5ee49805fce041a3e083/docker/models/images.py#L304-L315
result_stream, internal_stream = itertools.tee(json_stream(resp))
for chunk in internal_stream:
if 'error' in chunk:
raise BuildError(chunk['error'], result_stream)
if 'stream' in chunk:
match = re.search(
r'(^Successfully built |sha256:)([0-9a-f]+)$',
chunk['stream']
)
if match:
image_id = match.group(2)
last_event = chunk
if image_id:
return (self.get(image_id), result_stream)
raise BuildError(last_event or 'Unknown', result_stream)
Add a number of types to docker.models.containers
Add a number of types to docker.models.containers (#11912)
Add many types to docker.api.container
Add many types to docker.api.container (#11911)
Add types to all "container" parameters in docker.api.container (#11908)
Add remaining parameter types to docker.api.container logs (#11907)
Add return type to Docker Container.logs (#11888)
Add return type for Docker container start (#11905)
Fix "tail" parameter type for Docker container logs (#11906)
Allow Image type for docker container run image parameter (#11900)
Add some types to Docker ContainerCollection parameters
Add some types to Docker ContainerCollection parameters (#11857)
Add return type to Docker Container.stop
Add return type to Docker Container.stop (#11869)
We can see at
https://github.com/docker/docker-py/blob/b6464dbed92b14b2c61d5ee49805fce041a3e083/docker/models/containers.py#L452
that this returns the return value of self.client.api.stop.
We can see at https://github.com/docker/docker-py/blob/b6464dbed92b14b2c61d5ee49805fce041a3e083/docker/api/container.py#L1187 that this returns None.
Add return type to Docker Container.remove (#11868)
Your coding agent can read these notes before it upgrades. Set up the MCP server →