Skip to content

Commit 9e0c501

Browse files
authored
Drop Python 3.6, update to ipywidgets 8 (#100)
* Add gitpod * Fix conda install * Add develop command * Drop Python 3.6 * Support ipywidgets 8 * Update to ipywidgets 8 * Fix ESLint * Try fixing macos on CI * Revert py_cmd changes * Update to `actions/setup-python@v4` * Try with 3.8 * Try special case macos * Switch back to 3.7 * fix if * Remove custom step * try with custom pip_cmd * try pip3 * Switch to `bash -e`
1 parent bf27132 commit 9e0c501

13 files changed

+2567
-2834
lines changed

.eslintrc.js

+12-20
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,28 @@ module.exports = {
33
'eslint:recommended',
44
'plugin:@typescript-eslint/eslint-recommended',
55
'plugin:@typescript-eslint/recommended',
6-
'plugin:jsdoc/recommended',
76
'plugin:prettier/recommended',
8-
'plugin:react/recommended',
97
],
108
parser: '@typescript-eslint/parser',
119
parserOptions: {
10+
project: 'tsconfig.json',
1211
sourceType: 'module',
13-
ecmaVersion: 2017,
1412
},
15-
plugins: ['@typescript-eslint', 'jsdoc'],
13+
plugins: ['@typescript-eslint'],
1614
rules: {
17-
'@typescript-eslint/interface-name-prefix': [
15+
'@typescript-eslint/naming-convention': [
1816
'error',
19-
{ prefixWithI: 'always' },
17+
{
18+
selector: 'interface',
19+
format: ['PascalCase'],
20+
custom: {
21+
regex: '^I[A-Z]',
22+
match: true,
23+
},
24+
},
2025
],
2126
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
2227
'@typescript-eslint/no-explicit-any': 'off',
23-
'@typescript-eslint/camelcase': 'off',
2428
'@typescript-eslint/no-namespace': 'off',
2529
'@typescript-eslint/no-use-before-define': 'off',
2630
'@typescript-eslint/quotes': [
@@ -29,19 +33,7 @@ module.exports = {
2933
{ avoidEscape: true, allowTemplateLiterals: false },
3034
],
3135
curly: ['error', 'all'],
32-
'jsdoc/require-param-type': 'off',
33-
'jsdoc/require-property-type': 'off',
34-
'jsdoc/require-returns-type': 'off',
35-
'jsdoc/require-returns': 'off',
36-
'jsdoc/no-types': 'warn',
36+
eqeqeq: 'error',
3737
'prefer-arrow-callback': 'error',
3838
},
39-
settings: {
40-
jsdoc: {
41-
mode: 'typescript',
42-
},
43-
react: {
44-
version: 'detect',
45-
},
46-
},
4739
};

.github/workflows/build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818
with:
1919
node-version: '14.x'
2020
- name: Install Python
21-
uses: actions/setup-python@v2
21+
uses: actions/setup-python@v4
2222
with:
23-
python-version: '3.9'
23+
python-version: '3.10'
2424
architecture: 'x64'
2525
- name: Install dependencies
2626
run: |

.github/workflows/check-release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ jobs:
1717
- name: Checkout
1818
uses: actions/checkout@v2
1919
- name: Install Python
20-
uses: actions/setup-python@v2
20+
uses: actions/setup-python@v4
2121
with:
22-
python-version: 3.9
22+
python-version: '3.10'
2323
architecture: 'x64'
2424
- name: Install node
2525
uses: actions/setup-node@v2

.github/workflows/lint.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ jobs:
1717
with:
1818
node-version: '14.x'
1919
- name: Install Python
20-
uses: actions/setup-python@v1
20+
uses: actions/setup-python@v4
2121
with:
22-
python-version: '3.9'
22+
python-version: '3.10'
2323
architecture: 'x64'
2424
- name: Install JupyterLab
2525
run: python -m pip install jupyterlab
@@ -34,9 +34,9 @@ jobs:
3434
- name: Checkout
3535
uses: actions/checkout@v1
3636
- name: Install Python
37-
uses: actions/setup-python@v1
37+
uses: actions/setup-python@v4
3838
with:
39-
python-version: '3.9'
39+
python-version: '3.10'
4040
architecture: 'x64'
4141
- name: Install black
4242
run: python -m pip install black

.github/workflows/packaging.yml

+14-11
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ env:
1111

1212
defaults:
1313
run:
14-
shell: bash -l {0}
14+
shell: bash -e {0}
1515

1616
jobs:
1717
build:
@@ -24,9 +24,9 @@ jobs:
2424
with:
2525
node-version: '14.x'
2626
- name: Install Python
27-
uses: actions/setup-python@v2
27+
uses: actions/setup-python@v4
2828
with:
29-
python-version: '3.9'
29+
python-version: '3.10'
3030
architecture: 'x64'
3131
- name: Install dependencies
3232
run: |
@@ -56,22 +56,25 @@ jobs:
5656
fail-fast: false
5757
matrix:
5858
os: [ubuntu, macos, windows]
59-
python: ['3.6', '3.9']
59+
python: ['3.7', '3.10']
6060
include:
61-
- python: '3.6'
61+
- python: '3.7'
6262
dist: 'ipylab*.tar.gz'
63-
- python: '3.9'
63+
- python: '3.10'
6464
dist: 'ipylab*.whl'
6565
- os: windows
6666
py_cmd: python
67+
pip_cmd: python -m pip
6768
- os: macos
6869
py_cmd: python3
70+
pip_cmd: pip3
6971
- os: ubuntu
7072
py_cmd: python
73+
pip_cmd: python -m pip
7174

7275
steps:
7376
- name: Install Python
74-
uses: actions/setup-python@v2
77+
uses: actions/setup-python@v4
7578
with:
7679
python-version: ${{ matrix.python }}
7780
architecture: 'x64'
@@ -81,15 +84,15 @@ jobs:
8184
path: ./dist
8285
- name: Install the prerequisites
8386
run: |
84-
${{ matrix.py_cmd }} -m pip install --upgrade pip wheel jupyterlab~=3.0
87+
${{ matrix.pip_cmd }} install --upgrade pip wheel jupyterlab~=3.0
8588
- name: Install the package
8689
run: |
8790
cd dist
88-
${{ matrix.py_cmd }} -m pip install -vv ${{ matrix.dist }}
91+
${{ matrix.pip_cmd }} install -vv ${{ matrix.dist }}
8992
- name: Validate environment
9093
run: |
91-
${{ matrix.py_cmd }} -m pip freeze
92-
${{ matrix.py_cmd }} -m pip check
94+
${{ matrix.pip_cmd }} freeze
95+
${{ matrix.pip_cmd }} check
9396
- name: Validate the install
9497
run: |
9598
jupyter labextension list

.gitpod.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
github:
2+
prebuilds:
3+
master: true
4+
pullRequests: true
5+
pullRequestsFromForks: true
6+
addCheck: false
7+
addComment: false
8+
addBadge: false
9+
addLabel: false
10+
tasks:
11+
- name: setup
12+
init: |
13+
pushd /workspace
14+
wget -qO- https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba
15+
popd
16+
# bootstrap activation commands for other tasks to reuse
17+
cat <<EOT > /workspace/bin/activate-env.sh
18+
export MAMBA_ROOT_PREFIX=/workspace/.micromamba
19+
export MAMBA_EXE=/workspace/bin/micromamba
20+
$(/workspace/bin/micromamba shell hook --shell=bash)
21+
micromamba config append channels conda-forge
22+
export JUPYTER_PREFER_ENV_PATH=1
23+
micromamba activate
24+
EOT
25+
source /workspace/bin/activate-env.sh
26+
micromamba install -n base -y python=3.10 nodejs=14 jupyterlab=3 yarn
27+
python -m pip install -e ".[dev,test]" && jlpm && jlpm run build && jupyter labextension develop . --overwrite
28+
gp sync-done setup
29+
command: |
30+
gp sync-done setup
31+
source /workspace/bin/activate-env.sh
32+
jupyter lab --no-browser --LabApp.token='' --LabApp.allow_origin=* --LabApp.tornado_settings='{"headers": {"Content-Security-Policy": "frame-ancestors *"}}'
33+
34+
- name: watch
35+
command: |
36+
gp sync-await setup
37+
source /workspace/bin/activate-env.sh
38+
jlpm watch
39+
40+
ports:
41+
- port: 8888

package.json

+27-27
Original file line numberDiff line numberDiff line change
@@ -70,37 +70,37 @@
7070
]
7171
},
7272
"dependencies": {
73-
"@jupyter-widgets/base": "^1 || ^2 || ^3 || ^4",
74-
"@jupyter-widgets/controls": "^3.0.0",
75-
"@jupyterlab/application": "^3.2.3",
76-
"@jupyterlab/apputils": "^3.2.3",
77-
"@jupyterlab/observables": "^4.2.3",
78-
"@lumino/algorithm": "^1.9.1",
79-
"@lumino/commands": "^1.12.0",
80-
"@lumino/disposable": "^1.10.1",
81-
"@lumino/messaging": "^1.10.1",
82-
"@lumino/widgets": "^1.30.0"
73+
"@jupyter-widgets/base": "^1 || ^2 || ^3 || ^4 || ^5 || ^6",
74+
"@jupyter-widgets/controls": "^3 || ^4 || ^5",
75+
"@jupyterlab/application": "^3.4.5",
76+
"@jupyterlab/apputils": "^3.4.5",
77+
"@jupyterlab/observables": "^4.4.5",
78+
"@lumino/algorithm": "^1.9.2",
79+
"@lumino/commands": "^1.20.1",
80+
"@lumino/disposable": "^1.10.2",
81+
"@lumino/messaging": "^1.10.2",
82+
"@lumino/widgets": "^1.34.0"
8383
},
8484
"devDependencies": {
85-
"@jupyterlab/builder": "^3.2.3",
85+
"@jupyterlab/builder": "^3.4.5",
8686
"@types/expect.js": "^0.3.29",
87-
"@types/node": "^10.11.6",
88-
"@typescript-eslint/eslint-plugin": "^2.26.0",
89-
"@typescript-eslint/parser": "^2.26.0",
90-
"eslint": "^6.8.0",
91-
"eslint-config-prettier": "^6.10.1",
92-
"eslint-plugin-jsdoc": "^22.1.0",
93-
"eslint-plugin-prettier": "^3.1.2",
94-
"eslint-plugin-react": "^7.18.3",
87+
"@types/node": "^18.7.8",
88+
"@typescript-eslint/eslint-plugin": "^5.33.1",
89+
"@typescript-eslint/parser": "^5.33.1",
90+
"eslint": "^8.22.0",
91+
"eslint-config-prettier": "^8.5.0",
92+
"eslint-plugin-jsdoc": "^39.3.6",
93+
"eslint-plugin-prettier": "^4.2.1",
94+
"eslint-plugin-react": "^7.30.1",
9595
"expect.js": "^0.3.1",
96-
"fs-extra": "^7.0.0",
97-
"husky": "^3.1.0",
98-
"lint-staged": "^9.4.3",
99-
"mkdirp": "^0.5.1",
100-
"npm-run-all": "^4.1.3",
101-
"prettier": "^2.0.2",
102-
"rimraf": "^2.6.2",
103-
"typescript": "~4.4.4"
96+
"fs-extra": "^10.1.0",
97+
"husky": "^8.0.1",
98+
"lint-staged": "^13.0.3",
99+
"mkdirp": "^1.0.4",
100+
"npm-run-all": "^4.1.5",
101+
"prettier": "^2.7.1",
102+
"rimraf": "^3.0.2",
103+
"typescript": "~4.7.4"
104104
},
105105
"jupyterlab": {
106106
"extension": "lib/plugin",

setup.cfg

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ classifiers =
1414
License :: OSI Approved :: BSD License
1515
Programming Language :: Python
1616
Programming Language :: Python :: 3
17-
Programming Language :: Python :: 3.6
1817
Programming Language :: Python :: 3.7
1918
Programming Language :: Python :: 3.8
2019
Programming Language :: Python :: 3.9
20+
Programming Language :: Python :: 3.10
2121
Framework :: Jupyter
2222
Framework :: Jupyter :: JupyterLab
2323
Framework :: Jupyter :: JupyterLab :: 3
@@ -28,9 +28,9 @@ classifiers =
2828
zip_safe = False
2929
include_package_data = True
3030
packages = find:
31-
python_requires = >=3.6
31+
python_requires = >=3.7
3232
install_requires =
33-
ipywidgets>=7.6.0,<8
33+
ipywidgets>=7.6.0,<9
3434

3535
[options.extras_require]
3636
test =

src/widgets/commands.ts

+3
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ export class CommandRegistryModel extends WidgetModel {
9696
* Execute a command
9797
*
9898
* @param bundle The command bundle.
99+
* @param bundle.id
100+
* @param bundle.args
99101
*/
100102
private _execute(bundle: {
101103
id: string;
@@ -143,6 +145,7 @@ export class CommandRegistryModel extends WidgetModel {
143145
* Remove a command from the command registry.
144146
*
145147
* @param bundle The command bundle.
148+
* @param bundle.id
146149
*/
147150
private _removeCommand(bundle: { id: string }): void {
148151
const { id } = bundle;

src/widgets/sessions.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ export class SessionManagerModel extends WidgetModel {
7979
*
8080
* @param widget widget tracked by app.shell._track (FocusTracker)
8181
*/
82-
private _getSessionContext(widget: any): Session.IModel | {} {
82+
private _getSessionContext(
83+
widget: any
84+
): Session.IModel | Record<string, unknown> {
8385
return widget?.sessionContext?.session?.model ?? {};
8486
}
8587

@@ -129,7 +131,7 @@ export class SessionManagerModel extends WidgetModel {
129131
static view_module: string = null;
130132
static view_module_version = MODULE_VERSION;
131133

132-
private _current_session: Session.IModel | {};
134+
private _current_session: Session.IModel | Record<string, unknown>;
133135
private _sessions: SessionManager;
134136
static sessions: SessionManager;
135137
private _shell: JupyterFrontEnd.IShell;

0 commit comments

Comments
 (0)