purdue-af-shutdown-button 0.1.0__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.
Files changed (28) hide show
  1. purdue_af_shutdown_button-0.1.0/.copier-answers.yml +19 -0
  2. purdue_af_shutdown_button-0.1.0/.gitignore +121 -0
  3. purdue_af_shutdown_button-0.1.0/.prettierignore +6 -0
  4. purdue_af_shutdown_button-0.1.0/.yarnrc.yml +1 -0
  5. purdue_af_shutdown_button-0.1.0/CHANGELOG.md +5 -0
  6. purdue_af_shutdown_button-0.1.0/LICENSE +29 -0
  7. purdue_af_shutdown_button-0.1.0/PKG-INFO +142 -0
  8. purdue_af_shutdown_button-0.1.0/README.md +90 -0
  9. purdue_af_shutdown_button-0.1.0/RELEASE.md +111 -0
  10. purdue_af_shutdown_button-0.1.0/install.json +5 -0
  11. purdue_af_shutdown_button-0.1.0/install.sh +3 -0
  12. purdue_af_shutdown_button-0.1.0/package.json +183 -0
  13. purdue_af_shutdown_button-0.1.0/purdue_af_shutdown_button/__init__.py +16 -0
  14. purdue_af_shutdown_button-0.1.0/purdue_af_shutdown_button/_version.py +4 -0
  15. purdue_af_shutdown_button-0.1.0/purdue_af_shutdown_button/labextension/package.json +188 -0
  16. purdue_af_shutdown_button-0.1.0/purdue_af_shutdown_button/labextension/static/736.bef249f8d35253354de9.js +1 -0
  17. purdue_af_shutdown_button-0.1.0/purdue_af_shutdown_button/labextension/static/964.682c4185b871a7f7c841.js +1 -0
  18. purdue_af_shutdown_button-0.1.0/purdue_af_shutdown_button/labextension/static/remoteEntry.41a875cee769200fe1e5.js +1 -0
  19. purdue_af_shutdown_button-0.1.0/purdue_af_shutdown_button/labextension/static/style.js +4 -0
  20. purdue_af_shutdown_button-0.1.0/purdue_af_shutdown_button/labextension/static/third-party-licenses.json +22 -0
  21. purdue_af_shutdown_button-0.1.0/pyproject.toml +77 -0
  22. purdue_af_shutdown_button-0.1.0/setup.py +1 -0
  23. purdue_af_shutdown_button-0.1.0/src/index.ts +94 -0
  24. purdue_af_shutdown_button-0.1.0/style/base.css +5 -0
  25. purdue_af_shutdown_button-0.1.0/style/index.css +1 -0
  26. purdue_af_shutdown_button-0.1.0/style/index.js +1 -0
  27. purdue_af_shutdown_button-0.1.0/tsconfig.json +23 -0
  28. purdue_af_shutdown_button-0.1.0/yarn.lock +5628 -0
