-
-
Notifications
You must be signed in to change notification settings - Fork 104
Upgrade extension to JupyterLab 4 #145
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
Merged
Merged
Changes from 13 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
d56c702
Migrate to hatch build system
mahendrapaipuri 76cbedc
Bump @jupyterlab deps to 4.0.0
mahendrapaipuri f3fa22a
Update labextension points
mahendrapaipuri 760f05d
Update binder env in CI workflows
mahendrapaipuri 3bda98f
Ensure we can make editable builds
mahendrapaipuri d6df94f
Fix build cmd for editbale installs in pyproject
mahendrapaipuri 7d9513b
Remove "extension" suffix from extensions name
mahendrapaipuri 82dd6f0
Remove utililies from jupyter_server rather than nb
mahendrapaipuri 36aeba6
Enhance lint config
mahendrapaipuri 0001aa0
Add basic CI workflows
mahendrapaipuri 85d6f70
Modernise async stuff and ensure token is defined
mahendrapaipuri 9de7a3c
Update README file
mahendrapaipuri 0ac79a6
Add release related workflows
mahendrapaipuri 71a9061
Add an empty changelog file
mahendrapaipuri e336c2b
Generate a changelog from github-activity
mahendrapaipuri 56a7f4c
Remove unnecessary step in check release workflow
mahendrapaipuri bcb7e7f
Remove unnecessary prepare script from package.json
mahendrapaipuri 0ff432a
Remove reference to tslint in eslint config
mahendrapaipuri b643ed5
Revert version back to 3.x in package.json
mahendrapaipuri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
pull_request: | ||
branches: | ||
- main | ||
- master | ||
|
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Base Setup | ||
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | ||
|
||
- name: 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: Build the extension | ||
run: | | ||
set -eux | ||
python -m pip install . | ||
|
||
jupyter labextension list | ||
jupyter labextension list 2>&1 | grep -ie "@jupyterlab/github.*OK" | ||
|
||
python -m jupyterlab.browser_check |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Check Release | ||
on: | ||
push: | ||
branches: [ master, main ] | ||
pull_request: | ||
branches: ["*"] | ||
|
||
jobs: | ||
check_release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Base Setup | ||
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | ||
|
||
- name: Install Dependencies | ||
run: | | ||
pip install -e . | ||
|
||
- name: Check Release | ||
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Upload Distributions | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: jupyterlab_github-releaser-dist-${{ github.run_number }} | ||
path: .jupyter_releaser_checkout/dist |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
name: Packaging | ||
|
||
on: | ||
push: | ||
branches: [ master, main ] | ||
pull_request: | ||
branches: '*' | ||
|
||
env: | ||
PIP_DISABLE_PIP_VERSION_CHECK: 1 | ||
|
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
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 | ||
run: | | ||
set -eux | ||
pip install build | ||
python -m build | ||
pip uninstall -y "jupyterlab_github" jupyterlab | ||
|
||
- name: Upload extension packages | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: extension-artifacts | ||
path: ./dist/jupyterlab_github* | ||
if-no-files-found: error | ||
|
||
install: | ||
runs-on: ${{ matrix.os }}-latest | ||
needs: [build] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu, macos, windows] | ||
python: ['3.8', '3.11'] | ||
include: | ||
- python: '3.8' | ||
dist: 'jupyterlab_github*.tar.gz' | ||
- python: '3.11' | ||
dist: 'jupyterlab_github*.whl' | ||
- os: windows | ||
py_cmd: python | ||
- os: macos | ||
py_cmd: python3 | ||
- os: ubuntu | ||
py_cmd: python | ||
|
||
steps: | ||
- name: Install Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
architecture: 'x64' | ||
|
||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: extension-artifacts | ||
path: ./dist | ||
|
||
- name: Install prerequisites | ||
run: | | ||
${{ matrix.py_cmd }} -m pip install pip wheel | ||
|
||
- name: Install package | ||
run: | | ||
cd 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 install | ||
run: | | ||
jupyter labextension list | ||
jupyter labextension list 2>&1 | grep -ie "@jupyterlab/github.*OK" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: "Step 1: Prep Release" | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version_spec: | ||
description: "New Version Specifier" | ||
default: "next" | ||
required: false | ||
branch: | ||
description: "The branch to target" | ||
required: false | ||
post_version_spec: | ||
description: "Post Version Specifier" | ||
required: false | ||
since: | ||
description: "Use PRs with activity since this date or git reference" | ||
required: false | ||
since_last_stable: | ||
description: "Use PRs with activity since the last stable git tag" | ||
required: false | ||
type: boolean | ||
jobs: | ||
prep_release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | ||
|
||
- name: Prep Release | ||
id: prep-release | ||
uses: jupyter-server/jupyter_releaser/.github/actions/prep-release@v2 | ||
with: | ||
token: ${{ secrets.ADMIN_GITHUB_TOKEN }} | ||
version_spec: ${{ github.event.inputs.version_spec }} | ||
post_version_spec: ${{ github.event.inputs.post_version_spec }} | ||
target: ${{ github.event.inputs.target }} | ||
branch: ${{ github.event.inputs.branch }} | ||
since: ${{ github.event.inputs.since }} | ||
since_last_stable: ${{ github.event.inputs.since_last_stable }} | ||
|
||
- name: "** Next Step **" | ||
run: | | ||
echo "Optional): Review Draft Release: ${{ steps.prep-release.outputs.release_url }}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: "Step 2: Publish Release" | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: "The target branch" | ||
required: false | ||
release_url: | ||
description: "The URL of the draft GitHub release" | ||
required: false | ||
steps_to_skip: | ||
description: "Comma separated list of steps to skip" | ||
required: false | ||
default: "ensure-sha" | ||
|
||
jobs: | ||
publish_release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | ||
|
||
- name: Populate Release | ||
id: populate-release | ||
uses: jupyter-server/jupyter_releaser/.github/actions/populate-release@v2 | ||
with: | ||
token: ${{ secrets.ADMIN_GITHUB_TOKEN }} | ||
target: ${{ github.event.inputs.target }} | ||
branch: ${{ github.event.inputs.branch }} | ||
release_url: ${{ github.event.inputs.release_url }} | ||
steps_to_skip: ${{ github.event.inputs.steps_to_skip }} | ||
|
||
- name: Finalize Release | ||
id: finalize-release | ||
env: | ||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
PYPI_TOKEN_MAP: ${{ secrets.PYPI_TOKEN_MAP }} | ||
TWINE_USERNAME: __token__ | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
uses: jupyter-server/jupyter-releaser/.github/actions/finalize-release@v2 | ||
with: | ||
token: ${{ secrets.ADMIN_GITHUB_TOKEN }} | ||
target: ${{ github.event.inputs.target }} | ||
release_url: ${{ steps.populate-release.outputs.release_url }} | ||
|
||
- name: "** Next Step **" | ||
if: ${{ success() }} | ||
run: | | ||
echo "Verify the final release" | ||
echo ${{ steps.finalize-release.outputs.release_url }} | ||
|
||
- name: "** Failure Message **" | ||
if: ${{ failure() }} | ||
run: | | ||
echo "Failed to Publish the Draft Release Url:" | ||
echo ${{ steps.populate-release.outputs.release_url }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
nodeLinker: node-modules | ||
enableImmutableInstalls: false |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally we shouldn't need this as it might add side-effects, and this step does not exist during the actual release process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Maybe we should remove it from the extension-template repo as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah if it's there then yes 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is in the template. I have not changed anything from the template except replacing Jinja2 vars.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just opened jupyterlab/extension-template#38