Skip to content

Commit 7cc0a1b

Browse files
authored
Merge pull request #2156 from docker/3.5.1-release
3.5.1 release
2 parents e0495a9 + f097ea5 commit 7cc0a1b

File tree

11 files changed

+77
-52
lines changed

11 files changed

+77
-52
lines changed

docker/api/container.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ def create_host_config(self, *args, **kwargs):
465465
dns_opt (:py:class:`list`): Additional options to be added to the
466466
container's ``resolv.conf`` file
467467
dns_search (:py:class:`list`): DNS search domains.
468-
extra_hosts (dict): Addtional hostnames to resolve inside the
468+
extra_hosts (dict): Additional hostnames to resolve inside the
469469
container, as a mapping of hostname to IP address.
470470
group_add (:py:class:`list`): List of additional group names and/or
471471
IDs that the container process will run as.
@@ -765,16 +765,16 @@ def logs(self, container, stdout=True, stderr=True, stream=False,
765765
766766
Args:
767767
container (str): The container to get logs from
768-
stdout (bool): Get ``STDOUT``
769-
stderr (bool): Get ``STDERR``
770-
stream (bool): Stream the response
771-
timestamps (bool): Show timestamps
768+
stdout (bool): Get ``STDOUT``. Default ``True``
769+
stderr (bool): Get ``STDERR``. Default ``True``
770+
stream (bool): Stream the response. Default ``False``
771+
timestamps (bool): Show timestamps. Default ``False``
772772
tail (str or int): Output specified number of lines at the end of
773773
logs. Either an integer of number of lines or the string
774774
``all``. Default ``all``
775775
since (datetime or int): Show logs since a given datetime or
776776
integer epoch (in seconds)
777-
follow (bool): Follow log output
777+
follow (bool): Follow log output. Default ``False``
778778
until (datetime or int): Show logs that occurred before the given
779779
datetime or integer epoch (in seconds)
780780

docker/models/containers.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -253,16 +253,16 @@ def logs(self, **kwargs):
253253
generator you can iterate over to retrieve log output as it happens.
254254
255255
Args:
256-
stdout (bool): Get ``STDOUT``
257-
stderr (bool): Get ``STDERR``
258-
stream (bool): Stream the response
259-
timestamps (bool): Show timestamps
256+
stdout (bool): Get ``STDOUT``. Default ``True``
257+
stderr (bool): Get ``STDERR``. Default ``True``
258+
stream (bool): Stream the response. Default ``False``
259+
timestamps (bool): Show timestamps. Default ``False``
260260
tail (str or int): Output specified number of lines at the end of
261261
logs. Either an integer of number of lines or the string
262262
``all``. Default ``all``
263263
since (datetime or int): Show logs since a given datetime or
264264
integer epoch (in seconds)
265-
follow (bool): Follow log output
265+
follow (bool): Follow log output. Default ``False``
266266
until (datetime or int): Show logs that occurred before the given
267267
datetime or integer epoch (in seconds)
268268
@@ -558,7 +558,7 @@ def run(self, image, command=None, stdout=True, stderr=False,
558558
environment (dict or list): Environment variables to set inside
559559
the container, as a dictionary or a list of strings in the
560560
format ``["SOMEVARIABLE=xxx"]``.
561-
extra_hosts (dict): Addtional hostnames to resolve inside the
561+
extra_hosts (dict): Additional hostnames to resolve inside the
562562
container, as a mapping of hostname to IP address.
563563
group_add (:py:class:`list`): List of additional group names and/or
564564
IDs that the container process will run as.

docker/models/images.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ def save(self, chunk_size=DEFAULT_DATA_CHUNK_SIZE):
6464
Get a tarball of an image. Similar to the ``docker save`` command.
6565
6666
Args:
67-
chunk_size (int): The number of bytes returned by each iteration
68-
of the generator. If ``None``, data will be streamed as it is
69-
received. Default: 2 MB
67+
chunk_size (int): The generator will return up to that much data
68+
per iteration, but may return less. If ``None``, data will be
69+
streamed as it is received. Default: 2 MB
7070
7171
Returns:
7272
(generator): A stream of raw archive data.

docker/models/services.py

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def tasks(self, filters=None):
4242
``label``, and ``desired-state``.
4343
4444
Returns:
45-
(:py:class:`list`): List of task dictionaries.
45+
:py:class:`list`: List of task dictionaries.
4646
4747
Raises:
4848
:py:class:`docker.errors.APIError`
@@ -84,26 +84,27 @@ def update(self, **kwargs):
8484

8585
def logs(self, **kwargs):
8686
"""
87-
Get log stream for the service.
88-
Note: This method works only for services with the ``json-file``
89-
or ``journald`` logging drivers.
90-
91-
Args:
92-
details (bool): Show extra details provided to logs.
93-
Default: ``False``
94-
follow (bool): Keep connection open to read logs as they are
95-
sent by the Engine. Default: ``False``
96-
stdout (bool): Return logs from ``stdout``. Default: ``False``
97-
stderr (bool): Return logs from ``stderr``. Default: ``False``
98-
since (int): UNIX timestamp for the logs staring point.
99-
Default: 0
100-
timestamps (bool): Add timestamps to every log line.
101-
tail (string or int): Number of log lines to be returned,
102-
counting from the current end of the logs. Specify an
103-
integer or ``'all'`` to output all log lines.
104-
Default: ``all``
105-
106-
Returns (generator): Logs for the service.
87+
Get log stream for the service.
88+
Note: This method works only for services with the ``json-file``
89+
or ``journald`` logging drivers.
90+
91+
Args:
92+
details (bool): Show extra details provided to logs.
93+
Default: ``False``
94+
follow (bool): Keep connection open to read logs as they are
95+
sent by the Engine. Default: ``False``
96+
stdout (bool): Return logs from ``stdout``. Default: ``False``
97+
stderr (bool): Return logs from ``stderr``. Default: ``False``
98+
since (int): UNIX timestamp for the logs staring point.
99+
Default: 0
100+
timestamps (bool): Add timestamps to every log line.
101+
tail (string or int): Number of log lines to be returned,
102+
counting from the current end of the logs. Specify an
103+
integer or ``'all'`` to output all log lines.
104+
Default: ``all``
105+
106+
Returns:
107+
generator: Logs for the service.
107108
"""
108109
is_tty = self.attrs['Spec']['TaskTemplate']['ContainerSpec'].get(
109110
'TTY', False
@@ -118,7 +119,7 @@ def scale(self, replicas):
118119
replicas (int): The number of containers that should be running.
119120
120121
Returns:
121-
``True``if successful.
122+
bool: ``True`` if successful.
122123
"""
123124

124125
if 'Global' in self.attrs['Spec']['Mode'].keys():
@@ -134,7 +135,7 @@ def force_update(self):
134135
Force update the service even if no changes require it.
135136
136137
Returns:
137-
``True``if successful.
138+
bool: ``True`` if successful.
138139
"""
139140

140141
return self.update(force_update=True, fetch_current_spec=True)
@@ -206,7 +207,7 @@ def create(self, image, command=None, **kwargs):
206207
containers.
207208
208209
Returns:
209-
(:py:class:`Service`) The created service.
210+
:py:class:`Service`: The created service.
210211
211212
Raises:
212213
:py:class:`docker.errors.APIError`
@@ -228,7 +229,7 @@ def get(self, service_id, insert_defaults=None):
228229
into the output.
229230
230231
Returns:
231-
(:py:class:`Service`): The service.
232+
:py:class:`Service`: The service.
232233
233234
Raises:
234235
:py:class:`docker.errors.NotFound`
@@ -253,7 +254,7 @@ def list(self, **kwargs):
253254
Default: ``None``.
254255
255256
Returns:
256-
(list of :py:class:`Service`): The services.
257+
list of :py:class:`Service`: The services.
257258
258259
Raises:
259260
:py:class:`docker.errors.APIError`

docker/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version = "3.5.0"
1+
version = "3.5.1"
22
version_info = tuple([int(d) for d in version.split("-")[0].split(".")])

docs/api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ Configuration types
145145
.. autoclass:: Privileges
146146
.. autoclass:: Resources
147147
.. autoclass:: RestartPolicy
148+
.. autoclass:: RollbackConfig
148149
.. autoclass:: SecretReference
149150
.. autoclass:: ServiceMode
150151
.. autoclass:: SwarmExternalCA

docs/change-log.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
Change log
22
==========
33

4+
3.5.1
5+
-----
6+
7+
[List of PRs / issues for this release](https://github.com/docker/docker-py/milestone/54?closed=1)
8+
9+
### Miscellaneous
10+
11+
* Bumped version of `pyOpenSSL` in `requirements.txt` and `setup.py` to prevent
12+
installation of a vulnerable version
13+
14+
* Docs fixes
15+
416
3.5.0
517
-----
618

7-
[List of PRs / issues for this release](https://github.com/docker/docker-py/milestone=53?closed=1)
19+
[List of PRs / issues for this release](https://github.com/docker/docker-py/milestone/53?closed=1)
820

921
### Deprecation warning
1022

docs/services.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ Service objects
3030
The raw representation of this object from the server.
3131

3232

33+
.. automethod:: force_update
34+
.. automethod:: logs
3335
.. automethod:: reload
3436
.. automethod:: remove
37+
.. automethod:: scale
3538
.. automethod:: tasks
3639
.. automethod:: update

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ idna==2.5
1010
ipaddress==1.0.18
1111
packaging==16.8
1212
pycparser==2.17
13-
pyOpenSSL==17.0.0
13+
pyOpenSSL==18.0.0
1414
pyparsing==2.2.0
1515
pypiwin32==219; sys_platform == 'win32' and python_version < '3.6'
1616
pypiwin32==223; sys_platform == 'win32' and python_version >= '3.6'

scripts/release.sh

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,26 @@ echo "##> Removing stale build files"
2222
rm -rf ./build || exit 1
2323

2424
echo "##> Tagging the release as $VERSION"
25-
git tag $VERSION || exit 1
25+
git tag $VERSION
26+
if [[ $? != 0 ]]; then
27+
head_commit=$(git show --pretty=format:%H HEAD)
28+
tag_commit=$(git show --pretty=format:%H $VERSION)
29+
if [[ $head_commit != $tag_commit ]]; then
30+
echo "ERROR: tag already exists, but isn't the current HEAD"
31+
exit 1
32+
fi
33+
fi
2634
if [[ $2 == 'upload' ]]; then
2735
echo "##> Pushing tag to github"
2836
git push $GITHUB_REPO $VERSION || exit 1
2937
fi
3038

3139

3240
pandoc -f markdown -t rst README.md -o README.rst || exit 1
41+
echo "##> sdist & wheel"
42+
python setup.py sdist bdist_wheel
43+
3344
if [[ $2 == 'upload' ]]; then
34-
echo "##> Uploading sdist to pypi"
35-
python setup.py sdist bdist_wheel upload
36-
else
37-
echo "##> sdist & wheel"
38-
python setup.py sdist bdist_wheel
39-
fi
45+
echo '##> Uploading sdist to pypi'
46+
twine upload dist/docker-$VERSION*
47+
fi

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
# https://github.com/pypa/pip/issues/4391). Once that's fixed, instead of
4141
# installing the extra dependencies, install the following instead:
4242
# 'requests[security] >= 2.5.2, != 2.11.0, != 2.12.2'
43-
'tls': ['pyOpenSSL>=0.14', 'cryptography>=1.3.4', 'idna>=2.0.0'],
43+
'tls': ['pyOpenSSL>=17.5.0', 'cryptography>=1.3.4', 'idna>=2.0.0'],
4444

4545
}
4646

0 commit comments

Comments
 (0)