Skip to content

Commit 8f4b5de

Browse files
committed
update copyright
1 parent e780af9 commit 8f4b5de

File tree

21 files changed

+237
-134
lines changed

21 files changed

+237
-134
lines changed

py5jupyter/__init__.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# *****************************************************************************
22
#
33
# Part of the py5jupyter (& py5) library
4-
# Copyright (C) 2022-2023 Jim Schmitz
4+
# Copyright (C) 2022-2024 Jim Schmitz
55
#
66
# This library is free software: you can redistribute it and/or modify it
77
# under the terms of the GNU Lesser General Public License as published by
@@ -33,10 +33,12 @@ def _jupyter_labextension_paths():
3333
from `src` directory into <jupyter path>/labextensions/<dest> directory
3434
during widget installation
3535
"""
36-
return [{
37-
'src': 'labextension',
38-
'dest': 'jupyter-py5',
39-
}]
36+
return [
37+
{
38+
"src": "labextension",
39+
"dest": "jupyter-py5",
40+
}
41+
]
4042

4143

4244
def _jupyter_nbextension_paths():
@@ -55,9 +57,11 @@ def _jupyter_nbextension_paths():
5557
require: Path to importable AMD Javascript module inside the
5658
<jupyter path>/nbextensions/<dest> directory
5759
"""
58-
return [{
59-
'section': 'notebook',
60-
'src': 'nbextension',
61-
'dest': 'py5jupyter',
62-
'require': 'py5jupyter/extension'
63-
}]
60+
return [
61+
{
62+
"section": "notebook",
63+
"src": "nbextension",
64+
"dest": "py5jupyter",
65+
"require": "py5jupyter/extension",
66+
}
67+
]

py5jupyter/_version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# *****************************************************************************
22
#
33
# Part of the py5jupyter (& py5) library
4-
# Copyright (C) 2022-2023 Jim Schmitz
4+
# Copyright (C) 2022-2024 Jim Schmitz
55
#
66
# This library is free software: you can redistribute it and/or modify it
77
# under the terms of the GNU Lesser General Public License as published by
@@ -17,5 +17,5 @@
1717
# along with this library. If not, see <https://www.gnu.org/licenses/>.
1818
#
1919
# *****************************************************************************
20-
version_info = (0, 2, 0, 'a0')
20+
version_info = (0, 2, 0, "a0")
2121
__version__ = ".".join(map(str, version_info))

py5jupyter/kernels/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# *****************************************************************************
22
#
33
# Part of the py5jupyter (& py5) library
4-
# Copyright (C) 2022-2023 Jim Schmitz
4+
# Copyright (C) 2022-2024 Jim Schmitz
55
#
66
# This library is free software: you can redistribute it and/or modify it
77
# under the terms of the GNU Lesser General Public License as published by

py5jupyter/kernels/py5/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# *****************************************************************************
22
#
33
# Part of the py5jupyter (& py5) library
4-
# Copyright (C) 2022-2023 Jim Schmitz
4+
# Copyright (C) 2022-2024 Jim Schmitz
55
#
66
# This library is free software: you can redistribute it and/or modify it
77
# under the terms of the GNU Lesser General Public License as published by

py5jupyter/kernels/py5/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# *****************************************************************************
22
#
33
# Part of the py5jupyter (& py5) library
4-
# Copyright (C) 2022-2023 Jim Schmitz
4+
# Copyright (C) 2022-2024 Jim Schmitz
55
#
66
# This library is free software: you can redistribute it and/or modify it
77
# under the terms of the GNU Lesser General Public License as published by

py5jupyter/kernels/py5/install.py

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# *****************************************************************************
22
#
33
# Part of the py5jupyter (& py5) library
4-
# Copyright (C) 2022-2023 Jim Schmitz
4+
# Copyright (C) 2022-2024 Jim Schmitz
55
#
66
# This library is free software: you can redistribute it and/or modify it
77
# under the terms of the GNU Lesser General Public License as published by
@@ -38,16 +38,15 @@
3838
def install_py5_kernel_spec(user=True, prefix=None):
3939
with TemporaryDirectory() as td:
4040
os.chmod(td, 0o755) # Starts off as 700, not user readable
41-
with open(Path(td) / 'kernel.json', 'w') as f:
41+
with open(Path(td) / "kernel.json", "w") as f:
4242
json.dump(kernel_json, f, sort_keys=True)
4343

4444
# Copy any resources
45-
for file in (Path(__file__).parent / 'resources').glob('*'):
45+
for file in (Path(__file__).parent / "resources").glob("*"):
4646
shutil.copy(file, Path(td) / file.name)
4747

48-
print('Installing py5 Jupyter kernel spec')
49-
KernelSpecManager().install_kernel_spec(
50-
td, 'py5', user=user, prefix=prefix)
48+
print("Installing py5 Jupyter kernel spec")
49+
KernelSpecManager().install_kernel_spec(td, "py5", user=user, prefix=prefix)
5150

