Commit Graph
27 Commits
Author SHA1 Message Date
Adam Dangoor 55b552121b 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 `BuildError`s raised in docker-py, both in
https://github.com/docker/docker-py/blob/b6464dbed92b14b2c61d5ee49805fce041a3e083/docker/models/images.py#L304-L315

```python
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)
```
2024-05-18 08:26:17 -04:00
Adam Dangoor a9d7e861f7 Add a number of types to docker.models.containers (#11912) 2024-05-14 11:15:32 +02:00
Adam Dangoor 0382803c4c Add many types to docker.api.container (#11911) 2024-05-12 13:58:56 -07:00
Adam Dangoor a4c4076b61 Add types to all "container" parameters in docker.api.container (#11908) 2024-05-12 18:07:48 +02:00
Adam Dangoor 96697a835b Add remaining parameter types to docker.api.container logs (#11907) 2024-05-12 17:12:32 +02:00
Adam Dangoor 932311d441 Add return type to Docker Container.logs (#11888) 2024-05-12 13:39:18 +02:00
Adam Dangoor 488bc24c43 Add return type for Docker container start (#11905) 2024-05-12 13:37:00 +02:00
Adam Dangoor bbad7f2f24 Fix "tail" parameter type for Docker container logs (#11906) 2024-05-12 13:09:47 +02:00
Adam Dangoor f75211b801 Allow Image type for docker container run image parameter (#11900) 2024-05-12 12:14:06 +02:00
Adam Dangoor 9174db0d7d Add some types to Docker ContainerCollection parameters (#11857) 2024-05-10 10:08:47 +02:00
Adam Dangoor 727f3c4320 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.
2024-05-06 11:05:43 +02:00
Adam Dangoor 113b2ccd42 Add return type to Docker Container.remove (#11868) 2024-05-06 11:01:55 +02:00
Adam Dangoor 5883898b0a [docker-py] Add return type for building a Docker image (#11851) 2024-05-02 10:08:32 +02:00
Adam Dangoor 4a33b2f3a0 Add some types for xml.dom.minidom.Text (#11725) 2024-04-06 14:45:24 +02:00
Adam Dangoor 9d2f651818 Add annotations to docutils.parsers.rst.directives.parts (#11667) 2024-03-30 09:10:41 +01:00
Adam Dangoor 26452a7c68 Add docutils.nodes.system_message and .BackLinkable
Add stubs for docutils.nodes.system_message and docutils.nodes.BackLinkable
2024-01-25 11:27:10 +01:00
Adam Dangoor ce45bc3a1c Ad docutils.nodes.raw and docutils.nodes.Inline (#11312) 2024-01-25 11:25:38 +01:00
Adam Dangoor 289c3f79b0 Add type stubs for docutils.nodes.literal_block and docutils.nodes.Fi… (#11308) 2024-01-24 15:36:18 +01:00
Adam Dangoor b96d40a16c Add substitution_defs to docutils.nodes.document (#11307) 2024-01-24 15:21:53 +01:00
Adam Dangoor d689b486c0 Add parameter type to PreparedRequest.prepare_content_length (#11304) 2024-01-24 13:41:27 +01:00
Adam Dangoor b6d121600e Add a number of properties to PIL.ImageStat.Stat (#11303) 2024-01-24 13:39:05 +01:00
Adam Dangoor ced150a7e8 Add types to urllib3.filepost stubs (#9924) 2023-03-26 15:15:36 +01:00
Adam Dangoor 19368ab964 Add type to requests.models.RequestEncodingMixin.path_url (#9923)
We can see at https://github.com/psf/requests/blob/7f694b79e114c06fac5ec06019cada5a61e5570f/requests/models.py#L104 that this always returns a string.
2023-03-22 19:20:40 +00:00
Adam Dangoor b9c81fe2f0 Add some return type hints for methods of Werkzeug's EnvironBuilder c… (#4653) 2020-10-12 13:47:54 +02:00
Adam Dangoor ec62f5f772 Allow Flask.Response.default_mimetype to be None (#4563) 2020-09-21 14:36:05 +02:00
Adam Dangoor 45a11b974e Update parse_multipart return type to support Python 3.7 (#2474)
* Add encoding and errors parameters to cgi.parse_multipart stub.
2018-09-27 22:19:02 +02:00
Adam Dangoor 7fe417ca58 In Python 3.4 and above, os.makedirs and os.removedirs use the kwarg "name" rather than "path" (#1536) 2017-08-08 18:42:29 -07:00