Skip to content

Commit 5c8d7ae

Browse files
committed
Added clear-cell-output button
1 parent ece34ad commit 5c8d7ae

File tree

21 files changed

+5428
-0
lines changed

21 files changed

+5428
-0
lines changed

clear_cell_outputs/.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
dist
3+
coverage
4+
**/*.d.ts
5+
tests

clear_cell_outputs/.eslintrc.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
module.exports = {
2+
extends: [
3+
'eslint:recommended',
4+
'plugin:@typescript-eslint/eslint-recommended',
5+
'plugin:@typescript-eslint/recommended',
6+
'plugin:prettier/recommended'
7+
],
8+
parser: '@typescript-eslint/parser',
9+
parserOptions: {
10+
project: 'tsconfig.json',
11+
sourceType: 'module'
12+
},
13+
plugins: ['@typescript-eslint'],
14+
rules: {
15+
'@typescript-eslint/naming-convention': [
16+
'error',
17+
{
18+
'selector': 'interface',
19+
'format': ['PascalCase'],
20+
'custom': {
21+
'regex': '^I[A-Z]',
22+
'match': true
23+
}
24+
}
25+
],
26+
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
27+
'@typescript-eslint/no-explicit-any': 'off',
28+
'@typescript-eslint/no-namespace': 'off',
29+
'@typescript-eslint/no-use-before-define': 'off',
30+
'@typescript-eslint/quotes': [
31+
'error',
32+
'single',
33+
{ avoidEscape: true, allowTemplateLiterals: false }
34+
],
35+
curly: ['error', 'all'],
36+
eqeqeq: 'error',
37+
'prefer-arrow-callback': 'error'
38+
}
39+
};
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
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+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
- name: Install node
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: '14.x'
19+
- name: Install Python
20+
uses: actions/setup-python@v2
21+
with:
22+
python-version: '3.8'
23+
architecture: 'x64'
24+
25+
26+
- name: Setup pip cache
27+
uses: actions/cache@v2
28+
with:
29+
path: ~/.cache/pip
30+
key: pip-3.8-${{ hashFiles('package.json') }}
31+
restore-keys: |
32+
pip-3.8-
33+
pip-
34+
35+
- name: Get yarn cache directory path
36+
id: yarn-cache-dir-path
37+
run: echo "::set-output name=dir::$(yarn cache dir)"
38+
- name: Setup yarn cache
39+
uses: actions/cache@v2
40+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
41+
with:
42+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
43+
key: yarn-${{ hashFiles('**/yarn.lock') }}
44+
restore-keys: |
45+
yarn-
46+
47+
- name: Install dependencies
48+
run: python -m pip install -U jupyterlab~=3.0 check-manifest
49+
- name: Build the extension
50+
run: |
51+
set -eux
52+
jlpm
53+
jlpm run eslint:check
54+
python -m pip install .
55+
56+
jupyter labextension list 2>&1 | grep -ie "clear-cell-outputs.*OK"
57+
python -m jupyterlab.browser_check
58+
59+
check-manifest -v
60+
61+
pip install build
62+
python -m build --sdist
63+
cp dist/*.tar.gz myextension.tar.gz
64+
pip uninstall -y myextension jupyterlab
65+
rm -rf myextension
66+
67+
- uses: actions/upload-artifact@v2
68+
with:
69+
name: myextension-sdist
70+
path: myextension.tar.gz
71+
72+
test_isolated:
73+
needs: build
74+
runs-on: ubuntu-latest
75+
76+
steps:
77+
- name: Checkout
78+
uses: actions/checkout@v2
79+
- name: Install Python
80+
uses: actions/setup-python@v2
81+
with:
82+
python-version: '3.8'
83+
architecture: 'x64'
84+
- uses: actions/download-artifact@v2
85+
with:
86+
name: myextension-sdist
87+
- name: Install and Test
88+
run: |
89+
set -eux
90+
# Remove NodeJS, twice to take care of system and locally installed node versions.
91+
sudo rm -rf $(which node)
92+
sudo rm -rf $(which node)
93+
pip install myextension.tar.gz
94+
pip install jupyterlab
95+
jupyter labextension list 2>&1 | grep -ie "clear-cell-outputs.*OK"
96+
python -m jupyterlab.browser_check --no-chrome-test

clear_cell_outputs/.gitignore

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
*.bundle.*
2+
lib/
3+
node_modules/
4+
*.egg-info/
5+
.ipynb_checkpoints
6+
*.tsbuildinfo
7+
clear_cell_outputs/labextension
8+
9+
# Created by https://www.gitignore.io/api/python
10+
# Edit at https://www.gitignore.io/?templates=python
11+
12+
### Python ###
13+
# Byte-compiled / optimized / DLL files
14+
__pycache__/
15+
*.py[cod]
16+
*$py.class
17+
18+
# C extensions
19+
*.so
20+
21+
# Distribution / packaging
22+
.Python
23+
build/
24+
develop-eggs/
25+
dist/
26+
downloads/
27+
eggs/
28+
.eggs/
29+
lib/
30+
lib64/
31+
parts/
32+
sdist/
33+
var/
34+
wheels/
35+
pip-wheel-metadata/
36+
share/python-wheels/
37+
.installed.cfg
38+
*.egg
39+
MANIFEST
40+
41+
# PyInstaller
42+
# Usually these files are written by a python script from a template
43+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
44+
*.manifest
45+
*.spec
46+
47+
# Installer logs
48+
pip-log.txt
49+
pip-delete-this-directory.txt
50+
51+
# Unit test / coverage reports
52+
htmlcov/
53+
.tox/
54+
.nox/
55+
.coverage
56+
.coverage.*
57+
.cache
58+
nosetests.xml
59+
coverage.xml
60+
*.cover
61+
.hypothesis/
62+
.pytest_cache/
63+
64+
# Translations
65+
*.mo
66+
*.pot
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
target/
76+
77+
# pyenv
78+
.python-version
79+
80+
# celery beat schedule file
81+
celerybeat-schedule
82+
83+
# SageMath parsed files
84+
*.sage.py
85+
86+
# Spyder project settings
87+
.spyderproject
88+
.spyproject
89+
90+
# Rope project settings
91+
.ropeproject
92+
93+
# Mr Developer
94+
.mr.developer.cfg
95+
.project
96+
.pydevproject
97+
98+
# mkdocs documentation
99+
/site
100+
../venv/
101+
102+
# mypy
103+
.mypy_cache/
104+
.dmypy.json
105+
dmypy.json
106+
107+
# Pyre type checker
108+
.pyre/
109+
110+
# End of https://www.gitignore.io/api/python
111+
112+
# OSX files
113+
.DS_Store

clear_cell_outputs/.prettierignore

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

clear_cell_outputs/.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "none",
4+
"arrowParens": "avoid"
5+
}

clear_cell_outputs/LICENSE

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2020, Yash Singhal All rights reserved.
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions are met:
7+
8+
* Redistributions of source code must retain the above copyright notice, this
9+
list of conditions and the following disclaimer.
10+
11+
* Redistributions in binary form must reproduce the above copyright notice,
12+
this list of conditions and the following disclaimer in the documentation
13+
and/or other materials provided with the distribution.
14+
15+
* Neither the name of the copyright holder nor the names of its
16+
contributors may be used to endorse or promote products derived from
17+
this software without specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

clear_cell_outputs/MANIFEST.in

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
include LICENSE
2+
include README.md
3+
include pyproject.toml
4+
recursive-include jupyter-config *.json
5+
6+
include package.json
7+
include install.json
8+
include ts*.json
9+
include yarn.lock
10+
11+
graft clear_cell_outputs/labextension
12+
13+
# Javascript files
14+
graft src
15+
graft style
16+
prune **/node_modules
17+
prune lib
18+
prune binder
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

0 commit comments

Comments
 (0)