@@ -0,0 +1,19 @@
1
+ # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2
+ _commit: v4.2.5
3
+ _src_path: https://github.com/jupyterlab/extension-template
4
+ author_email: kondratyev.d.95@gmail.com
5
+ author_name: Dmitry Kondratyev
6
+ data_format: string
7
+ file_extension: ''
8
+ has_binder: false
9
+ has_settings: false
10
+ kind: frontend
11
+ labextension_name: purdue-af-shutdown-button
12
+ mimetype: ''
13
+ mimetype_name: ''
14
+ project_short_description: Adds a shutdown button to JupyterLab top-bar.
15
+ python_name: purdue_af_shutdown_button
16
+ repository: ''
17
+ test: false
18
+ viewer_name: ''
19
+
@@ -0,0 +1,121 @@
1
+ *.bundle.*
2
+ lib/
3
+ node_modules/
4
+ *.log
5
+ .eslintcache
6
+ .stylelintcache
7
+ *.egg-info/
8
+ .ipynb_checkpoints
9
+ *.tsbuildinfo
10
+ purdue_af_shutdown_button/labextension
11
+ # Version file is handled by hatchling
12
+ purdue_af_shutdown_button/_version.py
13
+
14
+ # Created by https://www.gitignore.io/api/python
15
+ # Edit at https://www.gitignore.io/?templates=python
16
+
17
+ ### Python ###
18
+ # Byte-compiled / optimized / DLL files
19
+ __pycache__/
20
+ *.py[cod]
21
+ *$py.class
22
+
23
+ # C extensions
24
+ *.so
25
+
26
+ # Distribution / packaging
27
+ .Python
28
+ build/
29
+ develop-eggs/
30
+ dist/
31
+ downloads/
32
+ eggs/
33
+ .eggs/
34
+ lib/
35
+ lib64/
36
+ parts/
37
+ sdist/
38
+ var/
39
+ wheels/
40
+ pip-wheel-metadata/
41
+ share/python-wheels/
42
+ .installed.cfg
43
+ *.egg
44
+ MANIFEST
45
+
46
+ # PyInstaller
47
+ # Usually these files are written by a python script from a template
48
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
49
+ *.manifest
50
+ *.spec
51
+
52
+ # Installer logs
53
+ pip-log.txt
54
+ pip-delete-this-directory.txt
55
+
56
+ # Unit test / coverage reports
57
+ htmlcov/
58
+ .tox/
59
+ .nox/
60
+ .coverage
61
+ .coverage.*
62
+ .cache
63
+ nosetests.xml
64
+ coverage/
65
+ coverage.xml
66
+ *.cover
67
+ .hypothesis/
68
+ .pytest_cache/
69
+
70
+ # Translations
71
+ *.mo
72
+ *.pot
73
+
74
+ # Scrapy stuff:
75
+ .scrapy
76
+
77
+ # Sphinx documentation
78
+ docs/_build/
79
+
80
+ # PyBuilder
81
+ target/
82
+
83
+ # pyenv
84
+ .python-version
85
+
86
+ # celery beat schedule file
87
+ celerybeat-schedule
88
+
89
+ # SageMath parsed files
90
+ *.sage.py
91
+
92
+ # Spyder project settings
93
+ .spyderproject
94
+ .spyproject
95
+
96
+ # Rope project settings
97
+ .ropeproject
98
+
99
+ # Mr Developer
100
+ .mr.developer.cfg
101
+ .project
102
+ .pydevproject
103
+
104
+ # mkdocs documentation
105
+ /site
106
+
107
+ # mypy
108
+ .mypy_cache/
109
+ .dmypy.json
110
+ dmypy.json
111
+
112
+ # Pyre type checker
113
+ .pyre/
114
+
115
+ # End of https://www.gitignore.io/api/python
116
+
117
+ # OSX files
118
+ .DS_Store
119
+
120
+ # Yarn cache
121
+ .yarn/
@@ -0,0 +1,6 @@
1
+ node_modules
2
+ **/node_modules
3
+ **/lib
4
+ **/package.json
5
+ !/package.json
6
+ purdue_af_shutdown_button
@@ -0,0 +1 @@
1
+ nodeLinker: node-modules
@@ -0,0 +1,5 @@
1
+ # Changelog
2
+
3
+ <!-- <START NEW CHANGELOG ENTRY> -->
4
+
5
+ <!-- <END NEW CHANGELOG ENTRY> -->
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2024, Dmitry Kondratyev
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,142 @@
1
+ Metadata-Version: 2.1
2
+ Name: purdue_af_shutdown_button
3
+ Version: 0.1.0
4
+ Summary: Adds a shutdown button to JupyterLab top-bar.
5
+ Project-URL: Repository, https://github.com/PurdueAF/purdue-af-extensions.git
6
+ Author-email: Dmitry Kondratyev <kondratyev.d.95@gmail.com>
7
+ License: BSD 3-Clause License
8
+
9
+ Copyright (c) 2024, Dmitry Kondratyev
10
+ All rights reserved.
11
+
12
+ Redistribution and use in source and binary forms, with or without
13
+ modification, are permitted provided that the following conditions are met:
14
+
15
+ 1. Redistributions of source code must retain the above copyright notice, this
16
+ list of conditions and the following disclaimer.
17
+
18
+ 2. Redistributions in binary form must reproduce the above copyright notice,
19
+ this list of conditions and the following disclaimer in the documentation
20
+ and/or other materials provided with the distribution.
21
+
22
+ 3. Neither the name of the copyright holder nor the names of its
23
+ contributors may be used to endorse or promote products derived from
24
+ this software without specific prior written permission.
25
+
26
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
30
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
33
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
34
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36
+ License-File: LICENSE
37
+ Classifier: Framework :: Jupyter
38
+ Classifier: Framework :: Jupyter :: JupyterLab
39
+ Classifier: Framework :: Jupyter :: JupyterLab :: 4
40
+ Classifier: Framework :: Jupyter :: JupyterLab :: Extensions
41
+ Classifier: Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt
42
+ Classifier: License :: OSI Approved :: BSD License
43
+ Classifier: Programming Language :: Python
44
+ Classifier: Programming Language :: Python :: 3
45
+ Classifier: Programming Language :: Python :: 3.8
46
+ Classifier: Programming Language :: Python :: 3.9
47
+ Classifier: Programming Language :: Python :: 3.10
48
+ Classifier: Programming Language :: Python :: 3.11
49
+ Classifier: Programming Language :: Python :: 3.12
50
+ Requires-Python: >=3.8
51
+ Description-Content-Type: text/markdown
52
+
53
+ # purdue_af_shutdown_button
54
+
55
+ Adds a shutdown button to JupyterLab top-bar.
56
+
57
+ To enable the button, the file `.jupyter/lab/user-settings/@jupyterlab/application-extension/top-bar.jupyterlab-settings` should contain the following:
58
+
59
+ ```json
60
+ {
61
+ "toolbar": [
62
+ {
63
+ "name": "shutdown",
64
+ "command": "jupyterlab-topbar:shutdown",
65
+ "disabled": false,
66
+ "rank": 100
67
+ }
68
+ ]
69
+ }
70
+ ```
71
+
72
+ ## Requirements
73
+
74
+ - JupyterLab >= 4.0.0
75
+
76
+ ## Install
77
+
78
+ To install the extension, execute:
79
+
80
+ ```bash
81
+ pip install purdue_af_shutdown_button
82
+ ```
83
+
84
+ ## Uninstall
85
+
86
+ To remove the extension, execute:
87
+
88
+ ```bash
89
+ pip uninstall purdue_af_shutdown_button
90
+ ```
91
+
92
+ ## Contributing
93
+
94
+ ### Development install
95
+
96
+ Note: You will need NodeJS to build the extension package.
97
+
98
+ The `jlpm` command is JupyterLab's pinned version of
99
+ [yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use
100
+ `yarn` or `npm` in lieu of `jlpm` below.
101
+
102
+ ```bash
103
+ # Clone the repo to your local environment
104
+ # Change directory to the purdue_af_shutdown_button directory
105
+ # Install package in development mode
106
+ pip install -e "."
107
+ # Link your development version of the extension with JupyterLab
108
+ jupyter labextension develop . --overwrite
109
+ # Rebuild extension Typescript source after making changes
110
+ jlpm build
111
+ ```
112
+
113
+ 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.
114
+
115
+ ```bash
116
+ # Watch the source directory in one terminal, automatically rebuilding when needed
117
+ jlpm watch
118
+ # Run JupyterLab in another terminal
119
+ jupyter lab
120
+ ```
121
+
122
+ 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).
123
+
124
+ 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:
125
+
126
+ ```bash
127
+ jupyter lab build --minimize=False
128
+ ```
129
+
130
+ ### Development uninstall
131
+
132
+ ```bash
133
+ pip uninstall purdue_af_shutdown_button
134
+ ```
135
+
136
+ In development mode, you will also need to remove the symlink created by `jupyter labextension develop`
137
+ command. To find its location, you can run `jupyter labextension list` to figure out where the `labextensions`
138
+ folder is located. Then you can remove the symlink named `purdue-af-shutdown-button` within that folder.
139
+
140
+ ### Packaging the extension
141
+
142
+ See [RELEASE](RELEASE.md)
@@ -0,0 +1,90 @@
1
+ # purdue_af_shutdown_button
2
+
3
+ Adds a shutdown button to JupyterLab top-bar.
4
+
5
+ To enable the button, the file `.jupyter/lab/user-settings/@jupyterlab/application-extension/top-bar.jupyterlab-settings` should contain the following:
6
+
7
+ ```json
8
+ {
9
+ "toolbar": [
10
+ {
11
+ "name": "shutdown",
12
+ "command": "jupyterlab-topbar:shutdown",
13
+ "disabled": false,
14
+ "rank": 100
15
+ }
16
+ ]
17
+ }
18
+ ```
19
+
20
+ ## Requirements
21
+
22
+ - JupyterLab >= 4.0.0
23
+
24
+ ## Install
25
+
26
+ To install the extension, execute:
27
+
28
+ ```bash
29
+ pip install purdue_af_shutdown_button
30
+ ```
31
+
32
+ ## Uninstall
33
+
34
+ To remove the extension, execute:
35
+
36
+ ```bash
37
+ pip uninstall purdue_af_shutdown_button
38
+ ```
39
+
40
+ ## Contributing
41
+
42
+ ### Development install
43
+
44
+ Note: You will need NodeJS to build the extension package.
45
+
46
+ The `jlpm` command is JupyterLab's pinned version of
47
+ [yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use
48
+ `yarn` or `npm` in lieu of `jlpm` below.
49
+
50
+ ```bash
51
+ # Clone the repo to your local environment
52
+ # Change directory to the purdue_af_shutdown_button directory
53
+ # Install package in development mode
54
+ pip install -e "."
55
+ # Link your development version of the extension with JupyterLab
56
+ jupyter labextension develop . --overwrite
57
+ # Rebuild extension Typescript source after making changes
58
+ jlpm build
59
+ ```
60
+
61
+ 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.
62
+
63
+ ```bash
64
+ # Watch the source directory in one terminal, automatically rebuilding when needed
65
+ jlpm watch
66
+ # Run JupyterLab in another terminal
67
+ jupyter lab
68
+ ```
69
+
70
+ 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).
71
+
72
+ 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:
73
+
74
+ ```bash
75
+ jupyter lab build --minimize=False
76
+ ```
77
+
78
+ ### Development uninstall
79
+
80
+ ```bash
81
+ pip uninstall purdue_af_shutdown_button
82
+ ```
83
+
84
+ In development mode, you will also need to remove the symlink created by `jupyter labextension develop`
85
+ command. To find its location, you can run `jupyter labextension list` to figure out where the `labextensions`
86
+ folder is located. Then you can remove the symlink named `purdue-af-shutdown-button` within that folder.
87
+
88
+ ### Packaging the extension
89
+
90
+ See [RELEASE](RELEASE.md)
@@ -0,0 +1,111 @@
1
+ # Making a new release of purdue_af_shutdown_button
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.
62
+
63
+ Check out the [workflow documentation](https://jupyter-releaser.readthedocs.io/en/latest/get_started/making_release_from_repo.html) for more information.
64
+
65
+ Here is a summary of the steps to cut a new release:
66
+
67
+ - Add tokens to the [Github Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets) in the repository:
68
+ - `ADMIN_GITHUB_TOKEN` (with "public_repo" and "repo:status" permissions); see the [documentation](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)
69
+ - `NPM_TOKEN` (with "automation" permission); see the [documentation](https://docs.npmjs.com/creating-and-viewing-access-tokens)
70
+ - Set up PyPI
71
+
72
+ <details><summary>Using PyPI trusted publisher (modern way)</summary>
73
+
74
+ - Set up your PyPI project by [adding a trusted publisher](https://docs.pypi.org/trusted-publishers/adding-a-publisher/)
75
+ - The _workflow name_ is `publish-release.yml` and the _environment_ should be left blank.
76
+ - Ensure the publish release job as `permissions`: `id-token : write` (see the [documentation](https://docs.pypi.org/trusted-publishers/using-a-publisher/))
77
+
78
+ </details>
79
+
80
+ <details><summary>Using PyPI token (legacy way)</summary>
81
+
82
+ - If the repo generates PyPI release(s), create a scoped PyPI [token](https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/#saving-credentials-on-github). We recommend using a scoped token for security reasons.
83
+
84
+ - You can store the token as `PYPI_TOKEN` in your fork's `Secrets`.
85
+
86
+ - Advanced usage: if you are releasing multiple repos, you can create a secret named `PYPI_TOKEN_MAP` instead of `PYPI_TOKEN` that is formatted as follows:
87
+
88
+ ```text
89
+ owner1/repo1,token1
90
+ owner2/repo2,token2
91
+ ```
92
+
93
+ If you have multiple Python packages in the same repository, you can point to them as follows:
94
+
95
+ ```text
96
+ owner1/repo1/path/to/package1,token1
97
+ owner1/repo1/path/to/package2,token2
98
+ ```
99
+
100
+ </details>
101
+
102
+ - Go to the Actions panel
103
+ - Run the "Step 1: Prep Release" workflow
104
+ - Check the draft changelog
105
+ - Run the "Step 2: Publish Release" workflow
106
+
107
+ ## Publishing to `conda-forge`
108
+
109
+ 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
110
+
111
+ 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,5 @@
1
+ {
2
+ "packageManager": "python",
3
+ "packageName": "purdue_af_shutdown_button",
4
+ "uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package purdue_af_shutdown_button"
5
+ }
@@ -0,0 +1,3 @@
1
+ sudo pip install -e "."
2
+ sudo jupyter labextension develop . --overwrite
3
+ sudo jlpm build