Skip to content

Commit f273523

Browse files
authored
Jlab3 (#162)
* Upgrader script * bump types * Remove redundant isDisposed logic which is handled in the superclass. * Revamp linting to use eslint rather than the deprecated tslint * Update gitignore. * Remove defunct setup module. * Bump versions to released ones. * Include install.json * Update manifest. * Update CI to use github actions. Update github workflows to run the full tests. * Remove old test infra. * Use conf.d for both classic notebook package and jupyter_server * Update notebook dependency to jupyter_server dependency
1 parent 825aab7 commit f273523

30 files changed

+3621
-2832
lines changed

.eslintignore

+5
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

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es6: true,
5+
commonjs: true,
6+
node: true
7+
},
8+
root: true,
9+
extends: [
10+
'eslint:recommended',
11+
'plugin:@typescript-eslint/eslint-recommended',
12+
'plugin:@typescript-eslint/recommended',
13+
'prettier/@typescript-eslint',
14+
'plugin:react/recommended'
15+
],
16+
parser: '@typescript-eslint/parser',
17+
parserOptions: {
18+
project: 'tsconfig.eslint.json'
19+
},
20+
plugins: ['@typescript-eslint'],
21+
rules: {
22+
'@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }],
23+
'@typescript-eslint/naming-convention': [
24+
'error',
25+
{
26+
selector: 'interface',
27+
format: ['PascalCase'],
28+
custom: {
29+
regex: '^I[A-Z]',
30+
match: true
31+
}
32+
}
33+
],
34+
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
35+
'@typescript-eslint/no-use-before-define': 'off',
36+
'@typescript-eslint/camelcase': 'off',
37+
'@typescript-eslint/no-explicit-any': 'off',
38+
'@typescript-eslint/no-non-null-assertion': 'off',
39+
'@typescript-eslint/no-namespace': 'off',
40+
'@typescript-eslint/interface-name-prefix': 'off',
41+
'@typescript-eslint/explicit-function-return-type': 'off',
42+
'@typescript-eslint/ban-ts-comment': ['warn', { 'ts-ignore': true }],
43+
'@typescript-eslint/ban-types': 'warn',
44+
'@typescript-eslint/no-non-null-asserted-optional-chain': 'warn',
45+
'@typescript-eslint/no-var-requires': 'off',
46+
'@typescript-eslint/no-empty-interface': 'off',
47+
'@typescript-eslint/triple-slash-reference': 'warn',
48+
'@typescript-eslint/no-inferrable-types': 'off',
49+
'no-inner-declarations': 'off',
50+
'no-prototype-builtins': 'off',
51+
'no-control-regex': 'warn',
52+
'no-undef': 'warn',
53+
'no-case-declarations': 'warn',
54+
'no-useless-escape': 'off',
55+
'prefer-const': 'off',
56+
'react/prop-types': 'warn'
57+
},
58+
settings: {
59+
react: {
60+
version: 'detect'
61+
}
62+
}
63+
};

.github/workflows/labextension.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: labextension
2+
3+
on:
4+
push:
5+
branches: master
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: '10.x'
19+
- name: Install Python
20+
uses: actions/setup-python@v2
21+
with:
22+
python-version: '3.7'
23+
architecture: 'x64'
24+
- name: Install dependencies
25+
run: python -m pip install jupyterlab
26+
- name: Build the extension
27+
run: |
28+
jlpm
29+
jlpm run eslint:check
30+
python -m pip install .
31+
jupyter serverextension list
32+
jupyter labextension list
33+
34+
jupyter serverextension list 2>&1 | grep -ie "dask_labextension.*OK"
35+
36+
jupyter labextension list 2>&1 | grep -ie "dask-labextension.*OK"
37+
python -m jupyterlab.browser_check

