Skip to content

Commit

Permalink
Upgrade topbar extensions to JupyterLab 4 (jupyterlab-contrib#92)
Browse files Browse the repository at this point in the history
* Add logout extension package

* Add theme toggler extension package

* Ignore and remove labextension files

* Add system monitor package

* Add topbar text package

* Remove obselete files

* Add linters configs

* Update package.json and yarn.lock

* Update gitignore files

* Attempt to modernise github workflows

* Update README

* Add rootdir for eslint config

* Add .yarnrc.yml file for each package

* Update gitignore for all packages

* Fix errors in workflow files

* Lint source code

* Remove system-monitor extension

Will add this extension to the jupyter-resource-usage repo.

See #195, #191 in  jupyter-resource-usage

* Update gitignore files

Remove _version.py files from VCS. Hatchling will handle them directly.

* Attempt to fix errors in CI

* Setup matrix vars in CI to give extension name

* Bump coreutils to 6.0.0

Mistakenly we were using coreutils 4.0.0 which made
topbar-text extension outdated

* Attempt to fix packaging workflow

* Move CI and binder badges to README in root

Remove badges from README of packages

Remove references to jupyterlab-resource-monitor in README.
Add a note that the package can be installed from jupyter-resource-usage

Add postBuild file for binder

* Make linter happy

* Address PR comments

Change extension names from @jupyterlab-* to jupyterlab-*
to avoid clashing with official extensions

Use jupyterlab-topbar as command namespace for logout extension

* Remove extension suffix from package names

* Remove extension suffix from names in CI tests
  • Loading branch information
mahendrapaipuri authored Jul 24, 2023
1 parent 6099246 commit 33be88b
Show file tree
Hide file tree
Showing 78 changed files with 14,117 additions and 9,117 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ dist
coverage
**/*.d.ts
tests
venv
.venv
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ module.exports = {
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfigbase.json',
project: 'tsconfig.eslint.json',
sourceType: 'module',
tsconfigRootDir: __dirname,
},
plugins: ['@typescript-eslint'],
rules: {
Expand Down
47 changes: 28 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,44 @@ on:
branches:
- main

defaults:
run:
shell: bash -l {0}

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
extension:
- logout
- theme-toggler
- topbar-text

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

- name: Install node
uses: actions/setup-node@v2
with:
node-version: '14.x'

- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: Install JupyterLab
run: python -m pip install jupyterlab
run: python -m pip install -U "jupyterlab>=4.0.0,<5"

- name: Lint the extension
run: |
set -eux
jlpm
jlpm run lint:check
- name: Install the topbar extensions
- name: Build the extension
working-directory: packages/${{ matrix.extension }}-extension
run: |
set -eux
python -m pip install .
jupyter labextension list 2>&1 | grep -ie "jupyterlab-topbar-extension.*OK"
- name: Browser check
run: python -m jupyterlab.browser_check
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "jupyterlab-${{ matrix.extension }}.*OK"
- name: Lint
run: |
jlpm
jlpm run eslint:check
python -m jupyterlab.browser_check
106 changes: 64 additions & 42 deletions .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,41 @@ defaults:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- extension: logout
name: logout
- extension: theme-toggler
name: theme_toggler
- extension: topbar-text
name: topbar_text

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: 'x64'
uses: actions/checkout@v3

- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: Install dependencies
run: python -m pip install -U "jupyterlab>=4.0.0,<5"

- name: Package the extension
working-directory: packages/${{ matrix.extension }}-extension
run: |
python -m pip install --upgrade pip wheel
python -m pip install setuptools jupyter_packaging "jupyterlab>=3,<4"
- name: Build pypi distributions
run: |
python setup.py sdist bdist_wheel
- name: Build npm distributions
run: |
jlpm lerna exec -- npm pack
cp packages/*/*.tgz dist
- name: Build checksum file
run: |
cd dist
sha256sum * | tee SHA256SUMS
- name: Upload distributions
uses: actions/upload-artifact@v2
set -eux
pip install build
python -m build
pip uninstall -y "jupyterlab_${{ matrix.name }}" jupyterlab
- name: Upload extension packages
uses: actions/upload-artifact@v3
with:
name: dist ${{ github.run_number }}
path: ./dist
name: extension-artifacts
path: packages/${{ matrix.extension }}-extension/dist/jupyterlab_${{ matrix.name }}*
if-no-files-found: error

install:
runs-on: ${{ matrix.os }}-latest
Expand All @@ -56,41 +59,60 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu, macos, windows]
python: ['3.6', '3.9']
python: ['3.8', '3.11']
include:
- python: '3.6'
dist: 'jupyterlab-topbar*.tar.gz'
- python: '3.9'
dist: 'jupyterlab_topbar*.whl'
- python: '3.8'
extension: logout
dist: 'jupyterlab_logout*.tar.gz'
- python: '3.11'
extension: logout
dist: 'jupyterlab_logout*.whl'
- python: '3.8'
extension: theme-toggler
dist: 'jupyterlab_theme_toggler*.tar.gz'
- python: '3.11'
extension: theme-toggler
dist: 'jupyterlab_theme_toggler*.whl'
- python: '3.8'
extension: topbar-text
dist: 'jupyterlab_topbar_text*.tar.gz'
- python: '3.11'
extension: topbar-text
dist: 'jupyterlab_topbar_text*.whl'
- os: windows
py_cmd: python
- os: macos
py_cmd: python3
- os: ubuntu
py_cmd: python

steps:
- name: Install Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
architecture: 'x64'
- uses: actions/download-artifact@v2

- uses: actions/download-artifact@v3
with:
name: dist ${{ github.run_number }}
path: ./dist
- name: Install the prerequisites
name: extension-artifacts
path: packages/${{ matrix.extension }}-extension/dist

- name: Install prerequisites
run: |
${{ matrix.py_cmd }} -m pip install pip wheel
- name: Install the package
- name: Install package
run: |
cd dist
cd packages/${{ matrix.extension }}-extension/dist
${{ matrix.py_cmd }} -m pip install -vv ${{ matrix.dist }}
- name: Validate environment
run: |
${{ matrix.py_cmd }} -m pip freeze
${{ matrix.py_cmd }} -m pip check
- name: Validate the install
- name: Validate install
run: |
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "jupyterlab-topbar.*enabled.*ok" -
jupyter labextension list 2>&1 | grep -ie "jupyterlab-${{ matrix.extension }}.*OK"
9 changes: 7 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
tsconfig.tsbuildinfo
jupyterlab-topbar/labextension
*.tsbuildinfo

# Yarn cache
.yarn/

# Created by https://www.gitignore.io/api/python
# Edit at https://www.gitignore.io/?templates=python
Expand Down
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ node_modules
**/node_modules
**/lib
**/package.json
**/venv
**/.venv
14 changes: 14 additions & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": [
"stylelint-config-recommended",
"stylelint-config-standard",
"stylelint-prettier/recommended"
],
"rules": {
"no-empty-source": null,
"selector-class-pattern": null,
"property-no-vendor-prefix": null,
"selector-no-vendor-prefix": null,
"value-no-vendor-prefix": null
}
}
2 changes: 0 additions & 2 deletions .yarnrc

This file was deleted.

2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
enableImmutableInstalls: false
nodeLinker: node-modules
24 changes: 0 additions & 24 deletions MANIFEST.in

This file was deleted.

Loading

0 comments on commit 33be88b

Please sign in to comment.