jupyter-builder 0.1.0a2__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 (33) hide show
  1. jupyter_builder-0.1.0a2/.copier-answers.yml +14 -0
  2. jupyter_builder-0.1.0a2/.gitignore +155 -0
  3. jupyter_builder-0.1.0a2/.licenserc.yaml +24 -0
  4. jupyter_builder-0.1.0a2/.pre-commit-config.yaml +72 -0
  5. jupyter_builder-0.1.0a2/.prettierignore +6 -0
  6. jupyter_builder-0.1.0a2/.yarnrc.yml +1 -0
  7. jupyter_builder-0.1.0a2/CHANGELOG.md +40 -0
  8. jupyter_builder-0.1.0a2/LICENSE +29 -0
  9. jupyter_builder-0.1.0a2/PKG-INFO +119 -0
  10. jupyter_builder-0.1.0a2/README.md +48 -0
  11. jupyter_builder-0.1.0a2/RELEASE.md +73 -0
  12. jupyter_builder-0.1.0a2/jupyter_builder/__init__.py +13 -0
  13. jupyter_builder-0.1.0a2/jupyter_builder/base_extension_app.py +65 -0
  14. jupyter_builder-0.1.0a2/jupyter_builder/commands.py +115 -0
  15. jupyter_builder-0.1.0a2/jupyter_builder/core_path.py +10 -0
  16. jupyter_builder-0.1.0a2/jupyter_builder/debug_log_file_mixin.py +64 -0
  17. jupyter_builder-0.1.0a2/jupyter_builder/extension_commands/__init__.py +2 -0
  18. jupyter_builder-0.1.0a2/jupyter_builder/extension_commands/build.py +56 -0
  19. jupyter_builder-0.1.0a2/jupyter_builder/extension_commands/develop.py +58 -0
  20. jupyter_builder-0.1.0a2/jupyter_builder/extension_commands/watch.py +54 -0
  21. jupyter_builder-0.1.0a2/jupyter_builder/federated_extensions.py +492 -0
  22. jupyter_builder-0.1.0a2/jupyter_builder/federated_extensions_requirements.py +74 -0
  23. jupyter_builder-0.1.0a2/jupyter_builder/jlpm.py +43 -0
  24. jupyter_builder-0.1.0a2/jupyter_builder/jupyterlab_semver.py +252 -0
  25. jupyter_builder-0.1.0a2/jupyter_builder/jupyterlab_server_req.py +66 -0
  26. jupyter_builder-0.1.0a2/jupyter_builder/main.py +54 -0
  27. jupyter_builder-0.1.0a2/jupyter_builder/yarn.js +878 -0
  28. jupyter_builder-0.1.0a2/package.json +136 -0
  29. jupyter_builder-0.1.0a2/pyproject.toml +152 -0
  30. jupyter_builder-0.1.0a2/src/index.ts +6 -0
  31. jupyter_builder-0.1.0a2/tests/test_tpl.py +168 -0
  32. jupyter_builder-0.1.0a2/tsconfig.json +23 -0
  33. jupyter_builder-0.1.0a2/yarn.lock +2696 -0