.github/workflows/python.yaml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: python
2+
3+
on:
4+
push:
5+
branches: master
6+
pull_request:
7+
branches: '*'
8+
9+
jobs:
10+
test:
11+
name: Python ${{ matrix.python-version }}
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
python-version: ["3.7", "3.8"]
17+
18+
steps:
19+
- name: Checkout source
20+
uses: actions/checkout@v2
21+
22+
- name: Setup Conda Environment
23+
uses: conda-incubator/setup-miniconda@v2
24+
with:
25+
auto-update-conda: true
26+
miniconda-version: latest
27+
activate-environment: test
28+
python-version: ${{ matrix.python-version }}
29+
30+
- name: Install
31+
shell: bash -l {0}
32+
run: |
33+
python -m pip install pytest black flake8
34+
python -m pip install .
35+
36+
- name: Lint
37+
continue-on-error: true
38+
shell: bash -l {0}
39+
run: |
40+
flake8 dask_labextension
41+
black dask_labextension --check
42+
43+
- name: Run Tests
44+
shell: bash -l {0}
45+
run: python -m pytest dask_labextension
46+

.gitignore

+6-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ __pycache__
2020
npm-debug.log
2121

2222
dask_labextension.egg-info
23+
dask_labextension/labextension
2324
dask_labextension/static
2425
lib
25-
node_modules
26+
node_modules
27+
tsconfig.tsbuildinfo
28+
29+
_temp_extension
30+
dask-worker-space

.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
node_modules
2+
dask_labextension/labextension
3+
**/node_modules
24
**/lib
5+
**/package.json

.prettierrc

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
{
2-
"singleQuote": true
2+
"singleQuote": true,
3+
"trailingComma": "none",
4+
"arrowParens": "avoid"
35
}

.travis.yml

-56
This file was deleted.

MANIFEST.in

+21-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,30 @@
11
recursive-include dask_labextension *.py
22
recursive-include dask_labextension *.yaml
33

4-
include setupbase.py
54
include setup.py
65
include setup.cfg
76
include README.md
87
include LICENSE
98
include MANIFEST.in
109
include versioneer.py
10+
include pyproject.toml
11+
include jupyter-config/dask_labextension.json
12+
13+
include package.json
14+
include install.json
15+
include ts*.json
16+
17+
graft dask_labextension/labextension
18+
19+
# Javascript files
20+
graft src
21+
graft style
22+
prune **/node_modules
23+
prune lib
24+
25+
# Patterns to exclude from any directory
26+
global-exclude *~
27+
global-exclude *.pyc
28+
global-exclude *.pyo
29+
global-exclude .git
30+
global-exclude .ipynb_checkpoints

ci/base_install.sh

-11
This file was deleted.

ci/javascript/install.sh

-9
This file was deleted.

ci/javascript/test.sh

-8
This file was deleted.

ci/python/install.sh

-11
This file was deleted.

ci/python/test.sh

-6
This file was deleted.

dask_labextension/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
"""A Jupyter notebook server extension for managing Dask clusters."""
1+
"""A Jupyter server extension for managing Dask clusters."""
22

3-
from notebook.utils import url_path_join
3+
from jupyter_server.utils import url_path_join
44

55
from . import config
66
from .clusterhandler import DaskClusterHandler

dask_labextension/clusterhandler.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import json
77

88
from tornado import web
9-
from notebook.base.handlers import APIHandler
9+
from jupyter_server.base.handlers import APIHandler
1010

1111
from .manager import manager
1212

dask_labextension/dashboardhandler.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
from tornado import httpclient, web
1010

11-
from notebook.base.handlers import APIHandler
12-
from notebook.utils import url_path_join
11+
from jupyter_server.base.handlers import APIHandler
12+
from jupyter_server.utils import url_path_join
1313
from jupyter_server_proxy.handlers import ProxyHandler
1414

1515
from .manager import manager

install.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"packageManager": "python",
3+
"packageName": "dask_labextension",
4+
"uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package dask_labextension"
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"ServerApp": {
3+
"jpserver_extensions": {
4+
"dask_labextension": true
5+
}
6+
}
7+
}

0 commit comments

Comments
 (0)