Skip to content

Fix 'volumes' argument type hint for 'run' and 'create' functions in containers.pyi - #12594

Merged
srittau merged 1 commit into
python:mainfrom
smallSwed:main
Aug 26, 2024
Merged

srittau merged 1 commit into
python:mainfrom
smallSwed:main

Conversation

@smallSwed

@smallSwed smallSwed commented Aug 26, 2024 •

Copy link
Copy Markdown
Contributor

Instead of dict[str, str] | ... the volumes keyword argument accepts dict[str, dict[str, str]] | ... in ./docker/models/containers.pyi

see documentation: docker-py.readthedocs.io/en/stable/containers.html (at the moment version 7.1, but it is the same for older version too)

volumes (dict or list) –

A dictionary to configure volumes mounted inside the container. The key is either the host path or a volume name, and the value is a dictionary with the keys:

    bind The path to mount the volume inside the container

    mode Either rw to mount the volume read/write, or ro to mount it read-only.

For example:

{'/home/user1/': {'bind': '/mnt/vol2', 'mode': 'rw'},
 '/var/www': {'bind': '/mnt/vol1', 'mode': 'ro'}}

@github-actions

Copy link
Copy Markdown
Contributor

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

@srittau srittau left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@srittau
srittau merged commit 257691b into python:main Aug 26, 2024
max-muoto pushed a commit to max-muoto/typeshed that referenced this pull request Sep 8, 2024
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.

2 participants