Skip to content

Commit 7ce5a6b

Browse files
committed
Update pre-commit hooks versions
1 parent 889ca12 commit 7ce5a6b

File tree

10 files changed

+95
-97
lines changed

10 files changed

+95
-97
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
exclude: doc/en/example/py2py3/test_py2.py
22
repos:
33
- repo: https://github.com/python/black
4-
rev: 19.3b0
4+
rev: 20.8b1
55
hooks:
66
- id: black
77
args: [--safe, --quiet]
88
- repo: https://github.com/asottile/blacken-docs
9-
rev: v1.0.0
9+
rev: v1.9.2
1010
hooks:
1111
- id: blacken-docs
1212
additional_dependencies: [black==19.3b0]
1313
- repo: https://github.com/pre-commit/pre-commit-hooks
14-
rev: v2.2.3
14+
rev: v3.4.0
1515
hooks:
1616
- id: trailing-whitespace
1717
- id: end-of-file-fixer
1818
- id: fix-encoding-pragma
1919
- id: check-yaml
2020
- repo: https://github.com/asottile/reorder_python_imports
21-
rev: v1.4.0
21+
rev: v2.3.6
2222
hooks:
2323
- id: reorder-python-imports
2424
args: ['--application-directories=execnet']

doc/example/sysinfo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def parsehosts(path):
4141
for line in path.readlines():
4242
m = rex.match(line)
4343
if m is not None:
44-
sshname, = m.groups()
44+
(sshname,) = m.groups()
4545
l.append(sshname)
4646
return l
4747

execnet/deprecated.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99

1010
def PopenGateway(python=None):
11-
""" instantiate a gateway to a subprocess
12-
started with the given 'python' executable.
11+
"""instantiate a gateway to a subprocess
12+
started with the given 'python' executable.
1313
"""
1414
APIWARN("1.0.0b4", "use makegateway('popen')")
1515
spec = execnet.XSpec("popen")
@@ -18,22 +18,22 @@ def PopenGateway(python=None):
1818

1919

2020
def SocketGateway(host, port):
21-
""" This Gateway provides interaction with a remote process
22-
by connecting to a specified socket. On the remote
23-
side you need to manually start a small script
24-
(py/execnet/script/socketserver.py) that accepts
25-
SocketGateway connections or use the experimental
26-
new_remote() method on existing gateways.
21+
"""This Gateway provides interaction with a remote process
22+
by connecting to a specified socket. On the remote
23+
side you need to manually start a small script
24+
(py/execnet/script/socketserver.py) that accepts
25+
SocketGateway connections or use the experimental
26+
new_remote() method on existing gateways.
2727
"""
2828
APIWARN("1.0.0b4", "use makegateway('socket=host:port')")
2929
spec = execnet.XSpec("socket={}:{}".format(host, port))
3030
return execnet.default_group.makegateway(spec)
3131

3232

3333
def SshGateway(sshaddress, remotepython=None, ssh_config=None):
34-
""" instantiate a remote ssh process with the
35-
given 'sshaddress' and remotepython version.
36-
you may specify an ssh_config file.
34+
"""instantiate a remote ssh process with the
35+
given 'sshaddress' and remotepython version.
36+
you may specify an ssh_config file.
3737
"""
3838
APIWARN("1.0.0b4", "use makegateway('ssh=host')")
3939
spec = execnet.XSpec("ssh=%s" % sshaddress)

execnet/gateway.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def __repr__(self):
4242
)
4343

4444
def exit(self):
45-
""" trigger gateway exit. Defer waiting for finishing
45+
"""trigger gateway exit. Defer waiting for finishing
4646
of receiver-thread and subprocess activity to when
4747
group.terminate() is called.
4848
"""
@@ -93,20 +93,20 @@ def remote_status(self):
9393
return RemoteStatus(statusdict)
9494

9595
def remote_exec(self, source, **kwargs):
96-
""" return channel object and connect it to a remote
97-
execution thread where the given ``source`` executes.
98-
99-
* ``source`` is a string: execute source string remotely
100-
with a ``channel`` put into the global namespace.
101-
* ``source`` is a pure function: serialize source and
102-
call function with ``**kwargs``, adding a
103-
``channel`` object to the keyword arguments.
104-
* ``source`` is a pure module: execute source of module
105-
with a ``channel`` in its global namespace
106-
107-
In all cases the binding ``__name__='__channelexec__'``
108-
will be available in the global namespace of the remotely
109-
executing code.
96+
"""return channel object and connect it to a remote
97+
execution thread where the given ``source`` executes.
98+
99+
* ``source`` is a string: execute source string remotely
100+
with a ``channel`` put into the global namespace.
101+
* ``source`` is a pure function: serialize source and
102+
call function with ``**kwargs``, adding a
103+
``channel`` object to the keyword arguments.
104+
* ``source`` is a pure module: execute source of module
105+
with a ``channel`` in its global namespace
106+
107+
In all cases the binding ``__name__='__channelexec__'``
108+
will be available in the global namespace of the remotely
109+
executing code.
110110
"""
111111
call_name = None
112112
file_name = None

execnet/gateway_base.py

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,9 @@ def PopenPiped(self, args):
187187

188188

189189
class Reply(object):
190-
""" reply instances provide access to the result
191-
of a function execution that got dispatched
192-
through WorkerPool.spawn()
190+
"""reply instances provide access to the result
191+
of a function execution that got dispatched
192+
through WorkerPool.spawn()
193193
"""
194194

