Skip to content

build(deps): type docker-py with types-docker - #3822

Merged
dan-petty merged 2 commits into
mainfrom
build/2603-type-docker-py
Nov 6, 2026
Merged

dan-petty merged 2 commits into
mainfrom
build/2603-type-docker-py

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Add the typeshed stubs of docker-py to the dev group and delete the nine type: ignore markers on docker-py imports. The src ceiling of type: ignore goes from 51 to 40. Requests becomes a declared dependency. A reference with a digest now splits into repository and digest.

Closes #2603

Change: openspec/changes/archive/2026-11-06-2603-type-docker-py-with-typeshed-s/
Elapsed: 6.86s

Add the typeshed stubs of docker-py to the dev group and delete the nine
type: ignore[import-untyped] markers on docker-py imports. The src type: ignore
ceiling goes from 51 to 40.

Catch requests.HTTPError where the stubs type it, and declare requests as a
dependency. Import get_current_context_name from docker.context.config, where
the stubs have it. Cast the SDK client to the EngineClient Protocol, because
the stubs list each keyword while the Protocols forward kwargs.

tagged_image splits a reference with docker-py's parse_repository_tag and
resolve_repository_name. A reference with a digest now splits into repository
and digest, and a reference with a scheme is a RegistryReadError.

Closes #2603
@dan-petty dan-petty added type/infra Type infra: the build, CI, images or cluster scope/deps Dependency pins, upgrades and the supply chain labels Nov 6, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Test evidence:

  • tests/docker: 25 passed after the rebase onto origin/main b28fd4d (no conflicts).
  • mypy on src/devops_cli/docker, sandbox/host.py and commands/docker.py: no issues.
  • Pre-push fast static checks: passed.
  • Premise: types-docker exists on typeshed and types the docker-py APIs used (see the Feasibility section of the proposal).

@dan-petty
dan-petty marked this pull request as ready for review November 6, 2026 18:40
@dan-petty
dan-petty merged commit fecb7ee into main Nov 6, 2026
24 checks passed
@dan-petty
dan-petty deleted the build/2603-type-docker-py branch November 6, 2026 18:42
dan-petty added a commit that referenced this pull request Nov 6, 2026
Pull request #3822 typed docker-py, so the plan builds image_reference on the docker-py parser and adds no digest field. The recheck of the premise is in the proposal.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/deps Dependency pins, upgrades and the supply chain type/infra Type infra: the build, CI, images or cluster

Projects

None yet

Development

Successfully merging this pull request may close these issues.

build(deps): Type docker-py with types-docker

1 participant