5251

5352
def _is_root():
@@ -59,13 +58,21 @@ def _is_root():
5958

6059
def main(argv=None):
6160
ap = argparse.ArgumentParser()
62-
ap.add_argument('--user', action='store_true',
63-
help="Install to the per-user kernels registry. Default if not root.")
64-
ap.add_argument('--sys-prefix', action='store_true',
65-
help="Install to sys.prefix (e.g. a virtualenv or conda env)")
66-
ap.add_argument('--prefix',
67-
help="Install to the given prefix. "
68-
"Kernelspec will be installed in {PREFIX}/share/jupyter/kernels/")
61+
ap.add_argument(
62+
"--user",
63+
action="store_true",
64+
help="Install to the per-user kernels registry. Default if not root.",
65+
)
66+
ap.add_argument(
67+
"--sys-prefix",
68+
action="store_true",
69+
help="Install to sys.prefix (e.g. a virtualenv or conda env)",
70+
)
71+
ap.add_argument(
72+
"--prefix",
73+
help="Install to the given prefix. "
74+
"Kernelspec will be installed in {PREFIX}/share/jupyter/kernels/",
75+
)
6976
args = ap.parse_args(argv)
7077

7178
if args.sys_prefix:
@@ -76,5 +83,5 @@ def main(argv=None):
7683
install_py5_kernel_spec(user=args.user, prefix=args.prefix)
7784

7885

79-
if __name__ == '__main__':
86+
if __name__ == "__main__":
8087
main()

py5jupyter/kernels/py5/kernel.py

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# *****************************************************************************
22
#
33
# Part of the py5jupyter (& py5) library
4-
# Copyright (C) 2022-2023 Jim Schmitz
4+
# Copyright (C) 2022-2024 Jim Schmitz
55
#
66
# This library is free software: you can redistribute it and/or modify it
77
# under the terms of the GNU Lesser General Public License as published by
@@ -30,13 +30,10 @@
3030
from py5_tools import __version__ as __py5_version__
3131

3232
_PY5_HELP_LINKS = [
33+
{"text": "py5 Documentation", "url": "http://py5coding.org/"},
3334
{
34-
'text': 'py5 Documentation',
35-
'url': 'http://py5coding.org/'
36-
},
37-
{
38-
'text': 'py5 Function Reference',
39-
'url': 'http://py5coding.org/reference/sketch.html'
35+
"text": "py5 Function Reference",
36+
"url": "http://py5coding.org/reference/sketch.html",
4037
},
4138
]
4239