195195
def __init__(self, task, threadmodel):
@@ -198,10 +198,10 @@ def __init__(self, task, threadmodel):
198198
self.running = True
199199

200200
def get(self, timeout=None):
201-
""" get the result object from an asynchronous function execution.
202-
if the function execution raised an exception,
203-
then calling get() will reraise that exception
204-
including its traceback.
201+
"""get the result object from an asynchronous function execution.
202+
if the function execution raised an exception,
203+
then calling get() will reraise that exception
204+
including its traceback.
205205
"""
206206
self.waitfinish(timeout)
207207
try:
@@ -228,14 +228,14 @@ def run(self):
228228

229229

230230
class WorkerPool(object):
231-
""" A WorkerPool allows to spawn function executions
232-
to threads, returning a reply object on which you
233-
can ask for the result (and get exceptions reraised).
234-
235-
This implementation allows the main thread to integrate
236-
itself into performing function execution through
237-
calling integrate_as_primary_thread() which will return
238-
when the pool received a trigger_shutdown().
231+
"""A WorkerPool allows to spawn function executions
232+
to threads, returning a reply object on which you
233+
can ask for the result (and get exceptions reraised).
234+
235+
This implementation allows the main thread to integrate
236+
itself into performing function execution through
237+
calling integrate_as_primary_thread() which will return
238+
when the pool received a trigger_shutdown().
239239
"""
240240

241241
def __init__(self, execmodel, hasprimary=False):
@@ -253,7 +253,7 @@ def __init__(self, execmodel, hasprimary=False):
253253
self._primary_thread_task_ready = None
254254

255255
def integrate_as_primary_thread(self):
256-
""" integrate the thread with which we are called as a primary
256+
"""integrate the thread with which we are called as a primary
257257
thread for executing functions triggered with spawn().
258258
"""
259259
assert self.execmodel.backend == "thread", self.execmodel
@@ -303,8 +303,8 @@ def _try_send_to_primary_thread(self, reply):
303303
return False
304304

305305
def spawn(self, func, *args, **kwargs):
306-
""" return Reply object for the asynchronous dispatch
307-
of the given func(*args, **kwargs).
306+
"""return Reply object for the asynchronous dispatch
307+
of the given func(*args, **kwargs).
308308
"""
309309
reply = Reply((func, args, kwargs), self.execmodel)
310310
with self._running_lock:
@@ -572,14 +572,14 @@ def _trace(self, *msg):
572572
self.gateway._trace(self.id, *msg)
573573

574574
def setcallback(self, callback, endmarker=NO_ENDMARKER_WANTED):
575-
""" set a callback function for receiving items.
576-
577-
All already queued items will immediately trigger the callback.
578-
Afterwards the callback will execute in the receiver thread
579-
for each received data item and calls to ``receive()`` will
580-
raise an error.
581-
If an endmarker is specified the callback will eventually
582-
be called with the endmarker when the channel closes.
575+
"""set a callback function for receiving items.
576+
577+
All already queued items will immediately trigger the callback.
578+
Afterwards the callback will execute in the receiver thread
579+
for each received data item and calls to ``receive()`` will
580+
raise an error.
581+
If an endmarker is specified the callback will eventually
582+
be called with the endmarker when the channel closes.
583583
"""
584584
_callbacks = self.gateway._channelfactory._callbacks
585585
with self.gateway._receivelock:
@@ -650,15 +650,15 @@ def _getremoteerror(self):
650650
# public API for channel objects
651651
#
652652
def isclosed(self):
653-
""" return True if the channel is closed. A closed
654-
channel may still hold items.
653+
"""return True if the channel is closed. A closed
654+
channel may still hold items.
655655
"""
656656
return self._closed
657657

