hic-egress-request 0.1.1__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.
- hic_egress_request-0.1.1/.copier-answers.yml +17 -0
- hic_egress_request-0.1.1/.gitignore +128 -0
- hic_egress_request-0.1.1/.prettierignore +9 -0
- hic_egress_request-0.1.1/.yarnrc.yml +2 -0
- hic_egress_request-0.1.1/CHANGELOG.md +5 -0
- hic_egress_request-0.1.1/CONTRIBUTING.md +102 -0
- hic_egress_request-0.1.1/LICENSE +29 -0
- hic_egress_request-0.1.1/PKG-INFO +114 -0
- hic_egress_request-0.1.1/README.md +47 -0
- hic_egress_request-0.1.1/RELEASE.md +88 -0
- hic_egress_request-0.1.1/babel.config.js +1 -0
- hic_egress_request-0.1.1/conftest.py +8 -0
- hic_egress_request-0.1.1/eslint.config.mjs +69 -0
- hic_egress_request-0.1.1/hic_egress_request/__init__.py +32 -0
- hic_egress_request-0.1.1/hic_egress_request/_version.py +4 -0
- hic_egress_request-0.1.1/hic_egress_request/config.py +19 -0
- hic_egress_request-0.1.1/hic_egress_request/labextension/package.json +159 -0
- hic_egress_request-0.1.1/hic_egress_request/labextension/schemas/hic-egress-request/package.json.orig +154 -0
- hic_egress_request-0.1.1/hic_egress_request/labextension/schemas/hic-egress-request/plugin.json +8 -0
- hic_egress_request-0.1.1/hic_egress_request/labextension/static/232.4c7aeaf9505d0746.js +70 -0
- hic_egress_request-0.1.1/hic_egress_request/labextension/static/571.5a9467c7e55c01ff.js +1 -0
- hic_egress_request-0.1.1/hic_egress_request/labextension/static/remoteEntry.88b5a466e970072e.js +1 -0
- hic_egress_request-0.1.1/hic_egress_request/labextension/static/style.js +4 -0
- hic_egress_request-0.1.1/hic_egress_request/labextension/static/third-party-licenses.json +16 -0
- hic_egress_request-0.1.1/hic_egress_request/routes.py +107 -0
- hic_egress_request-0.1.1/hic_egress_request/tests/__init__.py +1 -0
- hic_egress_request-0.1.1/hic_egress_request/tests/test_routes.py +136 -0
- hic_egress_request-0.1.1/install.json +5 -0
- hic_egress_request-0.1.1/jest.config.js +28 -0
- hic_egress_request-0.1.1/junit.xml +7 -0
- hic_egress_request-0.1.1/jupyter-config/server-config/hic_egress_request.json +7 -0
- hic_egress_request-0.1.1/package.json +154 -0
- hic_egress_request-0.1.1/pyproject.toml +94 -0
- hic_egress_request-0.1.1/schema/plugin.json +8 -0
- hic_egress_request-0.1.1/setup.py +1 -0
- hic_egress_request-0.1.1/src/__tests__/hic_egress_request.spec.ts +9 -0
- hic_egress_request-0.1.1/src/index.ts +303 -0
- hic_egress_request-0.1.1/src/request.ts +52 -0
- hic_egress_request-0.1.1/style/base.css +69 -0
- hic_egress_request-0.1.1/style/index.css +1 -0
- hic_egress_request-0.1.1/style/index.js +1 -0
- hic_egress_request-0.1.1/tsconfig.json +25 -0
- hic_egress_request-0.1.1/tsconfig.test.json +3 -0
- hic_egress_request-0.1.1/ui-tests/README.md +167 -0
- hic_egress_request-0.1.1/ui-tests/jupyter_server_test_config.py +15 -0
- hic_egress_request-0.1.1/ui-tests/package.json +15 -0
- hic_egress_request-0.1.1/ui-tests/playwright.config.js +14 -0
- hic_egress_request-0.1.1/ui-tests/tests/hic_egress_request.spec.ts +176 -0
- hic_egress_request-0.1.1/ui-tests/yarn.lock +4565 -0
- hic_egress_request-0.1.1/yarn.lock +11552 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
|
|
2
|
+
_commit: v4.6.2
|
|
3
|
+
_src_path: https://github.com/jupyterlab/extension-template
|
|
4
|
+
advanced: false
|
|
5
|
+
author_email: tmillington001@dundee.ac.uk
|
|
6
|
+
author_name: Tristan Millington
|
|
7
|
+
has_ai_rules: false
|
|
8
|
+
has_binder: false
|
|
9
|
+
has_settings: true
|
|
10
|
+
kind: frontend-and-server
|
|
11
|
+
labextension_name: hic-egress-request
|
|
12
|
+
project_short_description: A JupyterLab extension to create egress requests in the
|
|
13
|
+
K8TRE TRE
|
|
14
|
+
python_name: hic_egress_request
|
|
15
|
+
repository: ''
|
|
16
|
+
test: true
|
|
17
|
+
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
*.bundle.*
|
|
2
|
+
lib/
|
|
3
|
+
node_modules/
|
|
4
|
+
*.log
|
|
5
|
+
.eslintcache
|
|
6
|
+
.stylelintcache
|
|
7
|
+
*.egg-info/
|
|
8
|
+
.ipynb_checkpoints
|
|
9
|
+
*.tsbuildinfo
|
|
10
|
+
hic_egress_request/labextension
|
|
11
|
+
# Version file is handled by hatchling
|
|
12
|
+
hic_egress_request/_version.py
|
|
13
|
+
|
|
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/
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
## Development install
|
|
4
|
+
|
|
5
|
+
Note: You will need Node.js to build the extension package.
|
|
6
|
+
You may install it from [nodejs.org](https://nodejs.org/en/download). We
|
|
7
|
+
recommend using the latest LTS version of Node.js.
|
|
8
|
+
|
|
9
|
+
The `jlpm` command is JupyterLab's pinned version of
|
|
10
|
+
[yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use
|
|
11
|
+
`yarn` or `npm` in lieu of `jlpm` below.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Clone the repo to your local environment
|
|
15
|
+
# Change directory to the hic_egress_request directory
|
|
16
|
+
|
|
17
|
+
# Set up a virtual environment and install package in development mode
|
|
18
|
+
python -m venv .venv
|
|
19
|
+
source .venv/bin/activate
|
|
20
|
+
pip install --editable ".[dev,test]"
|
|
21
|
+
|
|
22
|
+
# Link your development version of the extension with JupyterLab
|
|
23
|
+
jupyter-builder develop . --overwrite
|
|
24
|
+
# Server extension must be manually installed in develop mode
|
|
25
|
+
jupyter server extension enable hic_egress_request
|
|
26
|
+
|
|
27
|
+
# Rebuild extension Typescript source after making changes
|
|
28
|
+
# IMPORTANT: Unlike the steps above which are performed only once, do this step
|
|
29
|
+
# every time you make a change.
|
|
30
|
+
jlpm build
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
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.
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Watch the source directory in one terminal, automatically rebuilding when needed
|
|
37
|
+
jlpm watch
|
|
38
|
+
# Run JupyterLab in another terminal
|
|
39
|
+
jupyter lab
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
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).
|
|
43
|
+
|
|
44
|
+
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:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
jupyter lab build --minimize=False
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Development uninstall
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# Server extension must be manually disabled in develop mode
|
|
54
|
+
jupyter server extension disable hic_egress_request
|
|
55
|
+
pip uninstall hic_egress_request
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
In development mode, you will also need to remove the symlink created by `jupyter-builder develop`
|
|
59
|
+
command. To find its location, you can run `jupyter labextension list` to figure out where the `labextensions`
|
|
60
|
+
folder is located. Then you can remove the symlink named `hic-egress-request` within that folder.
|
|
61
|
+
|
|
62
|
+
## Testing the extension
|
|
63
|
+
|
|
64
|
+
### Server tests
|
|
65
|
+
|
|
66
|
+
This extension is using [Pytest](https://docs.pytest.org/) for Python code testing.
|
|
67
|
+
|
|
68
|
+
Install test dependencies (needed only once):
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
pip install -e ".[test]"
|
|
72
|
+
# Each time you install the Python package, you need to restore the front-end extension link
|
|
73
|
+
jupyter-builder develop . --overwrite
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
To execute them, run:
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
pytest -vv -r ap --cov hic_egress_request
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
#### Frontend tests
|
|
83
|
+
|
|
84
|
+
This extension is using [Jest](https://jestjs.io/) for JavaScript code testing.
|
|
85
|
+
|
|
86
|
+
To execute them, execute:
|
|
87
|
+
|
|
88
|
+
```sh
|
|
89
|
+
jlpm
|
|
90
|
+
jlpm test
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Integration tests
|
|
94
|
+
|
|
95
|
+
This extension uses [Playwright](https://playwright.dev/docs/intro) for the integration tests (aka user level tests).
|
|
96
|
+
More precisely, the JupyterLab helper [Galata](https://github.com/jupyterlab/jupyterlab/tree/master/galata) is used to handle testing the extension in JupyterLab.
|
|
97
|
+
|
|
98
|
+
More information is provided within the [ui-tests](./ui-tests/README.md) README.
|
|
99
|
+
|
|
100
|
+
## Packaging the extension
|
|
101
|
+
|
|
102
|
+
See [RELEASE](RELEASE.md)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, Tristan Millington
|
|
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.
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: hic_egress_request
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: A JupyterLab extension to create egress requests in the K8TRE TRE
|
|
5
|
+
Project-URL: Homepage, https://github.com/hic-infra/k8tre-egress-jupyter
|
|
6
|
+
Project-URL: Bug Tracker, https://github.com/hic-infra/k8tre-egress-jupyter/issues
|
|
7
|
+
Project-URL: Repository, https://github.com/hic-infra/k8tre-egress-jupyter.git
|
|
8
|
+
Author-email: Tristan Millington <tmillington001@dundee.ac.uk>
|
|
9
|
+
License: BSD 3-Clause License
|
|
10
|
+
|
|
11
|
+
Copyright (c) 2026, Tristan Millington
|
|
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: jupyter-server<3,>=2.4.0
|
|
55
|
+
Requires-Dist: python-dotenv>=1.2.2
|
|
56
|
+
Provides-Extra: dev
|
|
57
|
+
Requires-Dist: jupyter-builder>=1.0.0; extra == 'dev'
|
|
58
|
+
Requires-Dist: jupyterlab>=4; extra == 'dev'
|
|
59
|
+
Provides-Extra: test
|
|
60
|
+
Requires-Dist: coverage; extra == 'test'
|
|
61
|
+
Requires-Dist: pytest; extra == 'test'
|
|
62
|
+
Requires-Dist: pytest-asyncio; extra == 'test'
|
|
63
|
+
Requires-Dist: pytest-cov; extra == 'test'
|
|
64
|
+
Requires-Dist: pytest-jupyter[server]>=0.6.0; extra == 'test'
|
|
65
|
+
Requires-Dist: respx==0.23.1; extra == 'test'
|
|
66
|
+
Description-Content-Type: text/markdown
|
|
67
|
+
|
|
68
|
+
# hic_egress_request
|
|
69
|
+
|
|
70
|
+
A JupyterLab extension to create egress requests in the K8TRE TRE
|
|
71
|
+
|
|
72
|
+
This extension is composed of a Python package named `hic_egress_request`
|
|
73
|
+
for the server extension and a NPM package named `hic-egress-request`
|
|
74
|
+
for the frontend extension.
|
|
75
|
+
|
|
76
|
+
## Requirements
|
|
77
|
+
|
|
78
|
+
- JupyterLab >= 4.0.0
|
|
79
|
+
|
|
80
|
+
## Install
|
|
81
|
+
|
|
82
|
+
To install the extension, execute:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
pip install hic_egress_request
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Uninstall
|
|
89
|
+
|
|
90
|
+
To remove the extension, execute:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
pip uninstall hic_egress_request
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Troubleshoot
|
|
97
|
+
|
|
98
|
+
If you are seeing the frontend extension, but it is not working, check
|
|
99
|
+
that the server extension is enabled:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
jupyter server extension list
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
If the server extension is installed and enabled, but you are not seeing
|
|
106
|
+
the frontend extension, check the frontend extension is installed:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
jupyter labextension list
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Contributing
|
|
113
|
+
|
|
114
|
+
If you would like to contribute to this extension, please refer to the [Contributing Guide](CONTRIBUTING.md).
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# hic_egress_request
|
|
2
|
+
|
|
3
|
+
A JupyterLab extension to create egress requests in the K8TRE TRE
|
|
4
|
+
|
|
5
|
+
This extension is composed of a Python package named `hic_egress_request`
|
|
6
|
+
for the server extension and a NPM package named `hic-egress-request`
|
|
7
|
+
for the frontend extension.
|
|
8
|
+
|
|
9
|
+
## Requirements
|
|
10
|
+
|
|
11
|
+
- JupyterLab >= 4.0.0
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
To install the extension, execute:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pip install hic_egress_request
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Uninstall
|
|
22
|
+
|
|
23
|
+
To remove the extension, execute:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pip uninstall hic_egress_request
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Troubleshoot
|
|
30
|
+
|
|
31
|
+
If you are seeing the frontend extension, but it is not working, check
|
|
32
|
+
that the server extension is enabled:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
jupyter server extension list
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
If the server extension is installed and enabled, but you are not seeing
|
|
39
|
+
the frontend extension, check the frontend extension is installed:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
jupyter labextension list
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Contributing
|
|
46
|
+
|
|
47
|
+
If you would like to contribute to this extension, please refer to the [Contributing Guide](CONTRIBUTING.md).
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Making a new release of hic_egress_request
|
|
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
|
+
For the release workflows in this repository, make sure GitHub is configured with:
|
|
66
|
+
|
|
67
|
+
- a `release` environment
|
|
68
|
+
- an `APP_PRIVATE_KEY` secret
|
|
69
|
+
- an `APP_ID` repository variable
|
|
70
|
+
|
|
71
|
+
When using [npm trusted publishing](https://docs.npmjs.com/trusted-publishers), `NPM_TOKEN` is not required (and trusted publishing is recommended). Configure `NPM_TOKEN` only if you are publishing without trusted publishers.
|
|
72
|
+
|
|
73
|
+
Here is a summary of the steps to cut a new release:
|
|
74
|
+
|
|
75
|
+
- Go to the Actions panel
|
|
76
|
+
- Run the "Step 1: Prep Release" workflow
|
|
77
|
+
- Check the draft changelog
|
|
78
|
+
- Run the "Step 2: Publish Release" workflow
|
|
79
|
+
|
|
80
|
+
> [!NOTE]
|
|
81
|
+
> Check out the [workflow documentation](https://jupyter-releaser.readthedocs.io/en/latest/get_started/making_release_from_repo.html)
|
|
82
|
+
> for more information.
|
|
83
|
+
|
|
84
|
+
## Publishing to `conda-forge`
|
|
85
|
+
|
|
86
|
+
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
|
|
87
|
+
|
|
88
|
+
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');
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import js from '@eslint/js';
|
|
2
|
+
import { defineConfig } from 'eslint/config';
|
|
3
|
+
import tseslint from 'typescript-eslint';
|
|
4
|
+
import prettierRecommended from 'eslint-plugin-prettier/recommended';
|
|
5
|
+
import globals from 'globals';
|
|
6
|
+
import jupyterPlugin from '@jupyter/eslint-plugin';
|
|
7
|
+
|
|
8
|
+
export default defineConfig([
|
|
9
|
+
{
|
|
10
|
+
ignores: [
|
|
11
|
+
'node_modules',
|
|
12
|
+
'dist',
|
|
13
|
+
'coverage',
|
|
14
|
+
'**/*.js',
|
|
15
|
+
'**/*.d.ts',
|
|
16
|
+
'.venv',
|
|
17
|
+
'tests',
|
|
18
|
+
'**/__tests__',
|
|
19
|
+
'ui-tests',
|
|
20
|
+
'**/.ipynb_checkpoints/**'
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
js.configs.recommended,
|
|
24
|
+
tseslint.configs.recommended,
|
|
25
|
+
jupyterPlugin.configs.recommended,
|
|
26
|
+
{
|
|
27
|
+
files: ['**/*.ts', '**/*.tsx'],
|
|
28
|
+
plugins: {
|
|
29
|
+
jupyter: jupyterPlugin
|
|
30
|
+
},
|
|
31
|
+
languageOptions: {
|
|
32
|
+
globals: {
|
|
33
|
+
...globals.browser,
|
|
34
|
+
...globals.es2015,
|
|
35
|
+
...globals.node
|
|
36
|
+
},
|
|
37
|
+
parserOptions: {
|
|
38
|
+
project: 'tsconfig.json',
|
|
39
|
+
sourceType: 'module'
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
rules: {
|
|
43
|
+
'@typescript-eslint/naming-convention': [
|
|
44
|
+
'error',
|
|
45
|
+
{
|
|
46
|
+
selector: 'interface',
|
|
47
|
+
format: ['PascalCase'],
|
|
48
|
+
custom: {
|
|
49
|
+
regex: '^I[A-Z]',
|
|
50
|
+
match: true
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
|
|
55
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
56
|
+
'@typescript-eslint/no-namespace': 'off',
|
|
57
|
+
'@typescript-eslint/no-use-before-define': 'off',
|
|
58
|
+
'@typescript-eslint/quotes': [
|
|
59
|
+
'error',
|
|
60
|
+
'single',
|
|
61
|
+
{ avoidEscape: true, allowTemplateLiterals: false }
|
|
62
|
+
],
|
|
63
|
+
curly: ['error', 'all'],
|
|
64
|
+
eqeqeq: 'error',
|
|
65
|
+
'prefer-arrow-callback': 'error'
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
prettierRecommended
|
|
69
|
+
]);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
try:
|
|
2
|
+
from ._version import __version__
|
|
3
|
+
except ImportError:
|
|
4
|
+
# Fallback when using the package in dev mode without installing
|
|
5
|
+
# in editable mode with pip. It is highly recommended to install
|
|
6
|
+
# the package from a stable release or in editable mode: https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs
|
|
7
|
+
import warnings
|
|
8
|
+
|
|
9
|
+
warnings.warn("Importing 'hic_egress_request' outside a proper installation.")
|
|
10
|
+
__version__ = "dev"
|
|
11
|
+
from .routes import setup_route_handlers
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _jupyter_labextension_paths():
|
|
15
|
+
return [{"src": "labextension", "dest": "hic-egress-request"}]
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def _jupyter_server_extension_points():
|
|
19
|
+
return [{"module": "hic_egress_request"}]
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def _load_jupyter_server_extension(server_app):
|
|
23
|
+
"""Registers the API handler to receive HTTP requests from the frontend extension.
|
|
24
|
+
|
|
25
|
+
Parameters
|
|
26
|
+
----------
|
|
27
|
+
server_app: jupyterlab.labapp.LabApp
|
|
28
|
+
JupyterLab application instance
|
|
29
|
+
"""
|
|
30
|
+
setup_route_handlers(server_app.web_app)
|
|
31
|
+
name = "hic_egress_request"
|
|
32
|
+
server_app.log.info(f"Registered {name} server extension")
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from traitlets import Unicode, default
|
|
2
|
+
from traitlets.config import Configurable
|
|
3
|
+
import os
|
|
4
|
+
from dotenv import load_dotenv
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
result = load_dotenv(dotenv_path=Path(__file__).parent.parent / ".env")
|
|
8
|
+
print(Path(__file__).parent.parent / ".env")
|
|
9
|
+
print(f"dotenv loaded: {result}") # False = file not found or empty
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class EgressRequestConfig(Configurable):
|
|
13
|
+
hic_egress_creation_service_url = Unicode(config=True)
|
|
14
|
+
|
|
15
|
+
@default("hic_egress_creation_service_url")
|
|
16
|
+
def _default_hic_egress_service_url(self):
|
|
17
|
+
return os.environ.get(
|
|
18
|
+
"HIC_EGRESS_CREATION_SERVICE_URL", "http://127.0.0.1:8080"
|
|
19
|
+
)
|