Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jlab3 #162

Merged
merged 13 commits into from
Jan 12, 2021
Merged

Jlab3 #162

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
dist
coverage
**/*.d.ts
tests
63 changes: 63 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
module.exports = {
env: {
browser: true,
es6: true,
commonjs: true,
node: true
},
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint',
'plugin:react/recommended'
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.eslint.json'
},
plugins: ['@typescript-eslint'],
rules: {
'@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }],
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'interface',
format: ['PascalCase'],
custom: {
regex: '^I[A-Z]',
match: true
}
}
],
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/camelcase': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/ban-ts-comment': ['warn', { 'ts-ignore': true }],
'@typescript-eslint/ban-types': 'warn',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'warn',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/triple-slash-reference': 'warn',
'@typescript-eslint/no-inferrable-types': 'off',
'no-inner-declarations': 'off',
'no-prototype-builtins': 'off',
'no-control-regex': 'warn',
'no-undef': 'warn',
'no-case-declarations': 'warn',
'no-useless-escape': 'off',
'prefer-const': 'off',
'react/prop-types': 'warn'
},
settings: {
react: {
version: 'detect'
}
}
};
37 changes: 37 additions & 0 deletions .github/workflows/labextension.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: labextension

on:
push:
branches: master
pull_request:
branches: '*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v1
with:
node-version: '10.x'
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.7'
architecture: 'x64'
- name: Install dependencies
run: python -m pip install jupyterlab
- name: Build the extension
run: |
jlpm
jlpm run eslint:check
python -m pip install .
jupyter serverextension list
jupyter labextension list

jupyter serverextension list 2>&1 | grep -ie "dask_labextension.*OK"

jupyter labextension list 2>&1 | grep -ie "dask-labextension.*OK"
python -m jupyterlab.browser_check
46 changes: 46 additions & 0 deletions .github/workflows/python.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: python

on:
push:
branches: master
pull_request:
branches: '*'

jobs:
test:
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8"]

steps:
- name: Checkout source
uses: actions/checkout@v2

- name: Setup Conda Environment
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
miniconda-version: latest
activate-environment: test
python-version: ${{ matrix.python-version }}

- name: Install
shell: bash -l {0}
run: |
python -m pip install pytest black flake8
python -m pip install .

- name: Lint
continue-on-error: true
shell: bash -l {0}
run: |
flake8 dask_labextension
black dask_labextension --check

- name: Run Tests
shell: bash -l {0}
run: python -m pytest dask_labextension

7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ __pycache__
npm-debug.log

dask_labextension.egg-info
dask_labextension/labextension
dask_labextension/static
lib
node_modules
node_modules
tsconfig.tsbuildinfo

_temp_extension
dask-worker-space
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
node_modules
dask_labextension/labextension
**/node_modules
**/lib
**/package.json
4 changes: 3 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"singleQuote": true
"singleQuote": true,
"trailingComma": "none",
"arrowParens": "avoid"
}
56 changes: 0 additions & 56 deletions .travis.yml

This file was deleted.

22 changes: 21 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
recursive-include dask_labextension *.py
recursive-include dask_labextension *.yaml

include setupbase.py
include setup.py
include setup.cfg
include README.md
include LICENSE
include MANIFEST.in
include versioneer.py
include pyproject.toml
include jupyter-config/dask_labextension.json

include package.json
include install.json
include ts*.json

graft dask_labextension/labextension

# Javascript files
graft src
graft style
prune **/node_modules
prune lib

# Patterns to exclude from any directory
global-exclude *~
global-exclude *.pyc
global-exclude *.pyo
global-exclude .git
global-exclude .ipynb_checkpoints
11 changes: 0 additions & 11 deletions ci/base_install.sh

This file was deleted.

9 changes: 0 additions & 9 deletions ci/javascript/install.sh

This file was deleted.

8 changes: 0 additions & 8 deletions ci/javascript/test.sh

This file was deleted.

11 changes: 0 additions & 11 deletions ci/python/install.sh

This file was deleted.

6 changes: 0 additions & 6 deletions ci/python/test.sh

This file was deleted.

4 changes: 2 additions & 2 deletions dask_labextension/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""A Jupyter notebook server extension for managing Dask clusters."""
"""A Jupyter server extension for managing Dask clusters."""

from notebook.utils import url_path_join
from jupyter_server.utils import url_path_join

from . import config
from .clusterhandler import DaskClusterHandler
Expand Down
2 changes: 1 addition & 1 deletion dask_labextension/clusterhandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import json

from tornado import web
from notebook.base.handlers import APIHandler
from jupyter_server.base.handlers import APIHandler

from .manager import manager

Expand Down
4 changes: 2 additions & 2 deletions dask_labextension/dashboardhandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

from tornado import httpclient, web

from notebook.base.handlers import APIHandler
from notebook.utils import url_path_join
from jupyter_server.base.handlers import APIHandler
from jupyter_server.utils import url_path_join
from jupyter_server_proxy.handlers import ProxyHandler

from .manager import manager
Expand Down
5 changes: 5 additions & 0 deletions install.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"packageManager": "python",
"packageName": "dask_labextension",
"uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package dask_labextension"
}
7 changes: 7 additions & 0 deletions jupyter-config/jupyter_server_config.d/dask_labextension.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"ServerApp": {
"jpserver_extensions": {
"dask_labextension": true
}
}
}
Loading