nodpy 0.1.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nodpy-0.1.3/.copier-answers.yml +15 -0
- nodpy-0.1.3/.gitignore +140 -0
- nodpy-0.1.3/.prettierignore +6 -0
- nodpy-0.1.3/.vscode/settings.json +4 -0
- nodpy-0.1.3/.yarnrc.yml +2 -0
- nodpy-0.1.3/CHANGELOG.md +5 -0
- nodpy-0.1.3/CONTRIBUTING.md +96 -0
- nodpy-0.1.3/DEVELOPMENT.md +116 -0
- nodpy-0.1.3/LICENSE +29 -0
- nodpy-0.1.3/PKG-INFO +98 -0
- nodpy-0.1.3/README.md +26 -0
- nodpy-0.1.3/RELEASE.md +80 -0
- nodpy-0.1.3/babel.config.js +1 -0
- nodpy-0.1.3/conftest.py +8 -0
- nodpy-0.1.3/install.json +5 -0
- nodpy-0.1.3/jest.config.js +28 -0
- nodpy-0.1.3/jupyter-config/server-config/nodpy.json +7 -0
- nodpy-0.1.3/nodpy/__init__.py +451 -0
- nodpy-0.1.3/nodpy/_version.py +4 -0
- nodpy-0.1.3/nodpy/ast_tools.py +176 -0
- nodpy-0.1.3/nodpy/datastore.py +21 -0
- nodpy-0.1.3/nodpy/embed_kernel.py +305 -0
- nodpy-0.1.3/nodpy/file_helpers.py +246 -0
- nodpy-0.1.3/nodpy/hatch_build.py +52 -0
- nodpy-0.1.3/nodpy/ip_plugin.py +72 -0
- nodpy-0.1.3/nodpy/labextension/package.json +232 -0
- nodpy-0.1.3/nodpy/labextension/schemas/nodjs/package.json.orig +227 -0
- nodpy-0.1.3/nodpy/labextension/schemas/nodjs/plugin.json +46 -0
- nodpy-0.1.3/nodpy/labextension/static/298.1fa66e2cd2088e804334.js +1 -0
- nodpy-0.1.3/nodpy/labextension/static/728.12765e602400f37a118b.js +1 -0
- nodpy-0.1.3/nodpy/labextension/static/781.8294abe512b48b00402a.js +1 -0
- nodpy-0.1.3/nodpy/labextension/static/835.4539cede11218d7fe226.js +1 -0
- nodpy-0.1.3/nodpy/labextension/static/remoteEntry.f340994a4ea855dbfc8a.js +1 -0
- nodpy-0.1.3/nodpy/labextension/static/style.js +4 -0
- nodpy-0.1.3/nodpy/labextension/static/third-party-licenses.json +64 -0
- nodpy-0.1.3/nodpy/nod_cli.py +184 -0
- nodpy-0.1.3/nodpy/provisioner.py +461 -0
- nodpy-0.1.3/nodpy/serverExtension.py +202 -0
- nodpy-0.1.3/nodpy/tests/__init__.py +1 -0
- nodpy-0.1.3/nodpy/tracing.py +28 -0
- nodpy-0.1.3/package.json +227 -0
- nodpy-0.1.3/pyproject.toml +114 -0
- nodpy-0.1.3/requirements.txt +147 -0
- nodpy-0.1.3/schema/plugin.json +46 -0
- nodpy-0.1.3/setup.py +1 -0
- nodpy-0.1.3/simpletest.py +27 -0
- nodpy-0.1.3/src/__tests__/nodpy.spec.ts +9 -0
- nodpy-0.1.3/src/buttons.tsx +91 -0
- nodpy-0.1.3/src/callstack/body.tsx +404 -0
- nodpy-0.1.3/src/callstack/index.ts +163 -0
- nodpy-0.1.3/src/callstack/model.ts +170 -0
- nodpy-0.1.3/src/codeViewers.ts +177 -0
- nodpy-0.1.3/src/commands.ts +292 -0
- nodpy-0.1.3/src/index.ts +352 -0
- nodpy-0.1.3/src/interfaceHelpers.ts +124 -0
- nodpy-0.1.3/src/kernelHelpers.ts +313 -0
- nodpy-0.1.3/src/messaging.ts +113 -0
- nodpy-0.1.3/src/readOnlyHeader.tsx +23 -0
- nodpy-0.1.3/src/request.ts +46 -0
- nodpy-0.1.3/src/state.ts +224 -0
- nodpy-0.1.3/src/types.ts +46 -0
- nodpy-0.1.3/style/base.css +55 -0
- nodpy-0.1.3/style/index.css +1 -0
- nodpy-0.1.3/style/index.js +1 -0
- nodpy-0.1.3/test/__init__.py +0 -0
- nodpy-0.1.3/test/moduleA.py +14 -0
- nodpy-0.1.3/test/moduleB.py +5 -0
- nodpy-0.1.3/test/moduleC.py +16 -0
- nodpy-0.1.3/tsconfig.json +32 -0
- nodpy-0.1.3/tsconfig.test.json +3 -0
- nodpy-0.1.3/ui-tests/README.md +167 -0
- nodpy-0.1.3/ui-tests/jupyter_server_test_config.py +12 -0
- nodpy-0.1.3/ui-tests/package.json +15 -0
- nodpy-0.1.3/ui-tests/playwright.config.js +14 -0
- nodpy-0.1.3/ui-tests/tests/nodpy.spec.ts +21 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
|
|
2
|
+
_commit: v4.5.2
|
|
3
|
+
_src_path: https://github.com/jupyterlab/extension-template
|
|
4
|
+
author_email: erawn65@gmail.com
|
|
5
|
+
author_name: Eric Rawn
|
|
6
|
+
has_ai_rules: false
|
|
7
|
+
has_binder: true
|
|
8
|
+
has_settings: true
|
|
9
|
+
kind: frontend-and-server
|
|
10
|
+
labextension_name: nodjs
|
|
11
|
+
project_short_description: A JupyterLab extension.
|
|
12
|
+
python_name: nodpy
|
|
13
|
+
repository: ''
|
|
14
|
+
test: true
|
|
15
|
+
|
nodpy-0.1.3/.gitignore
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
*.bundle.*
|
|
2
|
+
lib/
|
|
3
|
+
node_modules/
|
|
4
|
+
*.log
|
|
5
|
+
.eslintcache
|
|
6
|
+
.stylelintcache
|
|
7
|
+
*.egg-info/
|
|
8
|
+
.ipynb_checkpoints
|
|
9
|
+
*.tsbuildinfo
|
|
10
|
+
nodpy/labextension
|
|
11
|
+
# Version file is handled by hatchling
|
|
12
|
+
nodpy/_version.py
|
|
13
|
+
**/*.ipynb
|
|
14
|
+
# Integration tests
|
|
15
|
+
ui-tests/test-results/
|
|
16
|
+
ui-tests/playwright-report/
|
|
17
|
+
|
|
18
|
+
# Created by https://www.gitignore.io/api/python
|
|
19
|
+
# Edit at https://www.gitignore.io/?templates=python
|
|
20
|
+
|
|
21
|
+
### Python ###
|
|
22
|
+
# Virtual environments
|
|
23
|
+
.venv
|
|
24
|
+
|
|
25
|
+
# Byte-compiled / optimized / DLL files
|
|
26
|
+
__pycache__/
|
|
27
|
+
*.py[cod]
|
|
28
|
+
*$py.class
|
|
29
|
+
|
|
30
|
+
# C extensions
|
|
31
|
+
*.so
|
|
32
|
+
|
|
33
|
+
# Distribution / packaging
|
|
34
|
+
.Python
|
|
35
|
+
build/
|
|
36
|
+
develop-eggs/
|
|
37
|
+
dist/
|
|
38
|
+
downloads/
|
|
39
|
+
eggs/
|
|
40
|
+
.eggs/
|
|
41
|
+
lib/
|
|
42
|
+
lib64/
|
|
43
|
+
parts/
|
|
44
|
+
sdist/
|
|
45
|
+
var/
|
|
46
|
+
wheels/
|
|
47
|
+
pip-wheel-metadata/
|
|
48
|
+
share/python-wheels/
|
|
49
|
+
.installed.cfg
|
|
50
|
+
*.egg
|
|
51
|
+
MANIFEST
|
|
52
|
+
|
|
53
|
+
# PyInstaller
|
|
54
|
+
# Usually these files are written by a python script from a template
|
|
55
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
56
|
+
*.manifest
|
|
57
|
+
*.spec
|
|
58
|
+
|
|
59
|
+
# Installer logs
|
|
60
|
+
pip-log.txt
|
|
61
|
+
pip-delete-this-directory.txt
|
|
62
|
+
|
|
63
|
+
# Unit test / coverage reports
|
|
64
|
+
htmlcov/
|
|
65
|
+
.tox/
|
|
66
|
+
.nox/
|
|
67
|
+
.coverage
|
|
68
|
+
.coverage.*
|
|
69
|
+
.cache
|
|
70
|
+
nosetests.xml
|
|
71
|
+
coverage/
|
|
72
|
+
coverage.xml
|
|
73
|
+
*.cover
|
|
74
|
+
.hypothesis/
|
|
75
|
+
.pytest_cache/
|
|
76
|
+
|
|
77
|
+
# Translations
|
|
78
|
+
*.mo
|
|
79
|
+
*.pot
|
|
80
|
+
|
|
81
|
+
# Scrapy stuff:
|
|
82
|
+
.scrapy
|
|
83
|
+
|
|
84
|
+
# Sphinx documentation
|
|
85
|
+
docs/_build/
|
|
86
|
+
|
|
87
|
+
# PyBuilder
|
|
88
|
+
target/
|
|
89
|
+
|
|
90
|
+
# pyenv
|
|
91
|
+
.python-version
|
|
92
|
+
|
|
93
|
+
# celery beat schedule file
|
|
94
|
+
celerybeat-schedule
|
|
95
|
+
|
|
96
|
+
# SageMath parsed files
|
|
97
|
+
*.sage.py
|
|
98
|
+
|
|
99
|
+
# Spyder project settings
|
|
100
|
+
.spyderproject
|
|
101
|
+
.spyproject
|
|
102
|
+
|
|
103
|
+
# Rope project settings
|
|
104
|
+
.ropeproject
|
|
105
|
+
|
|
106
|
+
# Mr Developer
|
|
107
|
+
.mr.developer.cfg
|
|
108
|
+
.project
|
|
109
|
+
.pydevproject
|
|
110
|
+
|
|
111
|
+
# mkdocs documentation
|
|
112
|
+
/site
|
|
113
|
+
|
|
114
|
+
# mypy
|
|
115
|
+
.mypy_cache/
|
|
116
|
+
.dmypy.json
|
|
117
|
+
dmypy.json
|
|
118
|
+
|
|
119
|
+
# Pyre type checker
|
|
120
|
+
.pyre/
|
|
121
|
+
|
|
122
|
+
# End of https://www.gitignore.io/api/python
|
|
123
|
+
|
|
124
|
+
# OSX files
|
|
125
|
+
.DS_Store
|
|
126
|
+
|
|
127
|
+
# Yarn cache
|
|
128
|
+
.yarn/
|
|
129
|
+
|
|
130
|
+
test*.py
|
|
131
|
+
nod/_version.py
|
|
132
|
+
tsconfig.tsbuildinfo
|
|
133
|
+
comp.txt
|
|
134
|
+
.fileid.db
|
|
135
|
+
nod/_version.py
|
|
136
|
+
tsconfig.tsbuildinfo
|
|
137
|
+
.nod/**
|
|
138
|
+
.nod
|
|
139
|
+
tsconfig.tsbuildinfo
|
|
140
|
+
yarn.lock
|
nodpy-0.1.3/.yarnrc.yml
ADDED
nodpy-0.1.3/CHANGELOG.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
## Contributing
|
|
2
|
+
|
|
3
|
+
### Development install
|
|
4
|
+
|
|
5
|
+
Note: You will need NodeJS to build the extension package.
|
|
6
|
+
|
|
7
|
+
The `jlpm` command is JupyterLab's pinned version of
|
|
8
|
+
[yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use
|
|
9
|
+
`yarn` or `npm` in lieu of `jlpm` below.
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Clone the repo to your local environment
|
|
13
|
+
# Change directory to the nodpy directory
|
|
14
|
+
|
|
15
|
+
# Set up a virtual environment and install package in development mode
|
|
16
|
+
python -m venv .venv
|
|
17
|
+
source .venv/bin/activate
|
|
18
|
+
pip install --editable ".[dev,test]"
|
|
19
|
+
|
|
20
|
+
# Link your development version of the extension with JupyterLab
|
|
21
|
+
jupyter labextension develop . --overwrite
|
|
22
|
+
# Server extension must be manually installed in develop mode
|
|
23
|
+
jupyter server extension enable nodpy
|
|
24
|
+
|
|
25
|
+
# Rebuild extension Typescript source after making changes
|
|
26
|
+
# IMPORTANT: Unlike the steps above which are performed only once, do this step
|
|
27
|
+
# every time you make a change.
|
|
28
|
+
jlpm build
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Watch the source directory in one terminal, automatically rebuilding when needed
|
|
35
|
+
jlpm watch
|
|
36
|
+
# Run JupyterLab in another terminal
|
|
37
|
+
jupyter lab
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).
|
|
41
|
+
|
|
42
|
+
By default, the `jlpm build` command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
jupyter lab build --minimize=False
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Development uninstall
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# Server extension must be manually disabled in develop mode
|
|
52
|
+
jupyter server extension disable nodpy
|
|
53
|
+
pip uninstall nodpy
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
In development mode, you will also need to remove the symlink created by `jupyter labextension develop`
|
|
57
|
+
command. To find its location, you can run `jupyter labextension list` to figure out where the `labextensions`
|
|
58
|
+
folder is located. Then you can remove the symlink named `nodjs` within that folder.
|
|
59
|
+
|
|
60
|
+
### Testing the extension
|
|
61
|
+
|
|
62
|
+
#### Server tests
|
|
63
|
+
|
|
64
|
+
This extension is using [Pytest](https://docs.pytest.org/) for Python code testing.
|
|
65
|
+
|
|
66
|
+
Install test dependencies (needed only once):
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
pip install -e ".[test]"
|
|
70
|
+
# Each time you install the Python package, you need to restore the front-end extension link
|
|
71
|
+
jupyter labextension develop . --overwrite
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
To execute them, run:
|
|
75
|
+
|
|
76
|
+
```sh
|
|
77
|
+
pytest -vv -r ap --cov nodpy
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
#### Frontend tests
|
|
81
|
+
|
|
82
|
+
This extension is using [Jest](https://jestjs.io/) for JavaScript code testing.
|
|
83
|
+
|
|
84
|
+
To execute them, execute:
|
|
85
|
+
|
|
86
|
+
```sh
|
|
87
|
+
jlpm
|
|
88
|
+
jlpm test
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
#### Integration tests
|
|
92
|
+
|
|
93
|
+
This extension uses [Playwright](https://playwright.dev/docs/intro) for the integration tests (aka user level tests).
|
|
94
|
+
More precisely, the JupyterLab helper [Galata](https://github.com/jupyterlab/jupyterlab/tree/master/galata) is used to handle testing the extension in JupyterLab.
|
|
95
|
+
|
|
96
|
+
More information are provided within the [ui-tests](./ui-tests/README.md) README.
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# nod
|
|
2
|
+
|
|
3
|
+
<!-- https://stackoverflow.com/questions/31382405/ipython-notebook-how-to-connect-to-existing-kernel?rq=3 -->
|
|
4
|
+
|
|
5
|
+
404 GET /api/kernels/e9d194aa-bfbc-495d-8295-593039ab17e8/channels?session_id=6740bec7-2acd-4d6f-a6e2-33973306dfa4 (127.0.0.1): Kernel does not exist: e9d194aa-bfbc-495d-8295-593039ab17e8
|
|
6
|
+
|
|
7
|
+
Session not found: session_id='2e3651ad-e58a-41ec-8b90-ce370cf3d153'
|
|
8
|
+
|
|
9
|
+
NOTES:
|
|
10
|
+
|
|
11
|
+
- old kernel 404's --- WORKSPACE FILE. HOW to fix?
|
|
12
|
+
- just use Nod log to deep copy things, have no args capture all, args capture variables, and have a not=[] field to capture all but some. Restart shouldn't do anything different because it can't reset the whole stackframe, but you can just click back into a specific frame to reset the state. - this also gets you out of having to do the full-adult mode, because users can just nodlog the things they want to checkpoint and leave out a huge dataset which can't be copied but can be modified.
|
|
13
|
+
-how to do linked execution? when you select one nod.log, maybe the rest of the same nodlogs also light up with a button to do linked execution
|
|
14
|
+
- how to mark globals? Can we do this somehow with just the structure of the program?
|
|
15
|
+
- --existing flag and left hand pane to specify CWD VS specifying command directly from the panel?
|
|
16
|
+
- 1. is potentially less work but more clunky, also might be difficult to find the right path, and you get no feedback if it doesn't work. Maybe the --existing spits out a path string to paste into the frontend
|
|
17
|
+
- 2. might not be that hard to do if we can just specify the kernelspec command when we execute and that will work as expected. But I'm not thrilled about the idea of writing a terminal command in a plaintext window.
|
|
18
|
+
|
|
19
|
+
NODCONFIG
|
|
20
|
+
|
|
21
|
+
- add restart time to nodConfig
|
|
22
|
+
- Add to NodConfig how the program should be restarted — (i.e. allowed to finish or interrupted, and if interrupted, with what signal). Obv smart defaults are our friend here.
|
|
23
|
+
- format for notebook converstion with jupytext (light, percent, etc)
|
|
24
|
+
- allow optional bypassing of readonly after edits?
|
|
25
|
+
- if you want to test your program output after quit, you just gotta use the command line version
|
|
26
|
+
|
|
27
|
+
TODO
|
|
28
|
+
|
|
29
|
+
<!-- - make other frames read only after edit -->
|
|
30
|
+
<!-- - add banner at the top on read only NBs -->
|
|
31
|
+
|
|
32
|
+
- test unlock
|
|
33
|
+
- nod on exception https://ipython.readthedocs.io/en/stable/interactive/magics.html#magic-pdb
|
|
34
|
+
- rename nb files to function--class
|
|
35
|
+
- throw warning if spec not installed
|
|
36
|
+
- Maybe have the current NOD Instance notebook be undeleteable and a different color?
|
|
37
|
+
|
|
38
|
+
- JupyterHub Integration?
|
|
39
|
+
- paste CWD of JupyterLab for --existing?
|
|
40
|
+
- how to get CWD string to subprocess? Pass as env variable? yes this should work
|
|
41
|
+
- can we add as a CMD from the front end?
|
|
42
|
+
- or an --existing flag to the nod call, then we add the command to the connection file
|
|
43
|
+
- left hand pane that users can add CWD (or just specify the command to run directly from the pane?)
|
|
44
|
+
- how to get info from pane to kernel provisioner?
|
|
45
|
+
- if the python program is being run as a subprocess, we can set an enviornment variable for the connection directory
|
|
46
|
+
- print CWD on bottom pane to paste into existing arg
|
|
47
|
+
- problem with this is that we can't use existing provisioner architecture, bc the kernel doesn't own the subprocess
|
|
48
|
+
- but we probably want stdout in some way
|
|
49
|
+
- we can pipe the subprocess to the terminal? Can Jupyterhub people access the console?
|
|
50
|
+
- no they can't, but maybe stdout doesn't matter? people can debug their programs to hit the notebook call ahead of time? If theres a bug before notebook we're gonna have a problem anyways
|
|
51
|
+
- on the other hand, being able to continue with a program and see the output is cool
|
|
52
|
+
- add exit without saving to menu
|
|
53
|
+
- "continue" option now that the provisioner is handling the subprocess?
|
|
54
|
+
- rename setting to "how_exit"?
|
|
55
|
+
- maybe we don't need this -- people can just send a "quit" manually if they want to continue the program
|
|
56
|
+
|
|
57
|
+
Nice to have
|
|
58
|
+
|
|
59
|
+
- persist lock through reload?
|
|
60
|
+
- - clear old kernels from jupyter (get shutdown registering properly??)
|
|
61
|
+
- layoutrestorer, restorablepool
|
|
62
|
+
- test timeouts to optimize (and on networked connections?)
|
|
63
|
+
- play with opacity on the surrounding code?
|
|
64
|
+
- mode to create function at call site?
|
|
65
|
+
- mark cells above nod() call as run?
|
|
66
|
+
- Change tracker --- which cells are unedited
|
|
67
|
+
- Add check interface where it shows side by side
|
|
68
|
+
- final preview of exported code?
|
|
69
|
+
- debug nod with nod!!
|
|
70
|
+
- need to specify the connection file directly in the cmd line args
|
|
71
|
+
- or just change the cwd in the outer command? aka nod cd folder && nod python -m module
|
|
72
|
+
|
|
73
|
+
NOD Log Todo
|
|
74
|
+
nod.log(x)
|
|
75
|
+
|
|
76
|
+
- Nod log right sidebar
|
|
77
|
+
- just deep copy it and put it in a dict
|
|
78
|
+
- clicking on the side panel puts it in state
|
|
79
|
+
- have a 'unique' boolean in nod.log() that doesn't save if it compares equal to another obj in the list
|
|
80
|
+
|
|
81
|
+
Nod Save Args
|
|
82
|
+
nod.save_args(f, [x,y,z])
|
|
83
|
+
|
|
84
|
+
- Linked editing on all saved args
|
|
85
|
+
- refuse to run if any free vars
|
|
86
|
+
- can call from anywhere in the program
|
|
87
|
+
- args must be deep copyable
|
|
88
|
+
- group saved args by whether f is identical
|
|
89
|
+
- user can just rewrite the function to have an inner pure func to call save_args on.
|
|
90
|
+
- allow_globals flag?
|
|
91
|
+
|
|
92
|
+
Nod log
|
|
93
|
+
|
|
94
|
+
- Look for cycles in taint analysis
|
|
95
|
+
- Fallback — compare outputs of each log session, if on forward eval they change, raise a big warning
|
|
96
|
+
- Argument isn’t that we’re inventing map, or array programming, but that once we focus on how notebooks let us reify dynamic parts of our program, we can let you do things for free that would normally require totally rewriting your program (aka applying a statement on one variable to an array of values)
|
|
97
|
+
https://pyre-check.org/docs/pysa-basics/
|
|
98
|
+
- maybe we just need forward eval, and log is nod.log(savevariables)
|
|
99
|
+
- problem with this is that we want the stack frame at the _beginning_ of the run, not the end.
|
|
100
|
+
- maybe its just the user's problem if they don't include something that matters in the function call?
|
|
101
|
+
|
|
102
|
+
Stretch
|
|
103
|
+
|
|
104
|
+
- Display variables for each call stack in green/red depending on whether they’re problematic, display warnings
|
|
105
|
+
|
|
106
|
+
Decorator vs imbedded — decorator gives clear points for taint analysis, doesn’t let us leverage the user logic though.
|
|
107
|
+
|
|
108
|
+
Inter-function, the sources and sinks are anything referenced in the body, and the sinks
|
|
109
|
+
|
|
110
|
+
Will the taint analysis catch things like for loops tho? If not, this would be an argument to use a decorator instead
|
|
111
|
+
|
|
112
|
+
<!-- - mode order -- 1. just do forward eval, 2. deep-copy for expensive programs, 3. adult-mode.
|
|
113
|
+
- how to switch modes? notebook() args? -->
|
|
114
|
+
<!-- - figure out why jupytext isn't respecting the kernelinfo metadata, so that we can restart the notebook without switching to normal python kernel
|
|
115
|
+
- alternatively, figure out how to switch the kernel always to python
|
|
116
|
+
- ok maybe its actually switching properly but restart has wiped the state -->
|
nodpy-0.1.3/LICENSE
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, Eric Rawn
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
17
|
+
contributors may be used to endorse or promote products derived from
|
|
18
|
+
this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
nodpy-0.1.3/PKG-INFO
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: nodpy
|
|
3
|
+
Version: 0.1.3
|
|
4
|
+
Summary: A JupyterLab extension.
|
|
5
|
+
Project-URL: Homepage, https://github.com/erawn/nod
|
|
6
|
+
Project-URL: Bug Tracker, https://github.com/erawn/nod/issues
|
|
7
|
+
Project-URL: Repository, https://github.com/erawn/nod
|
|
8
|
+
Author-email: Eric Rawn <erawn65@gmail.com>
|
|
9
|
+
License: BSD 3-Clause License
|
|
10
|
+
|
|
11
|
+
Copyright (c) 2026, Eric Rawn
|
|
12
|
+
All rights reserved.
|
|
13
|
+
|
|
14
|
+
Redistribution and use in source and binary forms, with or without
|
|
15
|
+
modification, are permitted provided that the following conditions are met:
|
|
16
|
+
|
|
17
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
18
|
+
list of conditions and the following disclaimer.
|
|
19
|
+
|
|
20
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
21
|
+
this list of conditions and the following disclaimer in the documentation
|
|
22
|
+
and/or other materials provided with the distribution.
|
|
23
|
+
|
|
24
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
25
|
+
contributors may be used to endorse or promote products derived from
|
|
26
|
+
this software without specific prior written permission.
|
|
27
|
+
|
|
28
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
29
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
30
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
31
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
32
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
33
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
34
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
35
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
36
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
37
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
38
|
+
License-File: LICENSE
|
|
39
|
+
Keywords: jupyter,jupyterlab,jupyterlab-extension
|
|
40
|
+
Classifier: Framework :: Jupyter
|
|
41
|
+
Classifier: Framework :: Jupyter :: JupyterLab
|
|
42
|
+
Classifier: Framework :: Jupyter :: JupyterLab :: 4
|
|
43
|
+
Classifier: Framework :: Jupyter :: JupyterLab :: Extensions
|
|
44
|
+
Classifier: Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt
|
|
45
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
46
|
+
Classifier: Programming Language :: Python
|
|
47
|
+
Classifier: Programming Language :: Python :: 3
|
|
48
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
49
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
50
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
51
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
52
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
53
|
+
Requires-Python: >=3.10
|
|
54
|
+
Requires-Dist: ipykernel>=7.2.0
|
|
55
|
+
Requires-Dist: jupyter-client>=8.8.0
|
|
56
|
+
Requires-Dist: jupyter-server>=2.4.0
|
|
57
|
+
Requires-Dist: jupyterlab>=4.5.6
|
|
58
|
+
Requires-Dist: jupytext>=1.19.1
|
|
59
|
+
Requires-Dist: libcst>=1.8.6
|
|
60
|
+
Requires-Dist: nbformat>=5.10.4
|
|
61
|
+
Requires-Dist: orjson>=3.11.7
|
|
62
|
+
Requires-Dist: typer>=0.25.1
|
|
63
|
+
Provides-Extra: dev
|
|
64
|
+
Requires-Dist: jupyterlab>=4; extra == 'dev'
|
|
65
|
+
Provides-Extra: test
|
|
66
|
+
Requires-Dist: coverage; extra == 'test'
|
|
67
|
+
Requires-Dist: pytest; extra == 'test'
|
|
68
|
+
Requires-Dist: pytest-asyncio; extra == 'test'
|
|
69
|
+
Requires-Dist: pytest-cov; extra == 'test'
|
|
70
|
+
Requires-Dist: pytest-jupyter[server]>=0.6.0; extra == 'test'
|
|
71
|
+
Description-Content-Type: text/markdown
|
|
72
|
+
|
|
73
|
+
# NOD: Notebook-On-Demand
|
|
74
|
+
|
|
75
|
+
## Install
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
pip install nodpy
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Usage
|
|
82
|
+
|
|
83
|
+
In a Python file call `notebook()` anywhere:
|
|
84
|
+
|
|
85
|
+
```python
|
|
86
|
+
#myfile.py
|
|
87
|
+
from nodpy import notebook
|
|
88
|
+
|
|
89
|
+
notebook()
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
then run the python program with nod <command>
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
nod python -m myfile
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### NodConfig
|
nodpy-0.1.3/README.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# NOD: Notebook-On-Demand
|
|
2
|
+
|
|
3
|
+
## Install
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
pip install nodpy
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
In a Python file call `notebook()` anywhere:
|
|
12
|
+
|
|
13
|
+
```python
|
|
14
|
+
#myfile.py
|
|
15
|
+
from nodpy import notebook
|
|
16
|
+
|
|
17
|
+
notebook()
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
then run the python program with nod <command>
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
nod python -m myfile
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### NodConfig
|
nodpy-0.1.3/RELEASE.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Making a new release of nodpy
|
|
2
|
+
|
|
3
|
+
The extension can be published to `PyPI` and `npm` manually or using the [Jupyter Releaser](https://github.com/jupyter-server/jupyter_releaser).
|
|
4
|
+
|
|
5
|
+
## Manual release
|
|
6
|
+
|
|
7
|
+
### Python package
|
|
8
|
+
|
|
9
|
+
This extension can be distributed as Python packages. All of the Python
|
|
10
|
+
packaging instructions are in the `pyproject.toml` file to wrap your extension in a
|
|
11
|
+
Python package. Before generating a package, you first need to install some tools:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pip install build twine hatch
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Bump the version using `hatch`. By default this will create a tag.
|
|
18
|
+
See the docs on [hatch-nodejs-version](https://github.com/agoose77/hatch-nodejs-version#semver) for details.
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
hatch version <new-version>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Make sure to clean up all the development files before building the package:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
jlpm clean:all
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
You could also clean up the local git repository:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
git clean -dfX
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
To create a Python source package (`.tar.gz`) and the binary package (`.whl`) in the `dist/` directory, do:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
python -m build
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
> `python setup.py sdist bdist_wheel` is deprecated and will not work for this package.
|
|
43
|
+
|
|
44
|
+
Then to upload the package to PyPI, do:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
twine upload dist/*
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### NPM package
|
|
51
|
+
|
|
52
|
+
To publish the frontend part of the extension as a NPM package, do:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npm login
|
|
56
|
+
npm publish --access public
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Automated releases with the Jupyter Releaser
|
|
60
|
+
|
|
61
|
+
The extension repository should already be compatible with the Jupyter Releaser. But
|
|
62
|
+
the GitHub repository and the package managers need to be properly set up. Please
|
|
63
|
+
follow the instructions of the Jupyter Releaser [checklist](https://jupyter-releaser.readthedocs.io/en/latest/how_to_guides/convert_repo_from_repo.html).
|
|
64
|
+
|
|
65
|
+
Here is a summary of the steps to cut a new release:
|
|
66
|
+
|
|
67
|
+
- Go to the Actions panel
|
|
68
|
+
- Run the "Step 1: Prep Release" workflow
|
|
69
|
+
- Check the draft changelog
|
|
70
|
+
- Run the "Step 2: Publish Release" workflow
|
|
71
|
+
|
|
72
|
+
> [!NOTE]
|
|
73
|
+
> Check out the [workflow documentation](https://jupyter-releaser.readthedocs.io/en/latest/get_started/making_release_from_repo.html)
|
|
74
|
+
> for more information.
|
|
75
|
+
|
|
76
|
+
## Publishing to `conda-forge`
|
|
77
|
+
|
|
78
|
+
If the package is not on conda forge yet, check the documentation to learn how to add it: https://conda-forge.org/docs/maintainer/adding_pkgs.html
|
|
79
|
+
|
|
80
|
+
Otherwise a bot should pick up the new version publish to PyPI, and open a new PR on the feedstock repository automatically.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('@jupyterlab/testutils/lib/babel.config');
|
nodpy-0.1.3/conftest.py
ADDED
nodpy-0.1.3/install.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const jestJupyterLab = require('@jupyterlab/testutils/lib/jest-config');
|
|
2
|
+
|
|
3
|
+
const esModules = [
|
|
4
|
+
'@codemirror',
|
|
5
|
+
'@jupyter/ydoc',
|
|
6
|
+
'@jupyterlab/',
|
|
7
|
+
'lib0',
|
|
8
|
+
'nanoid',
|
|
9
|
+
'vscode-ws-jsonrpc',
|
|
10
|
+
'y-protocols',
|
|
11
|
+
'y-websocket',
|
|
12
|
+
'yjs'
|
|
13
|
+
].join('|');
|
|
14
|
+
|
|
15
|
+
const baseConfig = jestJupyterLab(__dirname);
|
|
16
|
+
|
|
17
|
+
module.exports = {
|
|
18
|
+
...baseConfig,
|
|
19
|
+
automock: false,
|
|
20
|
+
collectCoverageFrom: [
|
|
21
|
+
'src/**/*.{ts,tsx}',
|
|
22
|
+
'!src/**/*.d.ts',
|
|
23
|
+
'!src/**/.ipynb_checkpoints/*'
|
|
24
|
+
],
|
|
25
|
+
coverageReporters: ['lcov', 'text'],
|
|
26
|
+
testRegex: 'src/.*/.*.spec.ts[x]?$',
|
|
27
|
+
transformIgnorePatterns: [`/node_modules/(?!${esModules}).+`]
|
|
28
|
+
};
|