Skip to content

Commit b8b4f14

Browse files
authored
Update to JupyterLab 4 (#55)
* Update to JupyterLab 4 * Update yarn.lock * lint * fix dist upload * try underscores * fix signature * Add toolbar factory * Add uploader * fix file upload * add filename searcher * use pre-release packages in docs * undo tsconfig change * Disable forceRefresh * add jupyterlite-xeus-python to the docs env * Use `DRIVE_NAME` * Remove previous file * Rename to `jupyterlab_filesystem_access` as before * Fix `_jupyter_labextension_paths` * fix shared data
1 parent 4567cd6 commit b8b4f14

22 files changed

+6435
-6768
lines changed

.copier-answers.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2+
_commit: v4.2.2
3+
_src_path: https://github.com/jupyterlab/extension-template
4+
author_email: ''
5+
author_name: JupyterLab Contrib Team
6+
has_binder: false
7+
has_settings: false
8+
kind: frontend
9+
labextension_name: jupyterlab-filesystem-access
10+
project_short_description: Mount local files using the Filesystem API
11+
python_name: jupyterlab_filesystem_access
12+
repository: https://github.com/jupyterlab-contrib/jupyterlab-filesystem-access.git
13+
test: false
14+

.eslintignore

Lines changed: 0 additions & 8 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 39 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
1919

2020
- name: Install dependencies
21-
run: python -m pip install -U jupyterlab~=3.1
21+
run: python -m pip install -U "jupyterlab>=4.0.0,<5"
2222

2323
- name: Lint the extension
2424
run: |
@@ -41,22 +41,20 @@ jobs:
4141
4242
pip install build
4343
python -m build
44-
pip uninstall -y "jupyterlab_filesystem_access" jupyterlab
44+
pip uninstall -y "jupyterlab-filesystem-access" jupyterlab
4545
4646
- name: Upload extension packages
4747
uses: actions/upload-artifact@v3
4848
with:
4949
name: extension-artifacts
50-
path: dist/jupyterlab_filesystem_access*
50+
path: dist/*
5151
if-no-files-found: error
5252

5353
test_isolated:
5454
needs: build
5555
runs-on: ubuntu-latest
5656

5757
steps:
58-
- name: Checkout
59-
uses: actions/checkout@v3
6058
- name: Install Python
6159
uses: actions/setup-python@v4
6260
with:
@@ -72,12 +70,12 @@ jobs:
7270
sudo rm -rf $(which node)
7371
sudo rm -rf $(which node)
7472
75-
pip install "jupyterlab~=3.1" jupyterlab_filesystem_access*.whl
73+
pip install "jupyterlab>=4.0.0,<5" jupyterlab_filesystem_access*.whl
7674
7775
7876
jupyter labextension list
7977
jupyter labextension list 2>&1 | grep -ie "jupyterlab-filesystem-access.*OK"
80-
python -m jupyterlab.browser_check --no-chrome-test
78+
python -m jupyterlab.browser_check --no-browser-test
8179
8280
8381
check_links:

.github/workflows/check-release.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ jobs:
1313
uses: actions/checkout@v3
1414
- name: Base Setup
1515
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
16-
- name: Install Dependencies
17-
run: |
18-
pip install -e .
1916
- name: Check Release
2017
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
2118
with:

.github/workflows/prep-release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "Step 1: Prep Release"
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version_spec:
6+
description: "New Version Specifier"
7+
default: "next"
8+
required: false
9+
branch:
10+
description: "The branch to target"
11+
required: false
12+
post_version_spec:
13+
description: "Post Version Specifier"
14+
required: false
15+
since:
16+
description: "Use PRs with activity since this date or git reference"
17+
required: false
18+
since_last_stable:
19+
description: "Use PRs with activity since the last stable git tag"
20+
required: false
21+
type: boolean
22+
jobs:
23+
prep_release:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
27+
28+
- name: Prep Release
29+
id: prep-release
30+
uses: jupyter-server/jupyter_releaser/.github/actions/prep-release@v2
31+
with:
32+
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
33+
version_spec: ${{ github.event.inputs.version_spec }}
34+
post_version_spec: ${{ github.event.inputs.post_version_spec }}
35+
branch: ${{ github.event.inputs.branch }}
36+
since: ${{ github.event.inputs.since }}
37+
since_last_stable: ${{ github.event.inputs.since_last_stable }}
38+
39+
- name: "** Next Step **"
40+
run: |
41+
echo "Optional): Review Draft Release: ${{ steps.prep-release.outputs.release_url }}"

.github/workflows/publish-release.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: "Step 2: Publish Release"
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
branch:
6+
description: "The target branch"
7+
required: false
8+
release_url:
9+
description: "The URL of the draft GitHub release"
10+
required: false
11+
steps_to_skip:
12+
description: "Comma separated list of steps to skip"
13+
required: false
14+
15+
jobs:
16+
publish_release:
17+
runs-on: ubuntu-latest
18+
permissions:
19+
# This is useful if you want to use PyPI trusted publisher
20+
# and NPM provenance
21+
id-token: write
22+
steps:
23+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
24+
25+
- name: Populate Release
26+
id: populate-release
27+
uses: jupyter-server/jupyter_releaser/.github/actions/populate-release@v2
28+
with:
29+
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
30+
branch: ${{ github.event.inputs.branch }}
31+
release_url: ${{ github.event.inputs.release_url }}
32+
steps_to_skip: ${{ github.event.inputs.steps_to_skip }}
33+
34+
- name: Finalize Release
35+
id: finalize-release
36+
env:
37+
# The following are needed if you use legacy PyPI set up
38+
# PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
39+
# PYPI_TOKEN_MAP: ${{ secrets.PYPI_TOKEN_MAP }}
40+
# TWINE_USERNAME: __token__
41+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
42+
uses: jupyter-server/jupyter_releaser/.github/actions/finalize-release@v2
43+
with:
44+
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
45+
release_url: ${{ steps.populate-release.outputs.release_url }}
46+
47+
- name: "** Next Step **"
48+
if: ${{ success() }}
49+
run: |
50+
echo "Verify the final release"
51+
echo ${{ steps.finalize-release.outputs.release_url }}
52+
53+
- name: "** Failure Message **"
54+
if: ${{ failure() }}
55+
run: |
56+
echo "Failed to Publish the Draft Release Url:"
57+
echo ${{ steps.populate-release.outputs.release_url }}

.gitignore

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ jupyterlab_filesystem_access/labextension
1111
# Version file is handled by hatchling
1212
jupyterlab_filesystem_access/_version.py
1313

14-
# Integration tests
15-
ui-tests/test-results/
16-
ui-tests/playwright-report/
17-
1814
# Created by https://www.gitignore.io/api/python
1915
# Edit at https://www.gitignore.io/?templates=python
2016

@@ -120,3 +116,9 @@ dmypy.json
120116

121117
# OSX files
122118
.DS_Store
119+
120+
# Yarn cache
121+
.yarn/
122+
123+
# JupyterLab update script
124+
_temp_extension

.prettierignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ node_modules
33
**/lib
44
**/package.json
55
!/package.json
6-
jupyterlab_filesystem_access
6+
jupyterlab-filesystem-access

.prettierrc

Lines changed: 0 additions & 6 deletions
This file was deleted.

.stylelintrc

Lines changed: 0 additions & 12 deletions
This file was deleted.

.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

RELEASE.md

Lines changed: 63 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,36 @@
1-
# Making a new release of jupyterlab_filesystem_access
1+
# Making a new release of jupyterlab-filesystem-access
22

33
The extension can be published to `PyPI` and `npm` manually or using the [Jupyter Releaser](https://github.com/jupyter-server/jupyter_releaser).
44

55
## Manual release
66

77
### Python package
88

9-
This extension can be distributed as Python
10-
packages. All of the Python
11-
packaging instructions in the `pyproject.toml` file to wrap your extension in a
12-
Python package. Before generating a package, we first need to install `build`.
9+
This extension can be distributed as Python packages. All of the Python
10+
packaging instructions are in the `pyproject.toml` file to wrap your extension in a
11+
Python package. Before generating a package, you first need to install some tools:
1312

1413
```bash
15-
pip install build twine
14+
pip install build twine hatch
15+
```
16+
17+
Bump the version using `hatch`. By default this will create a tag.
18+
See the docs on [hatch-nodejs-version](https://github.com/agoose77/hatch-nodejs-version#semver) for details.
19+
20+
```bash
21+
hatch version <new-version>
22+
```
23+
24+
Make sure to clean up all the development files before building the package:
25+
26+
```bash
27+
jlpm clean:all
28+
```
29+
30+
You could also clean up the local git repository:
31+
32+
```bash
33+
git clean -dfX
1634
```
1735

1836
To create a Python source package (`.tar.gz`) and the binary package (`.whl`) in the `dist/` directory, do:
@@ -42,17 +60,49 @@ npm publish --access public
4260

4361
The extension repository should already be compatible with the Jupyter Releaser.
4462

45-
Check out the [workflow documentation](https://github.com/jupyter-server/jupyter_releaser#typical-workflow) for more information.
63+
Check out the [workflow documentation](https://jupyter-releaser.readthedocs.io/en/latest/get_started/making_release_from_repo.html) for more information.
4664

4765
Here is a summary of the steps to cut a new release:
4866

49-
- Fork the [`jupyter-releaser` repo](https://github.com/jupyter-server/jupyter_releaser)
50-
- Add `ADMIN_GITHUB_TOKEN`, `PYPI_TOKEN` and `NPM_TOKEN` to the Github Secrets in the fork
67+
- Add tokens to the [Github Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets) in the repository:
68+
- `ADMIN_GITHUB_TOKEN` (with "public_repo" and "repo:status" permissions); see the [documentation](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)
69+
- `NPM_TOKEN` (with "automation" permission); see the [documentation](https://docs.npmjs.com/creating-and-viewing-access-tokens)
70+
- Set up PyPI
71+
72+
<details><summary>Using PyPI trusted publisher (modern way)</summary>
73+
74+
- Set up your PyPI project by [adding a trusted publisher](https://docs.pypi.org/trusted-publishers/adding-a-publisher/)
75+
- The _workflow name_ is `publish-release.yml` and the _environment_ should be left blank.
76+
- Ensure the publish release job as `permissions`: `id-token : write` (see the [documentation](https://docs.pypi.org/trusted-publishers/using-a-publisher/))
77+
78+
</details>
79+
80+
<details><summary>Using PyPI token (legacy way)</summary>
81+
82+
- If the repo generates PyPI release(s), create a scoped PyPI [token](https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/#saving-credentials-on-github). We recommend using a scoped token for security reasons.
83+
84+
- You can store the token as `PYPI_TOKEN` in your fork's `Secrets`.
85+
86+
- Advanced usage: if you are releasing multiple repos, you can create a secret named `PYPI_TOKEN_MAP` instead of `PYPI_TOKEN` that is formatted as follows:
87+
88+
```text
89+
owner1/repo1,token1
90+
owner2/repo2,token2
91+
```
92+
93+
If you have multiple Python packages in the same repository, you can point to them as follows:
94+
95+
```text
96+
owner1/repo1/path/to/package1,token1
97+
owner1/repo1/path/to/package2,token2
98+
```
99+
100+
</details>
101+
51102
- Go to the Actions panel
52-
- Run the "Draft Changelog" workflow
53-
- Merge the Changelog PR
54-
- Run the "Draft Release" workflow
55-
- Run the "Publish Release" workflow
103+
- Run the "Step 1: Prep Release" workflow
104+
- Check the draft changelog
105+
- Run the "Step 2: Publish Release" workflow
56106
57107
## Publishing to `conda-forge`
58108

docs/environment.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ channels:
55

66
dependencies:
77
- yarn=1
8-
- jupyterlab
8+
- jupyterlab >=4.0.7,<5
9+
- notebook >=7.0.6,<8
910
- pydata-sphinx-theme
10-
- jupyter
11-
- jupyterlite-pyodide-kernel
1211
- jupyterlite-sphinx
1312
- pip:
13+
- jupyterlite-pyodide-kernel==0.2.0a2
14+
- jupyterlite-xeus-python==1.0.0a3
15+
- jupyterlite-core==0.2.0rc1
1416
- ..

0 commit comments

Comments
 (0)