Skip to content

Commit bbebe6f

Browse files
committed
initial commit
0 parents  commit bbebe6f

21 files changed

+807
-0
lines changed

.github/workflows/binder-on-pr.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Binder Badge
2+
on:
3+
pull_request_target:
4+
types: [opened]
5+
6+
jobs:
7+
binder:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
pull-requests: write
11+
steps:
12+
- uses: jupyterlab/maintainer-tools/.github/actions/binder-link@v1
13+
with:
14+
15+
github_token: ${{ secrets.github_token }}
16+

.github/workflows/build.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: main
6+
pull_request:
7+
branches: '*'
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
17+
- name: Base Setup
18+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
19+
20+
- name: Install dependencies
21+
run: python -m pip install -U jupyterlab~=3.1
22+
23+
- name: Lint the extension
24+
run: |
25+
set -eux
26+
jlpm
27+
jlpm run lint:check
28+
29+
- name: Build the extension
30+
run: |
31+
set -eux
32+
python -m pip install .[test]
33+
34+
jupyter labextension list
35+
jupyter labextension list 2>&1 | grep -ie "jupyterlab-blockly-ipylgbst.*OK"
36+
python -m jupyterlab.browser_check
37+
38+
- name: Package the extension
39+
run: |
40+
set -eux
41+
42+
pip install build
43+
python -m build
44+
pip uninstall -y "jupyterlab_blockly_ipylgbst" jupyterlab
45+
46+
- name: Upload extension packages
47+
uses: actions/upload-artifact@v3
48+
with:
49+
name: extension-artifacts
50+
path: dist/jupyterlab_blockly_ipylgbst*
51+
if-no-files-found: error
52+
53+
test_isolated:
54+
needs: build
55+
runs-on: ubuntu-latest
56+
57+
steps:
58+
- name: Checkout
59+
uses: actions/checkout@v3
60+
- name: Install Python
61+
uses: actions/setup-python@v4
62+
with:
63+
python-version: '3.9'
64+
architecture: 'x64'
65+
- uses: actions/download-artifact@v3
66+
with:
67+
name: extension-artifacts
68+
- name: Install and Test
69+
run: |
70+
set -eux
71+
# Remove NodeJS, twice to take care of system and locally installed node versions.
72+
sudo rm -rf $(which node)
73+
sudo rm -rf $(which node)
74+
75+
pip install "jupyterlab~=3.1" jupyterlab_blockly_ipylgbst*.whl
76+
77+
78+
jupyter labextension list
79+
jupyter labextension list 2>&1 | grep -ie "jupyterlab-blockly-ipylgbst.*OK"
80+
python -m jupyterlab.browser_check --no-chrome-test
81+
82+
83+
check_links:
84+
name: Check Links
85+
runs-on: ubuntu-latest
86+
timeout-minutes: 15
87+
steps:
88+
- uses: actions/checkout@v3
89+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
90+
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1

.github/workflows/check-release.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Check Release
2+
on:
3+
push:
4+
branches: ["main"]
5+
pull_request:
6+
branches: ["*"]
7+
8+
jobs:
9+
check_release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
- name: Base Setup
15+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
16+
- name: Install Dependencies
17+
run: |
18+
pip install -e .
19+
- name: Check Release
20+
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
21+
with:
22+
23+
token: ${{ secrets.GITHUB_TOKEN }}
24+
25+
- name: Upload Distributions
26+
uses: actions/upload-artifact@v3
27+
with:
28+
name: jupyterlab_blockly_ipylgbst-releaser-dist-${{ github.run_number }}
29+
path: .jupyter_releaser_checkout/dist

.gitignore

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
*.bundle.*
2+
lib/
3+
node_modules/
4+
*.log
5+
.eslintcache
6+
.stylelintcache
7+
*.egg-info/
8+
.ipynb_checkpoints
9+
*.tsbuildinfo
10+
jupyterlab_blockly_ipylgbst/labextension
11+
# Version file is handled by hatchling
12+
jupyterlab_blockly_ipylgbst/_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

.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
**/node_modules
3+
**/lib
4+
**/package.json
5+
!/package.json
6+
jupyterlab_blockly_ipylgbst

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changelog
2+
3+
<!-- <START NEW CHANGELOG ENTRY> -->
4+
5+
<!-- <END NEW CHANGELOG ENTRY> -->

LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2023, Denisa Checiu
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.

README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# jupyterlab-blockly-ipylgbst
2+
3+
[![Github Actions Status](https://github.com/QuantStack/jupyterlab-blockly-ipylgbst/workflows/Build/badge.svg)](https://github.com/QuantStack/jupyterlab-blockly-ipylgbst/actions/workflows/build.yml)[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/QuantStack/jupyterlab-blockly-ipylgbst/main?urlpath=lab)
4+
Blockly extension for JupyterLab to control the Lego Boost, using the ipylgbst library.
5+
6+
## Requirements
7+
8+
- JupyterLab >= 3.0
9+
10+
## Install
11+
12+
To install the extension, execute:
13+
14+
```bash
15+
pip install jupyterlab-blockly-ipylgbst
16+
```
17+
18+
## Uninstall
19+
20+
To remove the extension, execute:
21+
22+
```bash
23+
pip uninstall jupyterlab-blockly-ipylgbst
24+
```
25+
26+
## Contributing
27+
28+
### Development install
29+
30+
Note: You will need NodeJS to build the extension package.
31+
32+
The `jlpm` command is JupyterLab's pinned version of
33+
[yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use
34+
`yarn` or `npm` in lieu of `jlpm` below.
35+
36+
```bash
37+
# Clone the repo to your local environment
38+
# Change directory to the jupyterlab-blockly-ipylgbst directory
39+
# Install package in development mode
40+
pip install -e "."
41+
# Link your development version of the extension with JupyterLab
42+
jupyter labextension develop . --overwrite
43+
# Rebuild extension Typescript source after making changes
44+
jlpm build
45+
```
46+
47+
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.
48+
49+
```bash
50+
# Watch the source directory in one terminal, automatically rebuilding when needed
51+
jlpm watch
52+
# Run JupyterLab in another terminal
53+
jupyter lab
54+
```
55+
56+
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).
57+
58+
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:
59+
60+
```bash
61+
jupyter lab build --minimize=False
62+
```
63+
64+
### Development uninstall
65+
66+
```bash
67+
pip uninstall jupyterlab-blockly-ipylgbst
68+
```
69+
70+
In development mode, you will also need to remove the symlink created by `jupyter labextension develop`
71+
command. To find its location, you can run `jupyter labextension list` to figure out where the `labextensions`
72+
folder is located. Then you can remove the symlink named `jupyterlab-blockly-ipylgbst` within that folder.
73+
74+
### Packaging the extension
75+
76+
See [RELEASE](RELEASE.md)

0 commit comments

Comments
 (0)