Skip to content
This repository was archived by the owner on Feb 14, 2024. It is now read-only.

Commit d28dbc1

Browse files
committed
inital version
0 parents  commit d28dbc1

31 files changed

+16997
-0
lines changed

.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

.eslintrc.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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/no-empty-interface': 'off',
31+
'@typescript-eslint/quotes': [
32+
'error',
33+
'single',
34+
{ avoidEscape: true, allowTemplateLiterals: false }
35+
],
36+
curly: ['error', 'all'],
37+
eqeqeq: 'error',
38+
'prefer-arrow-callback': 'error'
39+
}
40+
};

.github/workflows/build.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
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+
- name: Setup pip cache
26+
uses: actions/cache@v2
27+
with:
28+
path: ~/.cache/pip
29+
key: pip-3.8-${{ hashFiles('package.json') }}
30+
restore-keys: |
31+
pip-3.8-
32+
pip-
33+
34+
- name: Get yarn cache directory path
35+
id: yarn-cache-dir-path
36+
run: echo "::set-output name=dir::$(yarn cache dir)"
37+
- name: Setup yarn cache
38+
uses: actions/cache@v2
39+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
40+
with:
41+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
42+
key: yarn-${{ hashFiles('**/yarn.lock') }}
43+
restore-keys: |
44+
yarn-
45+
46+
- name: Install dependencies
47+
run: python -m pip install -U jupyterlab~=3.1 check-manifest
48+
- name: Build the extension
49+
run: |
50+
set -eux
51+
jlpm
52+
# build separately for now
53+
jlpm run build:wasm
54+
jlpm run build
55+
jlpm run eslint:check
56+
python -m pip install .
57+
58+
jupyter labextension list 2>&1 | grep -ie "@jupyterlite/xeus-python-kernel.*OK"
59+
60+
# TODO: add JupyterLite browser check
61+
# python -m jupyterlab.browser_check
62+
63+
check-manifest -v
64+
65+
pip install build
66+
python -m build --sdist
67+
cp dist/*.tar.gz myextension.tar.gz
68+
pip uninstall -y myextension jupyterlab
69+
rm -rf myextension
70+
71+
- uses: actions/upload-artifact@v2
72+
with:
73+
name: myextension-sdist
74+
path: myextension.tar.gz
75+
76+
test_isolated:
77+
needs: build
78+
runs-on: ubuntu-latest
79+
80+
steps:
81+
- name: Checkout
82+
uses: actions/checkout@v2
83+
- name: Install Python
84+
uses: actions/setup-python@v2
85+
with:
86+
python-version: '3.8'
87+
architecture: 'x64'
88+
- uses: actions/download-artifact@v2
89+
with:
90+
name: myextension-sdist
91+
- name: Install and Test
92+
run: |
93+
set -eux
94+
# Remove NodeJS, twice to take care of system and locally installed node versions.
95+
sudo rm -rf $(which node)
96+
sudo rm -rf $(which node)
97+
pip install myextension.tar.gz
98+
pip install jupyterlab
99+
jupyter labextension list 2>&1 | grep -ie "@jupyterlite/xeus-python-kernel.*OK"
100+
101+
# TODO: add JupyterLite browser check
102+
# python -m jupyterlab.browser_check --no-chrome-test

.github/workflows/check-release.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Check Release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
check_release:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- 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+
- name: Get pip cache dir
29+
id: pip-cache
30+
run: |
31+
echo "::set-output name=dir::$(pip cache dir)"
32+
- name: Cache pip
33+
uses: actions/cache@v1
34+
with:
35+
path: ${{ steps.pip-cache.outputs.dir }}
36+
key: ${{ runner.os }}-pip-${{ hashFiles('package.json') }}
37+
restore-keys: |
38+
${{ runner.os }}-pip-
39+
- name: Cache checked links
40+
uses: actions/cache@v2
41+
with:
42+
path: ~/.cache/pytest-link-check
43+
key: ${{ runner.os }}-linkcheck-${{ hashFiles('**/.md') }}-md-links
44+
restore-keys: |
45+
${{ runner.os }}-linkcheck-
46+
- name: Upgrade packaging dependencies
47+
run: |
48+
pip install --upgrade pip setuptools wheel jupyter-packaging~=0.10 --user
49+
- name: Install Dependencies
50+
run: |
51+
pip install .
52+
- name: Check Release
53+
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v1
54+
with:
55+
token: ${{ secrets.GITHUB_TOKEN }}
56+
- name: Upload Distributions
57+
uses: actions/upload-artifact@v2
58+
with:
59+
name: jupyterlite-xeus-python-releaser-dist-${{ github.run_number }}
60+
path: .jupyter_releaser_checkout/dist

.gitignore

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
*.bundle.*
2+
lib/
3+
node_modules/
4+
*.egg-info/
5+
.ipynb_checkpoints
6+
*.tsbuildinfo
7+
jupyterlite_xeus_python/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+
101+
# mypy
102+
.mypy_cache/
103+
.dmypy.json
104+
dmypy.json
105+
106+
# Pyre type checker
107+
.pyre/
108+
109+
# End of https://www.gitignore.io/api/python
110+
111+
# OSX files
112+
.DS_Store
113+
114+
_output
115+
*.doit.db
116+
117+
xeus_python.js
118+
xeus_python.wasm
119+
xeus_python.worker.js

.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+
jupyterlite_xeus_python
6+
/_output

.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+
}

0 commit comments

Comments
 (0)