Skip to content

Commit a7a9f10

Browse files
Fix workflows, build against JupyterLab 4, fix build TS 5 errors, lint (#346)
* Move workflows to enable them, update `update-integration-tests.yml` from template * Align workflows with template, use `master` for now, test against lab 4 * Add prep release/publish release workflows (older token variant) * Switch to berry lockfile generated with lab 4 * package.json: update dependencies to lab 4, update URLs and update style * Update lockfile * Lint codebase, fixing `@ts-ignore` and `error: unknown` issues * Align jest config/tsconfig * Install formatters required by tests * Remove `pip-deepfreeze` environments, remove lab 3 classifier, build with lab 4 * Fix installation * Do not add `ruff` for now * Add changelog markers, remove unreleased version changelog * Add rpy2 to test requirements * Update ui-tests template * Update links Co-authored-by: Frédéric Collonval <[email protected]> * Update README to reflect new maintenance Co-authored-by: Frédéric Collonval <[email protected]> * Lint * Delete .github/FUNDING.yml As per jupyterlab-contrib/jupyterlab-contrib.github.io#74 (comment) --------- Co-authored-by: Frédéric Collonval <[email protected]>
1 parent e41a862 commit a7a9f10

30 files changed

+15835
-8750
lines changed

.github/FUNDING.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/wip-workflows/update-integration-tests.yml

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

.github/wip-workflows/binder-on-pr.yml renamed to .github/workflows/binder-on-pr.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,4 @@ jobs:
1111
steps:
1212
- uses: jupyterlab/maintainer-tools/.github/actions/binder-link@v1
1313
with:
14-
15-
github_token: ${{ secrets.github_token }}
16-
14+
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/wip-workflows/build.yml renamed to .github/workflows/build.yml

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,40 @@ name: Build
22

33
on:
44
push:
5-
branches: main
5+
branches: master
66
pull_request:
77
branches: '*'
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
build:
1115
runs-on: ubuntu-latest
1216

1317
steps:
1418
- name: Checkout
15-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
1620

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

2024
- name: Install dependencies
21-
run: python -m pip install -U jupyterlab~=3.1
25+
run: python -m pip install -U "jupyterlab>=4.0.0,<5"
26+
27+
- name: Install R
28+
uses: r-lib/actions/setup-r@v2
29+
30+
- name: Install R formatters
31+
run: Rscript -e 'install.packages(c("styler", "formatR"))'
2232

2333
- name: Lint the extension
2434
run: |
2535
set -eux
2636
jlpm
2737
jlpm run lint:check
28-
38+
2939
- name: Test the extension
3040
run: |
3141
set -eux
@@ -53,7 +63,7 @@ jobs:
5363
pip uninstall -y "jupyterlab_code_formatter" jupyterlab
5464
5565
- name: Upload extension packages
56-
uses: actions/upload-artifact@v3
66+
uses: actions/upload-artifact@v4
5767
with:
5868
name: extension-artifacts
5969
path: dist/jupyterlab_code_formatter*
@@ -64,14 +74,12 @@ jobs:
6474
runs-on: ubuntu-latest
6575

6676
steps:
67-
- name: Checkout
68-
uses: actions/checkout@v3
6977
- name: Install Python
70-
uses: actions/setup-python@v4
78+
uses: actions/setup-python@v5
7179
with:
7280
python-version: '3.9'
7381
architecture: 'x64'
74-
- uses: actions/download-artifact@v3
82+
- uses: actions/download-artifact@v4
7583
with:
7684
name: extension-artifacts
7785
- name: Install and Test
@@ -81,7 +89,7 @@ jobs:
8189
sudo rm -rf $(which node)
8290
sudo rm -rf $(which node)
8391
84-
pip install "jupyterlab~=3.1" jupyterlab_code_formatter*.whl
92+
pip install "jupyterlab>=4.0.0,<5" jupyterlab_code_formatter*.whl
8593
8694
8795
jupyter server extension list
@@ -101,20 +109,20 @@ jobs:
101109

102110
steps:
103111
- name: Checkout
104-
uses: actions/checkout@v3
112+
uses: actions/checkout@v4
105113

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

109117
- name: Download extension package
110-
uses: actions/download-artifact@v3
118+
uses: actions/download-artifact@v4
111119
with:
112120
name: extension-artifacts
113-
121+
114122
- name: Install the extension
115123
run: |
116124
set -eux
117-
python -m pip install "jupyterlab~=3.1" jupyterlab_code_formatter*.whl
125+
python -m pip install "jupyterlab>=4.0.0,<5" jupyterlab_code_formatter*.whl
118126
119127
- name: Install dependencies
120128
working-directory: ui-tests
@@ -123,7 +131,7 @@ jobs:
123131
run: jlpm install
124132

125133
- name: Set up browser cache
126-
uses: actions/cache@v3
134+
uses: actions/cache@v4
127135
with:
128136
path: |
129137
${{ github.workspace }}/pw-browsers
@@ -140,7 +148,7 @@ jobs:
140148
141149
- name: Upload Playwright Test report
142150
if: always()
143-
uses: actions/upload-artifact@v3
151+
uses: actions/upload-artifact@v4
144152
with:
145153
name: jupyterlab_code_formatter-playwright-tests
146154
path: |
@@ -152,6 +160,6 @@ jobs:
152160
runs-on: ubuntu-latest
153161
timeout-minutes: 15
154162
steps:
155-
- uses: actions/checkout@v3
163+
- uses: actions/checkout@v4
156164
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
157165
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1

.github/wip-workflows/check-release.yml renamed to .github/workflows/check-release.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
name: Check Release
22
on:
33
push:
4-
branches: ["main"]
4+
branches: ["master"]
55
pull_request:
66
branches: ["*"]
77

8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
10+
cancel-in-progress: true
11+
812
jobs:
913
check_release:
1014
runs-on: ubuntu-latest
1115
steps:
1216
- name: Checkout
13-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1418
- name: Base Setup
1519
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
1620
- name: Install Dependencies
@@ -23,7 +27,7 @@ jobs:
2327
token: ${{ secrets.GITHUB_TOKEN }}
2428

2529
- name: Upload Distributions
26-
uses: actions/upload-artifact@v3
30+
uses: actions/upload-artifact@v4
2731
with:
2832
name: jupyterlab_code_formatter-releaser-dist-${{ github.run_number }}
2933
path: .jupyter_releaser_checkout/dist

.github/workflows/prep-release.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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+
# silent:
16+
# description: "Set a placeholder in the changelog and don't publish the release."
17+
# required: false
18+
# type: boolean
19+
since:
20+
description: "Use PRs with activity since this date or git reference"
21+
required: false
22+
since_last_stable:
23+
description: "Use PRs with activity since the last stable git tag"
24+
required: false
25+
type: boolean
26+
jobs:
27+
prep_release:
28+
runs-on: ubuntu-latest
29+
permissions:
30+
contents: write
31+
steps:
32+
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
33+
34+
- name: Prep Release
35+
id: prep-release
36+
uses: jupyter-server/jupyter_releaser/.github/actions/prep-release@v2
37+
with:
38+
token: ${{ secrets.GITHUB_TOKEN }}
39+
version_spec: ${{ github.event.inputs.version_spec }}
40+
# silent: ${{ github.event.inputs.silent }}
41+
post_version_spec: ${{ github.event.inputs.post_version_spec }}
42+
branch: ${{ github.event.inputs.branch }}
43+
since: ${{ github.event.inputs.since }}
44+
since_last_stable: ${{ github.event.inputs.since_last_stable }}
45+
46+
- name: "** Next Step **"
47+
run: |
48+
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 }}

0 commit comments

Comments
 (0)