Skip to content

Commit 533fe49

Browse files
committed
Run pre-commit hooks
1 parent f074e51 commit 533fe49

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1256
-945
lines changed

ISSUES.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,25 @@ The PID identifies the subprocess which is used for further communication.
1919
Client http-exec subprocess
2020

2121
makegw("...") -> POST /popen -> Popen() with bootstrap
22-
(bootstrap)
22+
(bootstrap)
2323
<- PID
2424

2525
c=rexec(...) POST /exec/PID exec source
26-
(source)
26+
(source)
2727

2828
c.send(1) POST /exec/PID x = c.receive()
2929
(1) assert x == 1
3030
c.send(2)
3131

32-
z = c.receive() GET /exec/PID
32+
z = c.receive() GET /exec/PID
3333
<- (2)
3434
assert z == 2
3535

36-
The client connects via "POST /exec/PID"
37-
and pushes data to the remotely-executing code
36+
The client connects via "POST /exec/PID"
37+
and pushes data to the remotely-executing code
3838
in the subprocess.
3939

40-
The client connects via "GET /exec/PID"
40+
The client connects via "GET /exec/PID"
4141
and receives data from the remotely-executing code.
4242

4343
The client constructs a Channel() object which triggers
@@ -48,21 +48,21 @@ The code executing in the http-execserver controled
4848
subprocess is a PopenGateway. It does not know that it
4949
is connected via the http client/server machinery.
5050

51-
The http-execserver proxies data from the subprocess
51+
The http-execserver proxies data from the subprocess
5252
to the client. If there is no active GET request, the
5353
data is queued.
5454

5555
The http-execserver forwards data from the client to the
56-
subprocess, using the PID. If the subprocess is not
56+
subprocess, using the PID. If the subprocess is not
5757
connected, an ERROR code is returned.
5858

5959
Example session:
6060

6161
gw = group.makegateway("http=codespeak.net")
62-
62+
6363
def fun(channel):
6464
return channel.send(channel.receive()+1)
65-
65+
6666
ch = gw.remote_exec(fun)
6767
ch.send(1)
6868
x = ch.receive()
@@ -121,8 +121,8 @@ tags: 1.1 wish
121121

122122
If using channel.setcallback() it currently is not
123123
possible to notice the exact errors that might happen
124-
on the other side. Either introduce an "errback"
125-
or (probably better) optionally allow an extra 'error'
124+
on the other side. Either introduce an "errback"
125+
or (probably better) optionally allow an extra 'error'
126126
parameter to execnet callbacks.
127127

128128
fix rsync between python/jython

LICENSE

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@
55
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
66
copies of the Software, and to permit persons to whom the Software is
77
furnished to do so, subject to the following conditions:
8-
8+
99
The above copyright notice and this permission notice shall be included in all
1010
copies or substantial portions of the Software.
11-
11+
1212
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1313
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1414
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1515
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1616
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1717
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1818
SOFTWARE.
19-

doc/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
# -*- coding: utf-8 -*-
12
#

doc/basics.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,4 +246,3 @@ For more examples see :ref:`dumps/loads examples`.
246246

247247
.. autofunction:: execnet.dumps(spec)
248248
.. autofunction:: execnet.loads(spec)
249-

doc/conf.py

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
#
1111
# All configuration values have a default; values that are commented out
1212
# serve to show the default.
13-
14-
import sys
1513
import os
14+
import sys
15+
1616
# If extensions (or modules to document with autodoc) are in another directory,
1717
# add these directories to sys.path here. If the directory is relative to the
1818
# documentation root, use os.path.abspath to make it absolute, like shown here.
@@ -27,23 +27,23 @@
2727
# Add any Sphinx extension module names here, as strings.
2828
# They can be extensions
2929
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
30-
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest']
30+
extensions = ["sphinx.ext.autodoc", "sphinx.ext.doctest"]
3131

3232
# Add any paths that contain templates here, relative to this directory.
33-
templates_path = ['_templates']
33+
templates_path = ["_templates"]
3434

3535
# The suffix of source filenames.
36-
source_suffix = '.rst'
36+
source_suffix = ".rst"
3737

3838
# The encoding of source files.
3939
# source_encoding = 'utf-8'
4040

4141
# The master toctree document.
42-
master_doc = 'index'
42+
master_doc = "index"
4343

4444
# General information about the project.
45-
project = 'execnet'
46-
copyright = '2012, holger krekel and others'
45+
project = "execnet"
46+
copyright = "2012, holger krekel and others"
4747

4848
# The language for content autogenerated by Sphinx. Refer to documentation
4949
# for a list of supported languages.
@@ -60,7 +60,7 @@
6060

6161
# List of directories, relative to source directory, that shouldn't be searched
6262
# for source files.
63-
exclude_trees = ['_build']
63+
exclude_trees = ["_build"]
6464

6565
# The reST default role (used for this markup: `text`) to use for all documents
6666
# dfault_role = None
@@ -79,7 +79,7 @@
7979
# show_authors = False
8080

8181
# The name of the Pygments (syntax highlighting) style to use.
82-
pygments_style = 'sphinx'
82+
pygments_style = "sphinx"
8383

8484
# A list of ignored prefixes for module index sorting.
8585
# modindex_common_prefix = []
@@ -89,12 +89,10 @@
8989

9090
# The theme to use for HTML and HTML Help pages. Major themes that come with
9191
# Sphinx are currently 'default' and 'sphinxdoc'.
92-
html_theme = 'sphinxdoc'
92+
html_theme = "sphinxdoc"
9393

