Skip to content

Commit

Permalink
Full overhaul and migration from Jupyterlab v3 to v4 (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
AjayThorve authored Dec 12, 2023
1 parent f4d6a23 commit 47a5331
Show file tree
Hide file tree
Showing 74 changed files with 9,227 additions and 7,922 deletions.
11 changes: 9 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,16 @@ module.exports = {
},
plugins: ['@typescript-eslint'],
rules: {
'@typescript-eslint/interface-name-prefix': [
'@typescript-eslint/naming-convention': [
'error',
{ prefixWithI: 'always' }
{
selector: 'interface',
format: ['PascalCase'],
custom: {
regex: '^I[A-Z]',
match: true
}
}
],
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
'@typescript-eslint/no-explicit-any': 'off',
Expand Down
10 changes: 10 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (c) 2023, NVIDIA CORPORATION.

[flake8]
filename = *.py,
exclude = __init__.py, *.egg, build, docs, .git
ignore =
# line break before binary operator
W503,
# whitespace before :
E203
69 changes: 69 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: build

on:
push:
branches:
- "branch-*"
tags:
- "v**"
- "!v**a"
workflow_dispatch:
inputs:
branch:
required: true
type: string
date:
required: true
type: string
sha:
required: true
type: string
build_type:
type: string
default: nightly

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true

jobs:
conda-python-build:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
# Package is pure Python and only ever requires one build.
matrix_filter: 'map(select(.ARCH == "amd64" and (.LINUX_VER | test("centos")|not))) | sort_by(.PY_VER | split(".") | map(tonumber)) | [.[-1]]'
upload-conda:
needs: conda-python-build
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
wheel-build:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
script: ci/build_wheel.sh
# Package is pure Python and only ever requires one build.
matrix_filter: 'map(select((.LINUX_VER | test("centos")|not))) | sort_by((.PY_VER | split(".") | map(tonumber))) | [.[-1] + {ARCH: "amd64"}]'
wheel-publish:
needs: wheel-build
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
package-name: jupyterlab-nvdashboard
58 changes: 58 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: pr

on:
push:
branches:
- "pull-request/[0-9]+"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
pr-builder:
needs:
- checks
- conda-python-build
- conda-python-tests
- wheel-build
- wheel-tests
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
checks:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
conda-python-build:
needs: checks
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
build_type: pull-request
# Package is pure Python and only ever requires one build.
matrix_filter: 'map(select(.ARCH == "amd64" and (.LINUX_VER | test("centos")|not))) | sort_by(.PY_VER | split(".") | map(tonumber)) | [.[-1]]'
conda-python-tests:
needs: conda-python-build
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
build_type: pull-request
# Package is pure Python and only ever requires one build.
matrix_filter: 'map(select(.ARCH == "amd64" and (.LINUX_VER | test("centos")|not))) | sort_by(.PY_VER | split(".") | map(tonumber)) | [.[-1]]'
wheel-build:
needs: checks
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
build_type: pull-request
# Package is pure Python and only ever requires one build.
matrix_filter: 'map(select((.LINUX_VER | test("centos")|not))) | sort_by((.PY_VER | split(".") | map(tonumber))) | [.[-1] + {ARCH: "amd64"}]'
script: "ci/build_wheel.sh"
wheel-tests:
needs: wheel-build
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
build_type: pull-request
# Package is pure Python and only ever requires one build.
matrix_filter: 'map(select(.ARCH == "amd64" and (.LINUX_VER | test("centos")|not))) | sort_by(.PY_VER | split(".") | map(tonumber)) | [.[-1]]'
script: "ci/test_wheel.sh"
11 changes: 9 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
*.bundle.*
lib/
node_modules/
*.log
.eslintcache
.stylelintcache
*.egg-info/
.ipynb_checkpoints
*.tsbuildinfo
jupyterlab_nvdashboard/labextension
# Version file is handled by hatchling
jupyterlab_nvdashboard/_version.py

# Created by https://www.gitignore.io/api/python
# Edit at https://www.gitignore.io/?templates=python
Expand All @@ -14,8 +19,6 @@ jupyterlab_nvdashboard/labextension
__pycache__/
*.py[cod]
*$py.class
dask-worker-space/
.pytest_cache/

# C extensions
*.so
Expand Down Expand Up @@ -58,6 +61,7 @@ htmlcov/
.coverage.*
.cache
nosetests.xml
coverage/
coverage.xml
*.cover
.hypothesis/
Expand Down Expand Up @@ -112,3 +116,6 @@ dmypy.json

# OSX files
.DS_Store

# Yarn cache
.yarn/
23 changes: 23 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (c) 2023, NVIDIA CORPORATION.

repos:
- repo: https://github.com/psf/black
rev: 23.11.0
hooks:
- id: black
files: jupyterlab_nvdashboard/.*
# Explicitly specify the pyproject.toml at the repo root, not per-project.
args: ['--config', 'pyproject.toml']
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
args: ['--config=.flake8']
files: jupyterlab_nvdashboard/.*$
- repo: https://github.com/rapidsai/dependency-file-generator
rev: v1.7.1
hooks:
- id: rapids-dependency-file-generator
args: ['--clean']
default_language_version:
python: python3
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
Loading

0 comments on commit 47a5331

Please sign in to comment.