A monorepo containing jupyter-blocks and jupyter-tidyblocks. Blockly extension for JupyterLab.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Uses hatch

+113 -199
+1 -3
.github/workflows/build.yml
··· 17 17 uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 18 18 19 19 - name: Install dependencies 20 - run: python -m pip install -U check-manifest jupyterlab 20 + run: python -m pip install -U jupyterlab~=3.4 21 21 22 22 - name: Build the extension 23 23 run: | ··· 29 29 jupyter labextension list 30 30 jupyter labextension list 2>&1 | grep -ie "jupyterlab-blockly-extension.*OK" 31 31 python -m jupyterlab.browser_check 32 - 33 - check-manifest -v 34 32 35 33 pip install build 36 34 python -m build --sdist
+9 -45
.github/workflows/check-release.yml
··· 1 1 name: Check Release 2 2 on: 3 3 push: 4 - branches: 5 - - main 4 + branches: ["main"] 6 5 pull_request: 7 - branches: 8 - - main 9 - 10 - permissions: 11 - contents: write 6 + branches: ["*"] 12 7 13 8 jobs: 14 9 check_release: 15 10 runs-on: ubuntu-latest 16 11 steps: 17 12 - name: Checkout 18 - uses: actions/checkout@v2 19 - - name: Install Python 20 - uses: actions/setup-python@v2 21 - with: 22 - python-version: 3.9 23 - architecture: 'x64' 24 - - name: Install node 25 - uses: actions/setup-node@v2 26 - with: 27 - node-version: '14.x' 28 - 29 - 30 - - name: Get pip cache dir 31 - id: pip-cache 32 - run: | 33 - echo "::set-output name=dir::$(pip cache dir)" 34 - - name: Cache pip 35 - uses: actions/cache@v1 36 - with: 37 - path: ${{ steps.pip-cache.outputs.dir }} 38 - key: ${{ runner.os }}-pip-${{ hashFiles('package.json') }} 39 - restore-keys: | 40 - ${{ runner.os }}-pip- 41 - - name: Cache checked links 42 - uses: actions/cache@v2 43 - with: 44 - path: ~/.cache/pytest-link-check 45 - key: ${{ runner.os }}-linkcheck-${{ hashFiles('**/.md') }}-md-links 46 - restore-keys: | 47 - ${{ runner.os }}-linkcheck- 48 - - name: Upgrade packaging dependencies 49 - run: | 50 - pip install --upgrade pip setuptools wheel jupyter-packaging~=0.10 --user 13 + uses: actions/checkout@v3 14 + - name: Base Setup 15 + uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 51 16 - name: Install Dependencies 52 17 run: | 53 - pip install . 18 + pip install -e . 54 19 - name: Check Release 55 - uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v1 20 + uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2 56 21 with: 57 22 token: ${{ secrets.GITHUB_TOKEN }} 58 - 59 23 - name: Upload Distributions 60 - uses: actions/upload-artifact@v2 24 + uses: actions/upload-artifact@v3 61 25 with: 62 - name: jupyterlab_blockly-releaser-dist-${{ github.run_number }} 26 + name: jupyterlab_blockly-releaser-dist-${{ '{{ github.run_number }}' }} 63 27 path: .jupyter_releaser_checkout/dist
-38
MANIFEST.in
··· 1 - include LICENSE 2 - include *.md 3 - include pyproject.toml 4 - 5 - include package.json 6 - include install.json 7 - include ts*.json 8 - include yarn.lock 9 - 10 - graft jupyterlab_blockly/labextension 11 - recursive-include patches *.patch 12 - 13 - # Javascript files 14 - graft packages/blockly-extension 15 - prune **/node_modules 16 - prune lib 17 - prune binder 18 - prune scripts 19 - 20 - # Patterns to exclude from any directory 21 - global-exclude *~ 22 - global-exclude *.pyc 23 - global-exclude *.pyo 24 - global-exclude .git 25 - global-exclude .ipynb_checkpoints 26 - 27 - # Documentation 28 - recursive-include docs *.bat 29 - recursive-include docs *.gif 30 - recursive-include docs *.md 31 - recursive-include docs *.png 32 - recursive-include docs *.rst 33 - recursive-include docs *.txt 34 - recursive-include docs Makefile 35 - recursive-include docs *.py 36 - 37 - # Examples 38 - recursive-include examples *.jpblockly
+1 -1
lerna.json
··· 1 1 { 2 2 "lerna": "5.1.0", 3 - "version": "independent", 3 + "version": "0.2.1", 4 4 "npmClient": "yarn", 5 5 "useWorkspaces": true 6 6 }
+16 -1
package.json
··· 1 1 { 2 2 "name": "jupyterlab-blockly-root", 3 - "version": "0.1.0", 4 3 "private": true, 4 + "version": "0.2.1", 5 + "description": "Blockly extension for JupyterLab.", 6 + "keywords": [ 7 + "jupyter", 8 + "jupyterlab", 9 + "jupyterlab-extension" 10 + ], 11 + "homepage": "https://github.com/quantstack/jupyterlab-blockly", 12 + "bugs": { 13 + "url": "https://github.com/quantstack/jupyterlab-blockly/issues" 14 + }, 15 + "license": "BSD-3-Clause", 16 + "author": { 17 + "name": "quantstack", 18 + "email": "" 19 + }, 5 20 "workspaces": { 6 21 "packages": [ 7 22 "packages/*"
+67 -14
pyproject.toml
··· 1 1 [build-system] 2 - requires = ["jupyter_packaging~=0.10,<2", "jupyterlab~=3.4"] 3 - build-backend = "jupyter_packaging.build_api" 2 + build-backend = "hatchling.build" 3 + requires = ["hatchling>=1.4.0", "hatch-nodejs-version", "jupyterlab~=3.4"] 4 + 5 + [project] 6 + name = "jupyterlab_blockly" 7 + readme = "README.md" 8 + license = { file = "LICENSE" } 9 + requires-python = ">=3.7" 10 + classifiers = [ 11 + "Framework :: Jupyter", 12 + "Framework :: Jupyter :: JupyterLab", 13 + "Framework :: Jupyter :: JupyterLab :: 3", 14 + "Framework :: Jupyter :: JupyterLab :: Extensions", 15 + "Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt", 16 + "License :: OSI Approved :: BSD License", 17 + "Programming Language :: Python", 18 + "Programming Language :: Python :: 3", 19 + "Programming Language :: Python :: 3.7", 20 + "Programming Language :: Python :: 3.8", 21 + "Programming Language :: Python :: 3.9", 22 + "Programming Language :: Python :: 3.10", 23 + "Programming Language :: Python :: 3.11", 24 + ] 25 + dependencies = [ 26 + "jupyterlab~=3.4" 27 + ] 28 + dynamic = ["version", "description", "authors", "urls", "keywords"] 29 + 30 + [project.optional-dependencies] 31 + dev = [ 32 + "click", 33 + "jupyter_releaser==0.22" 34 + ] 35 + 36 + [tool.hatch.version] 37 + source = "nodejs" 38 + 39 + [tool.hatch.metadata.hooks.nodejs] 40 + fields = ["description", "authors", "urls"] 41 + 42 + [tool.hatch.build] 43 + artifacts = ["package.json", "scripts", "packages", "patches", "jupyterlab_blockly/labextension"] 44 + exclude = [".github", "binder"] 4 45 5 - [tool.jupyter-packaging.options] 6 - skip-if-exists = ["jupyterlab_blockly/labextension/static/style.js"] 7 - ensured-targets = ["jupyterlab_blockly/labextension/static/style.js", "jupyterlab_blockly/labextension/package.json"] 46 + [tool.hatch.build.targets.wheel.shared-data] 47 + "jupyterlab_blockly/labextension" = "share/jupyter/labextensions/jupyterlab-blockly-extension" 48 + "install.json" = "share/jupyter/labextensions/jupyterlab-blockly-extension/install.json" 8 49 9 - [tool.jupyter-packaging.builder] 10 - factory = "jupyter_packaging.npm_builder" 50 + [tool.hatch.build.hooks.jupyter-builder] 51 + dependencies = ["hatch-jupyter-builder>=0.5"] 52 + build-function = "hatch_jupyter_builder.npm_builder" 53 + ensured-targets = [ 54 + "jupyterlab_blockly/labextension/static/style.js", 55 + "jupyterlab_blockly/labextension/package.json", 56 + ] 57 + skip-if-exists = ["jupyterlab_blockly/labextension/static/style.js"] 11 58 12 - [tool.jupyter-packaging.build-args] 59 + [tool.hatch.build.hooks.jupyter-builder.build-kwargs] 13 60 build_cmd = "build:prod" 14 61 npm = ["jlpm"] 15 62 16 - [tool.check-manifest] 17 - ignore = ["jupyterlab_blockly/labextension/**", "packages/**", "assets/**", "lerna.json", "yarn.lock", ".*", "package-lock.json", "docs/**"] 18 - 19 - [tool.jupyter-releaser.hooks] 20 - before-bump-version = ["python -m pip install jupyterlab~=3.4"] 21 - before-build-npm = ["python -m pip install jupyterlab", "jlpm"] 63 + [tool.hatch.build.hooks.jupyter-builder.editable-build-kwargs] 64 + build_cmd = "install:extension" 65 + npm = ["jlpm"] 66 + build_dir = "jupyterlab_blockly/labextension" 22 67 23 68 [tool.jupyter-releaser.options] 24 69 version-cmd = "python scripts/bump-version.py --force" 70 + 71 + [tool.jupyter-releaser.hooks] 72 + before-bump-version = ["python -m pip install jupyterlab~=3.4", "jlpm"] 73 + before-build-npm = ["python -m pip install jupyterlab~=3.4", "jlpm", "jlpm build:prod"] 74 + before-build-python = ["jlpm clean:all"] 75 + 76 + [tool.check-wheel-contents] 77 + ignore = ["W002"]
+17
scripts/bump-version.py
··· 7 7 # The full license is in the file LICENSE, distributed with this software. # 8 8 ############################################################################# 9 9 10 + import json 11 + from pathlib import Path 12 + 10 13 import click 11 14 from jupyter_releaser.util import get_version, run 12 15 from pkg_resources import parse_version ··· 53 56 if force: 54 57 lerna_cmd += " --yes" 55 58 run(lerna_cmd) 59 + 60 + HERE = Path(__file__).parent.parent.resolve() 61 + path = HERE.joinpath("package.json") 62 + if path.exists(): 63 + with path.open(mode="r") as f: 64 + data = json.load(f) 65 + 66 + data["version"] = js_version 67 + 68 + with path.open(mode="w") as f: 69 + json.dump(data, f, indent=2) 70 + 71 + else: 72 + raise FileNotFoundError(f"Could not find package.json under dir {path!s}") 56 73 57 74 58 75 if __name__ == "__main__":
+2 -97
setup.py
··· 1 - """ 2 - jupyterlab_blockly setup 3 - """ 4 - import json 5 - import sys 6 - from pathlib import Path 7 - 8 - import setuptools 9 - 10 - HERE = Path(__file__).parent.resolve() 11 - 12 - # The name of the project 13 - name = "jupyterlab_blockly" 14 - 15 - lab_path = (HERE / name.replace("-", "_") / "labextension") 16 - 17 - # Representative files that should exist after a successful build 18 - ensured_targets = [ 19 - str(lab_path / "package.json"), 20 - str(lab_path / "static/style.js") 21 - ] 22 - 23 - labext_name = "jupyterlab-blockly-extension" 24 - 25 - data_files_spec = [ 26 - ("share/jupyter/labextensions/%s" % labext_name, str(lab_path.relative_to(HERE)), "**"), 27 - ("share/jupyter/labextensions/%s" % labext_name, str("."), "install.json"), 28 - ] 29 - 30 - long_description = (HERE / "README.md").read_text() 31 - 32 - # Get the package info from package.json 33 - pkg_json = json.loads((HERE / "packages/blockly-extension/package.json").read_bytes()) 34 - version = ( 35 - pkg_json["version"] 36 - .replace("-alpha.", "a") 37 - .replace("-beta.", "b") 38 - .replace("-rc.", "rc") 39 - ) 40 - 41 - setup_args = dict( 42 - name=name, 43 - version=version, 44 - url=pkg_json["homepage"], 45 - author=pkg_json["author"]["name"], 46 - author_email=pkg_json["author"]["email"], 47 - description=pkg_json["description"], 48 - license=pkg_json["license"], 49 - license_file="LICENSE", 50 - long_description=long_description, 51 - long_description_content_type="text/markdown", 52 - packages=setuptools.find_packages(), 53 - install_requires=[], 54 - extras_require={ 55 - 'dev': ['click','jupyter_releaser==0.22'] 56 - }, 57 - zip_safe=False, 58 - include_package_data=True, 59 - python_requires=">=3.7", 60 - platforms="Linux, Mac OS X, Windows", 61 - keywords=["Jupyter", "JupyterLab", "JupyterLab3"], 62 - classifiers=[ 63 - "License :: OSI Approved :: BSD License", 64 - "Programming Language :: Python", 65 - "Programming Language :: Python :: 3", 66 - "Programming Language :: Python :: 3.7", 67 - "Programming Language :: Python :: 3.8", 68 - "Programming Language :: Python :: 3.9", 69 - "Programming Language :: Python :: 3.10", 70 - "Framework :: Jupyter", 71 - "Framework :: Jupyter :: JupyterLab", 72 - "Framework :: Jupyter :: JupyterLab :: 3", 73 - "Framework :: Jupyter :: JupyterLab :: Extensions", 74 - "Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt", 75 - ], 76 - ) 77 - 78 - try: 79 - from jupyter_packaging import ( 80 - wrap_installers, 81 - npm_builder, 82 - get_data_files 83 - ) 84 - post_develop = npm_builder( 85 - build_cmd="install:extension", source_dir="src", build_dir=lab_path, npm='jlpm' 86 - ) 87 - setup_args["cmdclass"] = wrap_installers(post_develop=post_develop, ensured_targets=ensured_targets) 88 - setup_args["data_files"] = get_data_files(data_files_spec) 89 - except ImportError as e: 90 - import logging 91 - logging.basicConfig(format="%(levelname)s: %(message)s") 92 - logging.warning("Build tool `jupyter-packaging` is missing. Install it with pip or conda.") 93 - if not ("--name" in sys.argv or "--version" in sys.argv): 94 - raise e 95 - 96 - if __name__ == "__main__": 97 - setuptools.setup(**setup_args) 1 + # setup.py shim for use with applications that require it. 2 + __import__('setuptools').setup()