Skip to content

Commit 7a19c27

Browse files
authored
Merge pull request #167 from kianmeng/fix-typos-add-codespell-hook
Fix typos and add `codespell` hook to pre-commit
2 parents 8b82101 + 2a8b68c commit 7a19c27

15 files changed

+35
-31
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
exclude: doc/en/example/py2py3/test_py2.py
22
repos:
3+
- repo: https://github.com/codespell-project/codespell
4+
rev: v2.2.2
5+
hooks:
6+
- id: codespell
37
- repo: https://github.com/psf/black
48
rev: 22.12.0
59
hooks:

CHANGELOG.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
with previous versions and future versions
104104
additionally stored serialized objects containing complex objects will
105105
have a incompatible opcode when read with execnet < 1.4.0
106-
and wont be loadable with execnet 1.4.0 either
106+
and won't be loadable with execnet 1.4.0 either
107107

108108
its strongly suggested to avoid using the Serializer of execnet 1.4.0
109109
this affects devpi and the external pytest-cache plugin
@@ -157,7 +157,7 @@
157157

158158
- gateway.remote_exec() will now execute in multiple
159159
threads on the other side by default. The previous
160-
neccessity of running "gateway.remote_init_threads()"
160+
necessity of running "gateway.remote_init_threads()"
161161
to allow for such concurrency is gone. The latter
162162
method is now a no-op and will be removed in future
163163
versions of execnet.
@@ -228,7 +228,7 @@
228228
- fix issue #2 - properly reconfigure the channels string coercion for rsync,
229229
so it can send from python2 to python3
230230

231-
- fix issue #9 - propperly terminate the worker threadpools in safe_terminate
231+
- fix issue #9 - properly terminate the worker threadpools in safe_terminate
232232
- fix issue #8 - no longer kill remote pids locally on jython ssh gateways
233233

234234
- refactor socketserver, so it can be directly remote_exec'd for starting a socket gateway on a remote
@@ -257,7 +257,7 @@
257257
1.0.8
258258
--------------------------------
259259

260-
- new ``gateway.remote_exec(func, **kwargs)`` style fo executing
260+
- new ``gateway.remote_exec(func, **kwargs)`` style for executing
261261
a pure function with parameters. The function on the remote
262262
side also needs to accept a ``channel`` which allows it to
263263
communicate back and forth. Thanks to Ronny Pfannschmidt
@@ -336,7 +336,7 @@
336336

337337
- automatically close a channel when a remote callback raises
338338
an exception, makes communication more robust because until
339-
now failing callbacks rendered the receiverthread unuseable
339+
now failing callbacks rendered the receiverthread unusable
340340
leaving the remote side in-accessible.
341341

342342
- internally split socket gateways, speeds up popen-gateways

ISSUES.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The client constructs a Channel() object which triggers
4444
these two connections, presenting a nice send/receive
4545
abstractions.
4646

47-
The code executing in the http-execserver controled
47+
The code executing in the http-execserver controlled
4848
subprocess is a PopenGateway. It does not know that it
4949
is connected via the http client/server machinery.
5050

@@ -76,7 +76,7 @@ tags: 1.1 feature newdist
7676
A building block for establishing a permanent hierarchy
7777
of processes is a Gateway that operates on a Channel object.
7878
This way a gateway can be instantiated through another
79-
intermediating gateway which bi-directionallry forwads
79+
intermediating gateway which bi-directionallry forwards
8080
Messages through a existing channel.
8181

8282
A code example could look like this:
@@ -89,7 +89,7 @@ A code example could look like this:
8989
# on the remote place such that the same ssh connection is re-used
9090
# for multiple ssh=codespeak.net connections, makes for small latency.
9191

92-
some first simple implemenation might look like this::
92+
some first simple implementation might look like this::
9393

9494
gw = group.makegateway("socketservice//port=8888")
9595
# we can rely that the subprocess gw can import execnet

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Important
2323

2424
execnet_ provides carefully tested means to ad-hoc interact with Python
2525
interpreters across version, platform and network barriers. It provides
26-
a minimal and fast API targetting the following uses:
26+
a minimal and fast API targeting the following uses:
2727

2828
* distribute tasks to local or remote processes
2929
* write and deploy hybrid multi-process applications

doc/basics.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ and manage the final termination procedure:
130130

131131
.. automethod:: Group.terminate(timeout=None)
132132

133-
This method is implicitely called for each gateway group at
133+
This method is implicitly called for each gateway group at
134134
process-exit, using a small timeout. This is fine
135135
for interactive sessions or random scripts which
136136
you rather like to error out than hang. If you start many

doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ all major computing platforms today.
1515
**execnet** provides a `share-nothing model`_ with `channel-send/receive`_
1616
communication for distributing execution across many Python interpreters
1717
across version, platform and network barriers. It has
18-
a minimal and fast API targetting the following uses:
18+
a minimal and fast API targeting the following uses:
1919

2020
* distribute tasks to (many) local or remote CPUs
2121
* write and deploy hybrid multi-process applications

execnet/gateway.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919

2020
class Gateway(gateway_base.BaseGateway):
21-
"""Gateway to a local or remote Python Intepreter."""
21+
"""Gateway to a local or remote Python Interpreter."""
2222

2323
def __init__(self, io, spec):
2424
super().__init__(io=io, id=spec.id, _startcount=1)
@@ -188,8 +188,8 @@ def _find_non_builtin_globals(source, codeobj):
188188
def _source_of_function(function):
189189
if function.__name__ == "<lambda>":
190190
raise ValueError("can't evaluate lambda functions'")
191-
# XXX: we dont check before remote instanciation
192-
# if arguments are used propperly
191+
# XXX: we dont check before remote instantiation
192+
# if arguments are used properly
193193
try:
194194
sig = inspect.getfullargspec(function)
195195
except AttributeError:

execnet/gateway_base.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ def from_io(io):
403403
raise EOFError("empty read")
404404
except EOFError:
405405
e = sys.exc_info()[1]
406-
raise EOFError("couldnt load message header, " + e.args[0])
406+
raise EOFError("couldn't load message header, " + e.args[0])
407407
msgtype, channel, payload = struct.unpack("!bii", header)
408408
return Message(msgtype, channel, io.read(payload))
409409

@@ -634,13 +634,13 @@ def makefile(self, mode="w", proxyclose=False):
634634
return ChannelFileWrite(channel=self, proxyclose=proxyclose)
635635
elif mode == "r":
636636
return ChannelFileRead(channel=self, proxyclose=proxyclose)
637-
raise ValueError(f"mode {mode!r} not availabe")
637+
raise ValueError(f"mode {mode!r} not available")
638638

639639
def close(self, error=None):
640640
"""close down this channel with an optional error message.
641641
Note that closing of a channel tied to remote_exec happens
642642
automatically at the end of execution and cannot
643-
be done explicitely.
643+
be done explicitly.
644644
"""
645645
if self._executing:
646646
raise OSError("cannot explicitly close channel within remote_exec")
@@ -760,7 +760,7 @@ def new(self, id=None):
760760
"""create a new Channel with 'id' (or create new id if None)."""
761761
with self._writelock:
762762
if self.finished:
763-
raise OSError(f"connexion already closed: {self.gateway}")
763+
raise OSError(f"connection already closed: {self.gateway}")
764764
if id is None:
765765
id = self.count
766766
self.count += 2
@@ -1130,7 +1130,7 @@ def load(self, versioned=False):
11301130
loader = self.num2func[opcode]
11311131
except KeyError:
11321132
raise LoadError(
1133-
"unkown opcode %r - " "wire protocol corruption?" % (opcode,)
1133+
"unknown opcode %r - " "wire protocol corruption?" % (opcode,)
11341134
)
11351135
loader(self)
11361136
except _Stop:
@@ -1331,7 +1331,7 @@ def __init__(self, write=None):
13311331
def save(self, obj, versioned=False):
13321332
# calling here is not re-entrant but multiple instances
13331333
# may write to the same stream because of the common platform
1334-
# atomic-write guaruantee (concurrent writes each happen atomicly)
1334+
# atomic-write guarantee (concurrent writes each happen atomically)
13351335
if versioned:
13361336
self._write(DUMPFORMAT_VERSION)
13371337
self._save(obj)

execnet/gateway_bootstrap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def bootstrap(io, spec):
103103
elif spec.socket:
104104
bootstrap_socket(io, spec)
105105
else:
106-
raise ValueError("unknown gateway type, cant bootstrap")
106+
raise ValueError("unknown gateway type, can't bootstrap")
107107
gw = Gateway(io, spec)
108108
fix_pid_for_jython_popen(gw)
109109
return gw

execnet/gateway_io.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def forward_to_sub(data):
212212

213213
proxy_channelX.setcallback(forward_to_sub)
214214

215-
def controll(data):
215+
def control(data):
216216
if data == RIO_WAIT:
217217
control_chan.send(sub_io.wait())
218218
elif data == RIO_KILL:
@@ -222,7 +222,7 @@ def controll(data):
222222
elif data == RIO_CLOSE_WRITE:
223223
control_chan.send(sub_io.close_write())
224224

225-
control_chan.setcallback(controll)
225+
control_chan.setcallback(control)
226226

227227
# write data to the master coming from the sub
228228
forward_to_master_file = proxy_channelX.makefile("w")

0 commit comments

Comments
 (0)