658658
def makefile(self, mode="w", proxyclose=False):
659-
""" return a file-like object.
660-
mode can be 'w' or 'r' for writeable/readable files.
661-
if proxyclose is true file.close() will also close the channel.
659+
"""return a file-like object.
660+
mode can be 'w' or 'r' for writeable/readable files.
661+
if proxyclose is true file.close() will also close the channel.
662662
"""
663663
if mode == "w":
664664
return ChannelFileWrite(channel=self, proxyclose=proxyclose)
@@ -667,10 +667,10 @@ def makefile(self, mode="w", proxyclose=False):
667667
raise ValueError("mode {!r} not availabe".format(mode))
668668

669669
def close(self, error=None):
670-
""" close down this channel with an optional error message.
671-
Note that closing of a channel tied to remote_exec happens
672-
automatically at the end of execution and cannot
673-
be done explicitely.
670+
"""close down this channel with an optional error message.
671+
Note that closing of a channel tied to remote_exec happens
672+
automatically at the end of execution and cannot
673+
be done explicitely.
674674
"""
675675
if self._executing:
676676
raise IOError("cannot explicitly close channel within remote_exec")
@@ -699,7 +699,7 @@ def close(self, error=None):
699699
self.gateway._channelfactory._no_longer_opened(self.id)
700700

701701
def waitclose(self, timeout=None):
702-
""" wait until this channel is closed (or the remote side
702+
"""wait until this channel is closed (or the remote side
703703
otherwise signalled that no more data was being sent).
704704
The channel may still hold receiveable items, but not receive
705705
any more after waitclose() has returned. Exceptions from executing
@@ -1319,7 +1319,7 @@ def _buildopcodes():
13191319

13201320

13211321
def dumps(obj):
1322-
""" return a serialized bytestring of the given obj.
1322+
"""return a serialized bytestring of the given obj.
13231323
13241324
The obj and all contained objects must be of a builtin
13251325
python type (so nested dicts, sets, etc. are all ok but
@@ -1334,7 +1334,7 @@ def dump(byteio, obj):
13341334

13351335

13361336
def loads(bytestring, py2str_as_py3str=False, py3str_as_py2str=False):
1337-
""" return the object as deserialized from the given bytestring.
1337+
"""return the object as deserialized from the given bytestring.
13381338
13391339
py2str_as_py3str: if true then string (str) objects previously
13401340
dumped on Python2 will be loaded as Python3
@@ -1354,7 +1354,7 @@ def loads(bytestring, py2str_as_py3str=False, py3str_as_py2str=False):
13541354

13551355

13561356
def load(io, py2str_as_py3str=False, py3str_as_py2str=False):
1357-
""" derserialize an object form the specified stream.
1357+
"""derserialize an object form the specified stream.
13581358
13591359
Behaviour and parameters are otherwise the same as with ``loads``
13601360
"""

execnet/gateway_io.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def create_io(spec, execmodel):
142142

143143

144144
class ProxyIO(object):
145-
""" A Proxy IO object allows to instantiate a Gateway
145+
"""A Proxy IO object allows to instantiate a Gateway
146146
through another "via" gateway. A master:ProxyIO object
147147
provides an IO object effectively connected to the sub
148148
via the forwarder. To achieve this, master:ProxyIO interacts

execnet/gateway_socket.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ def kill(self):
5454

5555

5656
def start_via(gateway, hostport=None):
57-
""" return a host, port tuple,
58-
after instanciating a socketserver on the given gateway
57+
"""return a host, port tuple,
58+
after instanciating a socketserver on the given gateway
5959
"""
6060
if hostport is None:
6161
host, port = ("localhost", 0)

execnet/multi.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Group(object):
2525
defaultspec = "popen"
2626

2727
def __init__(self, xspecs=(), execmodel="thread"):
28-
""" initialize group and make gateways as specified.
28+
"""initialize group and make gateways as specified.
2929
execmodel can be 'thread' or 'eventlet'.
3030
"""
3131
self._gateways = []
@@ -51,7 +51,7 @@ def remote_execmodel(self):
5151
return self._remote_execmodel
5252

5353
def set_execmodel(self, execmodel, remote_execmodel=None):
54-
""" Set the execution model for local and remote site.
54+
"""Set the execution model for local and remote site.
5555
5656
execmodel can be one of "thread" or "eventlet" (XXX gevent).
5757
It determines the execution model for any newly created gateway.
@@ -188,7 +188,7 @@ def _cleanup_atexit(self):
188188
self.terminate(timeout=1.0)
189189

190190
def terminate(self, timeout=None):
191-
""" trigger exit of member gateways and wait for termination
191+
"""trigger exit of member gateways and wait for termination
192192
of member gateways and associated subprocesses. After waiting
193193
timeout seconds try to to kill local sub processes of popen-
194194
and ssh-gateways. Timeout defaults to None meaning
@@ -223,8 +223,8 @@ def kill(gw):
223223
self._gateways_to_join[:] = []
224224

225225
def remote_exec(self, source, **kwargs):
226-
""" remote_exec source on all member gateways and return
227-
MultiChannel connecting to all sub processes.
226+
"""remote_exec source on all member gateways and return
227+
MultiChannel connecting to all sub processes.
228228
"""
229229
channels = []
230230
for gw in self:

0 commit comments

Comments
 (0)