@@ -51,39 +48,50 @@
5148
from py5_tools import sketch_portal
5249
"""
5350

54-
_KERNEL_STARTUP = (_MACOSX_PRE_STARTUP if sys.platform == 'darwin' else "") + _DEFAULT_STARTUP
51+
_KERNEL_STARTUP = (
52+
_MACOSX_PRE_STARTUP if sys.platform == "darwin" else ""
53+
) + _DEFAULT_STARTUP
5554

5655

5756
class Py5Shell(ZMQInteractiveShell):
5857

59-
ast_transformers = List([TransformDynamicVariablesToCalls(), Py5CodeValidation()]).tag(config=True)
58+
ast_transformers = List(
59+
[TransformDynamicVariablesToCalls(), Py5CodeValidation()]
60+
).tag(config=True)
6061

61-
banner2 = Unicode("py5 " + __py5_version__ + " | py5 kernel 0.1.3a0 | A Python Jupyter kernel plus py5 in imported mode").tag(config=True)
62+
banner2 = Unicode(
63+
"py5 "
64+
+ __py5_version__
65+
+ " | py5 kernel 0.1.3a0 | A Python Jupyter kernel plus py5 in imported mode"
66+
).tag(config=True)
6267

6368

6469
InteractiveShellABC.register(Py5Shell)
6570

6671

6772
class Py5Kernel(IPythonKernel):
68-
shell = Instance('IPython.core.interactiveshell.InteractiveShellABC',
69-
allow_none=True)
73+
shell = Instance(
74+
"IPython.core.interactiveshell.InteractiveShellABC", allow_none=True
75+
)
7076
shell_class = Type(Py5Shell)
7177

72-
help_links = List([*IPythonKernel.help_links.default(),
73-
*_PY5_HELP_LINKS]).tag(config=True)
78+
help_links = List([*IPythonKernel.help_links.default(), *_PY5_HELP_LINKS]).tag(
79+
config=True
80+
)
7481

75-
implementation = 'py5'
76-
implementation_version = '0.1.3a0'
82+
implementation = "py5"
83+
implementation_version = "0.1.3a0"
7784

7885

7986
class Py5App(IPKernelApp):
80-
name = 'py5-kernel'
87+
name = "py5-kernel"
8188

82-
kernel_class = Type('py5jupyter.kernels.py5.Py5Kernel',
83-
klass='ipykernel.kernelbase.Kernel').tag(config=True)
89+
kernel_class = Type(
90+
"py5jupyter.kernels.py5.Py5Kernel", klass="ipykernel.kernelbase.Kernel"
91+
).tag(config=True)
8492

85-
exec_lines = List(Unicode(), [
86-
_KERNEL_STARTUP
87-
]).tag(config=True)
93+
exec_lines = List(Unicode(), [_KERNEL_STARTUP]).tag(config=True)
8894

89-
extensions = List(Unicode(), ['py5_tools.magics', 'py5_tools.magics.py5bot']).tag(config=True)
95+
extensions = List(Unicode(), ["py5_tools.magics", "py5_tools.magics.py5bot"]).tag(
96+
config=True
97+
)

py5jupyter/kernels/py5bot/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# *****************************************************************************
22
#
33
# Part of the py5jupyter (& py5) library
4-
# Copyright (C) 2022-2023 Jim Schmitz
4+
# Copyright (C) 2022-2024 Jim Schmitz
55
#
66
# This library is free software: you can redistribute it and/or modify it
77
# under the terms of the GNU Lesser General Public License as published by

py5jupyter/kernels/py5bot/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# *****************************************************************************
22
#
33
# Part of the py5jupyter (& py5) library
4-
# Copyright (C) 2022-2023 Jim Schmitz
4+
# Copyright (C) 2022-2024 Jim Schmitz
55
#
66
# This library is free software: you can redistribute it and/or modify it
77
# under the terms of the GNU Lesser General Public License as published by

py5jupyter/kernels/py5bot/install.py

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# *****************************************************************************
22
#
33
# Part of the py5jupyter (& py5) library
4-
# Copyright (C) 2022-2023 Jim Schmitz
4+
# Copyright (C) 2022-2024 Jim Schmitz
55
#
66
# This library is free software: you can redistribute it and/or modify it
77
# under the terms of the GNU Lesser General Public License as published by
@@ -29,7 +29,13 @@
2929

3030

3131
kernel_json = {
32-
"argv": [sys.executable, "-m", "py5jupyter.kernels.py5bot", "-f", "{connection_file}"],
32+
"argv": [
33+
sys.executable,
34+
"-m",
35+
"py5jupyter.kernels.py5bot",
36+
"-f",
37+
"{connection_file}",
38+
],
3339
"display_name": "py5bot",
3440
"language": "python",
3541
}
@@ -38,16 +44,15 @@
3844
def install_py5bot_kernel_spec(user=True, prefix=None):
3945
with TemporaryDirectory() as td:
4046
os.chmod(td, 0o755) # Starts off as 700, not user readable
41-
with open(Path(td) / 'kernel.json', 'w') as f:
47+
with open(Path(td) / "kernel.json", "w") as f:
4248
json.dump(kernel_json, f, sort_keys=True)
4349

4450
# Copy any resources
45-
for file in (Path(__file__).parent / 'resources').glob('*'):
51+
for file in (Path(__file__).parent / "resources").glob("*"):
4652
shutil.copy(file, Path(td) / file.name)
4753

48-
print('Installing py5bot Jupyter kernel spec')
49-
KernelSpecManager().install_kernel_spec(
50-
td, 'py5bot', user=user, prefix=prefix)
54+
print("Installing py5bot Jupyter kernel spec")
55+
KernelSpecManager().install_kernel_spec(td, "py5bot", user=user, prefix=prefix)
5156

5257

5358
def _is_root():
@@ -59,13 +64,21 @@ def _is_root():
5964

6065
def main(argv=None):
6166
ap = argparse.ArgumentParser()
62-
ap.add_argument('--user', action='store_true',
63-
help="Install to the per-user kernels registry. Default if not root.")
64-
ap.add_argument('--sys-prefix', action='store_true',
65-
help="Install to sys.prefix (e.g. a virtualenv or conda env)")
66-
ap.add_argument('--prefix',
67-
help="Install to the given prefix. "
68-
"Kernelspec will be installed in {PREFIX}/share/jupyter/kernels/")
67+
ap.add_argument(
68+
"--user",
69+
action="store_true",
70+
help="Install to the per-user kernels registry. Default if not root.",
71+
)
72+
ap.add_argument(
73+
"--sys-prefix",
74+
action="store_true",
75+
help="Install to sys.prefix (e.g. a virtualenv or conda env)",
76+
)
77+
ap.add_argument(
78+
"--prefix",
79+
help="Install to the given prefix. "
80+
"Kernelspec will be installed in {PREFIX}/share/jupyter/kernels/",
81+
)
6982
args = ap.parse_args(argv)
7083

7184
if args.sys_prefix:
@@ -76,5 +89,5 @@ def main(argv=None):
7689
install_py5bot_kernel_spec(user=args.user, prefix=args.prefix)
7790

7891

79-
if __name__ == '__main__':
92+
if __name__ == "__main__":
8093
main()

0 commit comments

Comments
 (0)