@@ -0,0 +1,14 @@
1
+ # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2
+ _commit: v4.3.4
3
+ _src_path: https://github.com/jupyterlab/extension-template
4
+ author_email: jupyter@googlegroups.com
5
+ author_name: Jupyter Development Team
6
+ has_binder: false
7
+ has_settings: false
8
+ kind: frontend
9
+ labextension_name: '@jupyterlab/builder'
10
+ project_short_description: Jupyter build tools.
11
+ python_name: jupyter_builder
12
+ repository: https://github.com/jupyterlab/jupyterlab-builder
13
+ test: false
14
+
@@ -0,0 +1,155 @@
1
+ *.bundle.*
2
+ lib/
3
+ node_modules/
4
+ *.log
5
+ .eslintcache
6
+ .stylelintcache
7
+ *.egg-info/
8
+ .ipynb_checkpoints
9
+ *.tsbuildinfo
10
+ # Version file is handled by hatchling
11
+ jupyter_builder/_version.py
12
+
13
+ # Created by https://www.gitignore.io/api/python
14
+ # Edit at https://www.gitignore.io/?templates=python
15
+
16
+ ### Python ###
17
+ # Byte-compiled / optimized / DLL files
18
+ __pycache__/
19
+ *.py[cod]
20
+ *$py.class
21
+
22
+ # C extensions
23
+ *.so
24
+
25
+ # Distribution / packaging
26
+ .Python
27
+ build/
28
+ develop-eggs/
29
+ dist/
30
+ downloads/
31
+ eggs/
32
+ .eggs/
33
+ lib/
34
+ lib64/
35
+ parts/
36
+ sdist/
37
+ var/
38
+ wheels/
39
+ pip-wheel-metadata/
40
+ share/python-wheels/
41
+ *.egg-info/
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
+ *.py,cover
68
+ .hypothesis/
69
+ .pytest_cache/
70
+ cover/
71
+
72
+ # Translations
73
+ *.mo
74
+ *.pot
75
+
76
+ # Scrapy stuff:
77
+ .scrapy
78
+
79
+ # Sphinx documentation
80
+ docs/_build/
81
+
82
+ # PyBuilder
83
+ .pybuilder/
84
+ target/
85
+
86
+ # Jupyter Notebook
87
+ .ipynb_checkpoints
88
+
89
+ # IPython
90
+ profile_default/
91
+ ipython_config.py
92
+
93
+ # pyenv
94
+ .python-version
95
+
96
+ # celery beat schedule file
97
+ celerybeat-schedule
98
+ celerybeat.pid
99
+
100
+ # SageMath parsed files
101
+ *.sage.py
102
+
103
+ # Environments
104
+ .env
105
+ .venv
106
+ env/
107
+ venv/
108
+ ENV/
109
+ env.bak/
110
+ venv.bak/
111
+
112
+ # Spyder project settings
113
+ .spyderproject
114
+ .spyproject
115
+
116
+ # Rope project settings
117
+ .ropeproject
118
+
119
+ # Mr Developer
120
+ .mr.developer.cfg
121
+ .project
122
+ .pydevproject
123
+
124
+ # mkdocs documentation
125
+ /site
126
+
127
+ # mypy
128
+ .mypy_cache/
129
+ .dmypy.json
130
+ dmypy.json
131
+
132
+ # Pyre type checker
133
+ .pyre/
134
+
135
+ # pytype static type analyzer
136
+ .pytype/
137
+
138
+ # Cython debug symbols
139
+ cython_debug/
140
+
141
+ # PyCharm
142
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
143
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
144
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
145
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
146
+ #.idea/
147
+ junit.xml
148
+
149
+ # End of https://www.gitignore.io/api/python
150
+
151
+ # OSX files
152
+ .DS_Store
153
+
154
+ # Yarn cache
155
+ .yarn/
@@ -0,0 +1,24 @@
1
+ header:
2
+ license:
3
+ spdx-id: BSD-3-Clause
4
+ copyright-owner: Jupyter Development Team
5
+ software-name: JupyterLab
6
+ content: |
7
+ Copyright (c) Jupyter Development Team.
8
+ Distributed under the terms of the Modified BSD License.
9
+
10
+ paths-ignore:
11
+ - '**/*.ipynb'
12
+ - '**/*.json'
13
+ - '**/*.md'
14
+ - '**/*.yml'
15
+ - '**/*.yaml'
16
+ - '**/build'
17
+ - '**/.*'
18
+ - 'LICENSE'
19
+ - tsconfig.tsbuildinfo
20
+ - node_modules/**
21
+ - node_modules/.**
22
+ - 'yarn.lock'
23
+
24
+ comment: on-failure
@@ -0,0 +1,72 @@
1
+ ci:
2
+ autoupdate_schedule: monthly
3
+ autoupdate_commit_msg: "chore: update pre-commit hooks"
4
+
5
+ repos:
6
+ - repo: https://github.com/pre-commit/pre-commit-hooks
7
+ rev: v4.5.0
8
+ hooks:
9
+ - id: check-case-conflict
10
+ - id: check-ast
11
+ - id: check-docstring-first
12
+ - id: check-executables-have-shebangs
13
+ - id: check-added-large-files
14
+ - id: check-case-conflict
15
+ - id: check-merge-conflict
16
+ - id: check-json
17
+ - id: check-toml
18
+ - id: check-yaml
19
+ - id: debug-statements
20
+ - id: end-of-file-fixer
21
+ exclude: \.copier-answers\.yml
22
+ - id: trailing-whitespace
23
+
24
+ - repo: https://github.com/python-jsonschema/check-jsonschema
25
+ rev: 0.27.4
26
+ hooks:
27
+ - id: check-github-workflows
28
+
29
+ - repo: https://github.com/executablebooks/mdformat
30
+ rev: 0.7.17
31
+ hooks:
32
+ - id: mdformat
33
+ additional_dependencies:
34
+ [mdformat-gfm, mdformat-frontmatter, mdformat-footnote]
35
+
36
+ - repo: https://github.com/codespell-project/codespell
37
+ rev: "v2.2.6"
38
+ hooks:
39
+ - id: codespell
40
+ args: ["-L", "sur,nd"]
41
+ exclude: jupyter_builder/yarn.js
42
+
43
+ - repo: https://github.com/pre-commit/pygrep-hooks
44
+ rev: "v1.10.0"
45
+ hooks:
46
+ - id: rst-backticks
47
+ - id: rst-directive-colons
48
+ - id: rst-inline-touching-normal
49
+
50
+ - repo: https://github.com/pre-commit/mirrors-mypy
51
+ rev: "v1.8.0"
52
+ hooks:
53
+ - id: mypy
54
+ files: jupyter_server
55
+ stages: [manual]
56
+ additional_dependencies:
57
+ ["traitlets>=5.13"]
58
+
59
+ - repo: https://github.com/astral-sh/ruff-pre-commit
60
+ rev: v0.3.4
61
+ hooks:
62
+ # - id: ruff
63
+ # types_or: [python, jupyter]
64
+ # args: ["--fix", "--show-fixes"]
65
+ - id: ruff-format
66
+ types_or: [python, jupyter]
67
+
68
+ # - repo: https://github.com/scientific-python/cookie
69
+ # rev: "2024.01.24"
70
+ # hooks:
71
+ # - id: sp-repo-review
72
+ # additional_dependencies: ["repo-review[cli]"]
@@ -0,0 +1,6 @@
1
+ node_modules
2
+ **/node_modules
3
+ **/lib
4
+ **/package.json
5
+ !/package.json
6
+ jupyter_builder
@@ -0,0 +1 @@
1
+ nodeLinker: node-modules
@@ -0,0 +1,40 @@
1
+ # Changelog
2
+
3
+ <!-- <START NEW CHANGELOG ENTRY> -->
4
+
5
+ ## 0.1.0a2
6
+
7
+ ([Full Changelog](https://github.com/jupyterlab/jupyter-builder/compare/ac6bb51518d309b96658dc45784f4d47a7cd559c...02764ce51fd919bdb5739e06d545656ee0e5b2c9))
8
+
9
+ ### Enhancements made
10
+
11
+ - Include jlpm within this package (Issue #15) [#20](https://github.com/jupyterlab/jupyter-builder/pull/20) ([@cronan03](https://github.com/cronan03))
12
+ - Watch feature and tests [#18](https://github.com/jupyterlab/jupyter-builder/pull/18) ([@cronan03](https://github.com/cronan03))
13
+ - Build feature and Tests [#13](https://github.com/jupyterlab/jupyter-builder/pull/13) ([@cronan03](https://github.com/cronan03))
14
+ - Develop command working [#11](https://github.com/jupyterlab/jupyter-builder/pull/11) ([@cronan03](https://github.com/cronan03))
15
+
16
+ ### Bugs fixed
17
+
18
+ - Comment npm related release hook [#25](https://github.com/jupyterlab/jupyter-builder/pull/25) ([@fcollonval](https://github.com/fcollonval))
19
+
20
+ ### Maintenance and upkeep improvements
21
+
22
+ - Scaffolding for adding a npm package and setting up the releaser [#23](https://github.com/jupyterlab/jupyter-builder/pull/23) ([@fcollonval](https://github.com/fcollonval))
23
+ - Bump ruff from 0.4.2 to 0.4.7 in the pip group [#9](https://github.com/jupyterlab/jupyter-builder/pull/9) ([@dependabot](https://github.com/dependabot))
24
+ - Bump ruff from 0.3.4 to 0.4.2 in the pip group [#7](https://github.com/jupyterlab/jupyter-builder/pull/7) ([@dependabot](https://github.com/dependabot))
25
+ - Bump apache/skywalking-eyes from 97538682f556b56cc7422ece660d8d7e6c4fb013 to cd7b195c51fd3d6ad52afceb760719ddc6b3ee91 in the actions group [#6](https://github.com/jupyterlab/jupyter-builder/pull/6) ([@dependabot](https://github.com/dependabot))
26
+ - Bump the pip group with 1 update [#5](https://github.com/jupyterlab/jupyter-builder/pull/5) ([@dependabot](https://github.com/dependabot))
27
+ - Bump the actions group with 1 update [#4](https://github.com/jupyterlab/jupyter-builder/pull/4) ([@dependabot](https://github.com/dependabot))
28
+ - Add skeleton [#2](https://github.com/jupyterlab/jupyter-builder/pull/2) ([@fcollonval](https://github.com/fcollonval))
29
+
30
+ ### Documentation improvements
31
+
32
+ - Documentation [#22](https://github.com/jupyterlab/jupyter-builder/pull/22) ([@cronan03](https://github.com/cronan03))
33
+
34
+ ### Contributors to this release
35
+
36
+ ([GitHub contributors page for this release](https://github.com/jupyterlab/jupyter-builder/graphs/contributors?from=2024-03-04&to=2024-07-29&type=c))
37
+
38
+ [@cronan03](https://github.com/search?q=repo%3Ajupyterlab%2Fjupyter-builder+involves%3Acronan03+updated%3A2024-03-04..2024-07-29&type=Issues) | [@dependabot](https://github.com/search?q=repo%3Ajupyterlab%2Fjupyter-builder+involves%3Adependabot+updated%3A2024-03-04..2024-07-29&type=Issues) | [@fcollonval](https://github.com/search?q=repo%3Ajupyterlab%2Fjupyter-builder+involves%3Afcollonval+updated%3A2024-03-04..2024-07-29&type=Issues) | [@kloczek](https://github.com/search?q=repo%3Ajupyterlab%2Fjupyter-builder+involves%3Akloczek+updated%3A2024-03-04..2024-07-29&type=Issues) | [@welcome](https://github.com/search?q=repo%3Ajupyterlab%2Fjupyter-builder+involves%3Awelcome+updated%3A2024-03-04..2024-07-29&type=Issues)
39
+
40
+ <!-- <END NEW CHANGELOG ENTRY> -->
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2024, Jupyter Development Team
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,119 @@
1
+ Metadata-Version: 2.3
2
+ Name: jupyter_builder
3
+ Version: 0.1.0a2
4
+ Summary: JupyterLab build tools
5
+ Project-URL: Homepage, https://jupyter.org
6
+ Project-URL: Source, https://github.com/jupyterlab/jupyterlab_builder
7
+ Project-URL: Issues, https://github.com/jupyterlab/jupyterlab_builder/issues/new/choose
8
+ Project-URL: Gitter, https://gitter.im/jupyterlab/jupyterlab
9
+ Project-URL: Pypi, https://pypi.org/project/jupyter-builder
10
+ Author-email: Jupyter Development Team <jupyter@googlegroups.com>
11
+ License: BSD 3-Clause License
12
+
13
+ Copyright (c) 2024, Jupyter Development Team
14
+ All rights reserved.
15
+
16
+ Redistribution and use in source and binary forms, with or without
17
+ modification, are permitted provided that the following conditions are met:
18
+
19
+ 1. Redistributions of source code must retain the above copyright notice, this
20
+ list of conditions and the following disclaimer.
21
+
22
+ 2. Redistributions in binary form must reproduce the above copyright notice,
23
+ this list of conditions and the following disclaimer in the documentation
24
+ and/or other materials provided with the distribution.
25
+
26
+ 3. Neither the name of the copyright holder nor the names of its
27
+ contributors may be used to endorse or promote products derived from
28
+ this software without specific prior written permission.
29
+
30
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
31
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
33
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
34
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
35
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
36
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
37
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
38
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40
+ License-File: LICENSE
41
+ Keywords: ipython,jupyter
42
+ Classifier: Framework :: Jupyter
43
+ Classifier: Framework :: Jupyter :: JupyterLab
44
+ Classifier: Framework :: Jupyter :: JupyterLab :: 4
45
+ Classifier: Intended Audience :: Developers
46
+ Classifier: License :: OSI Approved :: BSD License
47
+ Classifier: Programming Language :: Python
48
+ Classifier: Programming Language :: Python :: 3
49
+ Classifier: Programming Language :: Python :: 3.8
50
+ Classifier: Programming Language :: Python :: 3.9
51
+ Classifier: Programming Language :: Python :: 3.10
52
+ Classifier: Programming Language :: Python :: 3.11
53
+ Classifier: Programming Language :: Python :: 3.12
54
+ Requires-Python: >=3.8
55
+ Requires-Dist: traitlets
56
+ Provides-Extra: dev
57
+ Requires-Dist: build; extra == 'dev'
58
+ Requires-Dist: hatch; extra == 'dev'
59
+ Requires-Dist: mypy; extra == 'dev'
60
+ Requires-Dist: pre-commit; extra == 'dev'
61
+ Requires-Dist: ruff==0.4.7; extra == 'dev'
62
+ Provides-Extra: test
63
+ Requires-Dist: copier<10,>=9.2; extra == 'test'
64
+ Requires-Dist: coverage; extra == 'test'
65
+ Requires-Dist: jinja2-time; extra == 'test'
66
+ Requires-Dist: jupyterlab; extra == 'test'
67
+ Requires-Dist: pytest-check-links>=0.7; extra == 'test'
68
+ Requires-Dist: pytest-cov; extra == 'test'
69
+ Requires-Dist: pytest>=7.0; extra == 'test'
70
+ Description-Content-Type: text/markdown
71
+
72
+ # Jupyter Builder - GSoC 2024
73
+
74
+ Build tools for JupyterLab (and remixes)
75
+
76
+ > This _will_ start as an extraction of the builder tools currently included in
77
+ > the core [JupyterLab](https://github.com/jupyterlab/jupyterlab).
78
+
79
+ ## Why extracting the build tools?
80
+
81
+ - This would also solve some chicken-and-egg problems like jupyterlab/jupyterlab_pygments#23.
82
+ - Isolating the builder functionalities will simplify the work
83
+ of core and extension developers who can now focus on their respective parts of the
84
+ codebase instead of the earlier intertwined code. It will in particular reduce the need to update the maintenance tooling to produce extension compatible with newer version of Jupyter app.
85
+
86
+ ## How to install the package?
87
+
88
+ Execute the following command in a terminal:
89
+
90
+ ```
91
+ pip install jupyter_builder
92
+ ```
93
+
94
+ ## What does it do?
95
+
96
+ - Provides a CLI for building Jupyter extensions. There are 3 subcommands
97
+ - `build` : Builds the Jupyter extension JavaScript assets to be consumed by the Jupyter app.
98
+ ```
99
+ jupyter-builder build <path to extension folder>
100
+ ```
101
+ - `develop` : Install the Jupyter extension JavaScript assets in dev mode for consumption in the Jupyter app. It similar to [editable install mode of pip](https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs)
102
+ ```
103
+ jupyter-builder develop --overwrite (path to extension folder)
104
+ ```
105
+ - `watch` : Automatically rebuild the development JavaScript assets when one file is changed to ease development.
106
+ ```
107
+ jupyter-builder watch (path to extension folder)
108
+ ```
109
+ - Provides a NPM package manager: `jlpm`
110
+
111
+ ## How to uninstall the package?
112
+
113
+ Execute the following command in a terminal:
114
+
115
+ ```
116
+ pip uninstall jupyter_builder
117
+ ```
118
+
119
+ See https://github.com/jupyterlab/jupyterlab/issues/13456
@@ -0,0 +1,48 @@
1
+ # Jupyter Builder - GSoC 2024
2
+
3
+ Build tools for JupyterLab (and remixes)
4
+
5
+ > This _will_ start as an extraction of the builder tools currently included in
6
+ > the core [JupyterLab](https://github.com/jupyterlab/jupyterlab).
7
+
8
+ ## Why extracting the build tools?
9
+
10
+ - This would also solve some chicken-and-egg problems like jupyterlab/jupyterlab_pygments#23.
11
+ - Isolating the builder functionalities will simplify the work
12
+ of core and extension developers who can now focus on their respective parts of the
13
+ codebase instead of the earlier intertwined code. It will in particular reduce the need to update the maintenance tooling to produce extension compatible with newer version of Jupyter app.
14
+
15
+ ## How to install the package?
16
+
17
+ Execute the following command in a terminal:
18
+
19
+ ```
20
+ pip install jupyter_builder
21
+ ```
22
+
23
+ ## What does it do?
24
+
25
+ - Provides a CLI for building Jupyter extensions. There are 3 subcommands
26
+ - `build` : Builds the Jupyter extension JavaScript assets to be consumed by the Jupyter app.
27
+ ```
28
+ jupyter-builder build <path to extension folder>
29
+ ```
30
+ - `develop` : Install the Jupyter extension JavaScript assets in dev mode for consumption in the Jupyter app. It similar to [editable install mode of pip](https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs)
31
+ ```
32
+ jupyter-builder develop --overwrite (path to extension folder)
33
+ ```
34
+ - `watch` : Automatically rebuild the development JavaScript assets when one file is changed to ease development.
35
+ ```
36
+ jupyter-builder watch (path to extension folder)
37
+ ```
38
+ - Provides a NPM package manager: `jlpm`
39
+
40
+ ## How to uninstall the package?
41
+
42
+ Execute the following command in a terminal:
43
+
44
+ ```
45
+ pip uninstall jupyter_builder
46
+ ```
47
+
48
+ See https://github.com/jupyterlab/jupyterlab/issues/13456
@@ -0,0 +1,73 @@
1
+ # Making a new release of jupyter_builder
2
+
3
+ The package can be published to `PyPI` 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
+
19
+ ```bash
20
+ hatch version <new-version>
21
+ ```
22
+
23
+ You could also clean up the local git repository:
24
+
25
+ ```bash
26
+ git clean -dfX
27
+ ```
28
+
29
+ To create a Python source package (`.tar.gz`) and the binary package (`.whl`) in the `dist/` directory, do:
30
+
31
+ ```bash
32
+ python -m build
33
+ ```
34
+
35
+ > `python setup.py sdist bdist_wheel` is deprecated and will not work for this package.
36
+
37
+ Then to upload the package to PyPI, do:
38
+
39
+ ```bash
40
+ twine upload dist/*
41
+ ```
42
+
43
+ ### NPM package
44
+
45
+ To publish the frontend part of the extension as a NPM package, do:
46
+
47
+ ```bash
48
+ npm login
49
+ npm publish --access public
50
+ ```
51
+
52
+ ## Automated releases with the Jupyter Releaser
53
+
54
+ The extension repository should already be compatible with the Jupyter Releaser. But
55
+ the GitHub repository and the package managers need to be properly set up. Please
56
+ follow the instructions of the Jupyter Releaser [checklist](https://jupyter-releaser.readthedocs.io/en/latest/how_to_guides/convert_repo_from_repo.html).
57
+
58
+ Here is a summary of the steps to cut a new release:
59
+
60
+ - Go to the Actions panel
61
+ - Run the "Step 1: Prep Release" workflow
62
+ - Check the draft changelog
63
+ - Run the "Step 2: Publish Release" workflow
64
+
65
+ > \[!NOTE\]
66
+ > Check out the [workflow documentation](https://jupyter-releaser.readthedocs.io/en/latest/get_started/making_release_from_repo.html)
67
+ > for more information.
68
+
69
+ ## Publishing to `conda-forge`
70
+
71
+ 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
72
+
73
+ 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,13 @@
1
+ # Copyright (c) Jupyter Development Team.
2
+ # Distributed under the terms of the Modified BSD License.
3
+
4
+ try:
5
+ from ._version import __version__
6
+ except ImportError:
7
+ # Fallback when using the package in dev mode without installing
8
+ # in editable mode with pip. It is highly recommended to install
9
+ # the package from a stable release or in editable mode: https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs
10
+ import warnings
11
+
12
+ warnings.warn("Importing 'jupyter_builder' outside a proper installation.")
13
+ __version__ = "dev"
@@ -0,0 +1,65 @@
1
+ """Jupyter LabExtension Entry Points."""
2
+
3
+ # Copyright (c) Jupyter Development Team.
4
+ # Distributed under the terms of the Modified BSD License.
5
+
6
+ from __future__ import annotations
7
+ import os
8
+ from copy import copy
9
+
10
+ from jupyter_core.application import JupyterApp, base_aliases, base_flags
11
+ from jupyter_core.paths import jupyter_path
12
+ from traitlets import List, Unicode, default
13
+
14
+ from .debug_log_file_mixin import DebugLogFileMixin
15
+
16
+ HERE = os.path.dirname(os.path.abspath(__file__))
17
+
18
+
19
+ # from .federated_labextensions import build_labextension, develop_labextension_py, watch_labextension
20
+
21
+ flags = dict(base_flags)
22
+
23
+ develop_flags = copy(flags)
24
+ develop_flags["overwrite"] = (
25
+ {"DevelopLabExtensionApp": {"overwrite": True}},
26
+ "Overwrite files",
27
+ )
28
+
29
+ aliases = dict(base_aliases)
30
+ aliases["debug-log-path"] = "DebugLogFileMixin.debug_log_path"
31
+
32
+ # VERSION = get_app_version()
33
+ VERSION = 1
34
+
35
+
36
+ class BaseExtensionApp(JupyterApp, DebugLogFileMixin):
37
+ version = VERSION
38
+ flags = flags
39
+ aliases = aliases
40
+ name = "lab"
41
+
42
+ labextensions_path = List(
43
+ Unicode(),
44
+ help="The standard paths to look in for prebuilt JupyterLab extensions",
45
+ )
46
+
47
+ # @default("labextensions_path")
48
+ # def _default_labextensions_path(self):
49
+ # lab = LabApp()
50
+ # lab.load_config_file()
51
+ # return lab.extra_labextensions_path + lab.labextensions_path
52
+ @default("labextensions_path")
53
+ def _default_labextensions_path(self) -> list[str]:
54
+ return jupyter_path("labextensions")
55
+
56
+ def start(self):
57
+ with self.debug_logging():
58
+ self.run_task()
59
+
60
+ def run_task(self):
61
+ pass
62
+
63
+ def _log_format_default(self):
64
+ """A default format for messages"""
65
+ return "%(message)s"