9494
# html_index = 'index.html'
95-
html_sidebars = {
96-
'index': ['indexsidebar.html'],
97-
}
95+
html_sidebars = {"index": ["indexsidebar.html"]}
9896
# html_additional_pages = {'index': 'index.html'}
9997

10098
# Theme options are theme-specific and customize the look and feel of a theme
@@ -124,7 +122,7 @@
124122
# Add any paths that contain custom static files (such as style sheets) here,
125123
# relative to this directory. They are copied after the builtin static files,
126124
# so a file named "default.css" will overwrite the builtin "default.css".
127-
html_static_path = ['_static']
125+
html_static_path = ["_static"]
128126

129127
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
130128
# using the given strftime format.
@@ -155,7 +153,7 @@
155153
# html_file_suffix = ''
156154

157155
# Output file base name for HTML help builder.
158-
htmlhelp_basename = 'execnetdoc'
156+
htmlhelp_basename = "execnetdoc"
159157

160158

161159
# -- Options for LaTeX output -------------------------------------------------
@@ -169,8 +167,13 @@
169167
# Grouping the document tree into LaTeX files. List of tuples
170168
# (source start file, target name, title, author, documentclass [howto/manual])
171169
latex_documents = [
172-
('index', 'execnet.tex', 'execnet Documentation',
173-
'holger krekel and others', 'manual'),
170+
(
171+
"index",
172+
"execnet.tex",
173+
"execnet Documentation",
174+
"holger krekel and others",
175+
"manual",
176+
)
174177
]
175178

176179
# The name of an image file (relative to this directory) to place at the top of

doc/example/conftest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
# -*- coding: utf-8 -*-
2+
import sys
13

2-
import py, sys
4+
import py
35

46
# make execnet and example code importable
57
cand = py.path.local(__file__).dirpath().dirpath().dirpath()
@@ -10,4 +12,4 @@
1012
if str(cand) not in sys.path:
1113
sys.path.insert(0, str(cand))
1214

13-
pytest_plugins = ['doctest']
15+
pytest_plugins = ["doctest"]

doc/example/funcmultiplier.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
1+
# -*- coding: utf-8 -*-
22
import execnet
33

4+
45
def multiplier(channel, factor):
56
while not channel.isclosed():
67
param = channel.receive()
78
channel.send(param * factor)
89

10+
911
gw = execnet.makegateway()
1012
channel = gw.remote_exec(multiplier, factor=10)
1113

doc/example/hybridpython.rst

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ Dumping and loading values across interpreter versions
88

99
.. versionadded:: 1.1
1010

11-
Execnet offers a new safe and fast :ref:`dumps/loads API` which you
12-
can use to dump builtin python data structures and load them
11+
Execnet offers a new safe and fast :ref:`dumps/loads API` which you
12+
can use to dump builtin python data structures and load them
1313
later with the same or a different python interpreter (including
1414
between Python2 and Python3). The standard library offers
1515
the pickle and marshal modules but they do not work safely
@@ -23,14 +23,14 @@ of bytecode/strings/unicode types. Here is an example::
2323
with open("data.py23", "wb") as f:
2424
f.write(execnet.dumps(["hello", "world"]))
2525

26-
# using Python3
26+
# using Python3
2727
import execnet
2828
with open("data.py23", "rb") as f:
2929
val = execnet.loads(f.read(), py2str_as_py3str=True)
3030
assert val == ["hello", "world"]
3131

3232
See the :ref:`dumps/loads API` for more details on string
33-
conversion options. Please note, that you can not dump
33+
conversion options. Please note, that you can not dump
3434
user-level instances, only builtin python types.
3535

3636
Connect to Python2/Numpy from Python3
@@ -151,5 +151,3 @@ using Mono 2.0 and IronPython-1.1 this will print on the CPython side::
151151
will work better. please feedback if you have information.
152152

153153
.. _IronPython: http://ironpython.net
154-
155-

doc/example/popen_read_multiple.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
1+
# -*- coding: utf-8 -*-
12
"""
23
example
34
45
reading results from possibly blocking code running in sub processes.
56
"""
67
from __future__ import print_function
8+
79
import execnet
810

911
NUM_PROCESSES = 5
1012

1113
channels = []
1214
for i in range(NUM_PROCESSES):
13-
gw = execnet.makegateway() # or use SSH or socket gateways
14-
channel = gw.remote_exec("""
15+
gw = execnet.makegateway() # or use SSH or socket gateways
16+
channel = gw.remote_exec(
17+
"""
1518
import time
1619
secs = channel.receive()
1720
time.sleep(secs)
1821
channel.send("waited %d secs" % secs)
19-
""")
22+
"""
23+
)
2024
channels.append(channel)
2125
print("*** instantiated subprocess", gw)
2226

doc/example/py3topy2.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
1+
# -*- coding: utf-8 -*-
22
import execnet
3+
34
gw = execnet.makegateway("popen//python=python2")
4-
channel = gw.remote_exec("""
5+
channel = gw.remote_exec(
6+
"""
57
import numpy
68
array = numpy.array([1,2,3])
79
while 1:
@@ -10,8 +12,9 @@
1012
break
1113
array = numpy.append(array, x)
1214
channel.send(repr(array))
13-
""")
15+
"""
16+
)
1417
for x in range(10):
1518
channel.send(x)
1619
channel.send(None)
17-
print (channel.receive())
20+
print(channel.receive())

0 commit comments

Comments
 (0)