Skip to content

Commit eac3285

Browse files
jtpioCopilot
andauthored
Drop lerna (#7882)
* Drop lerna * fixes * fix version-cmd * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * lint * tests * npm tarballs are already built by the releaser * Update buildutils/src/utils.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 62fd4a9 commit eac3285

File tree

23 files changed

+446
-2899
lines changed

23 files changed

+446
-2899
lines changed

.github/actions/build-dist/action.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,14 @@ runs:
1616
run: |
1717
hatch build
1818
19-
- name: Build npm distributions
20-
shell: bash
21-
run: |
22-
mkdir pkgs
23-
hatch run npm_pack
24-
cp packages/*/*.tgz pkgs
25-
2619
- name: Build checksum file
2720
shell: bash
2821
run: |
2922
cd dist
3023
sha256sum * | tee SHA256SUMS
31-
cd ../pkgs
32-
sha256sum * | tee SHA256SUMS
3324
3425
- name: Upload distributions
3526
uses: actions/upload-artifact@v4
3627
with:
3728
name: notebook-dist-${{ github.run_number }}
3829
path: ./dist
39-
40-
- name: Upload distributions
41-
uses: actions/upload-artifact@v4
42-
with:
43-
name: notebook-pkgs-${{ github.run_number }}
44-
path: ./pkgs

.github/workflows/build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,12 @@ jobs:
192192
hatch run lint:build
193193
pipx run interrogate -v .
194194
pipx run doc8 --max-line-length=200 docs/source *.md
195-
npm install -g yarn
196-
yarn
197-
yarn eslint:check
198-
yarn prettier:check
199-
yarn build:utils
200-
yarn integrity
195+
python -m pip install -U "jupyterlab>=4.6.0a0,<4.7"
196+
jlpm
197+
jlpm eslint:check
198+
jlpm prettier:check
199+
jlpm build:utils
200+
jlpm integrity
201201
202202
tests_check: # This job does nothing and is only used for the branch protection
203203
if: always()

.github/workflows/buildutils.yml

Lines changed: 70 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,32 +38,84 @@ jobs:
3838
git config --global user.email "you@example.com"
3939
git config --global user.name "Your Name"
4040
41-
- name: Reset version
41+
- name: Check Notebook versioning flow
4242
run: |
43+
set -eux
44+
45+
assert_release_state() {
46+
local py_expected="$1"
47+
local js_expected="$2"
48+
49+
test "$(hatch version)" = "${py_expected}"
50+
grep -nF "__version__ = \"${py_expected}\"" notebook/_version.py
51+
grep -nF "\"version\": \"${js_expected}\"" \
52+
buildutils/package.json \
53+
packages/application/package.json \
54+
packages/lab-extension/package.json
55+
grep -nF "\"@jupyter-notebook/application\": \"^${js_expected}\"" \
56+
packages/application-extension/package.json \
57+
packages/lab-extension/package.json
58+
grep -nF "\"@jupyter-notebook/application\": \"~${js_expected}\"" \
59+
app/package.json
60+
grep -nF '"version": "0.1.0"' package.json ui-tests/package.json
61+
}
62+
4363
hatch version 9.8.7
44-
jlpm run lerna version 9.8.7 --no-push --force-publish --no-git-tag-version --yes
64+
jlpm run set:workspace-version 9.8.7
4565
git commit -am "Release 9.8.7"
66+
assert_release_state 9.8.7 9.8.7
4667
47-
- name: Patch Release
48-
run: |
49-
jlpm release:patch --force
68+
jlpm release:bump next --skip-commit
69+
assert_release_state 9.8.8 9.8.8
70+
git restore .
5071
51-
- name: Minor Release
52-
run: |
53-
jlpm release:bump minor --force
72+
jlpm release:patch
73+
assert_release_state 9.8.8 9.8.8
74+
75+
jlpm release:bump minor
76+
assert_release_state 9.9.0a0 9.9.0-alpha.0
77+
78+
jlpm release:bump next --skip-commit
79+
assert_release_state 9.9.0a1 9.9.0-alpha.1
80+
git restore .
81+
82+
jlpm release:bump release
83+
assert_release_state 9.9.0b0 9.9.0-beta.0
84+
85+
jlpm release:bump release
86+
assert_release_state 9.9.0rc0 9.9.0-rc.0
87+
88+
jlpm release:bump release
89+
assert_release_state 9.9.0 9.9.0
5490
55-
- name: Release Cycle
91+
jlpm release:bump major
92+
assert_release_state 10.0.0a0 10.0.0-alpha.0
93+
94+
- name: Check dependency update helper
5695
run: |
57-
# beta
58-
jlpm release:bump release --force
59-
# rc
60-
jlpm release:bump release --force
61-
# final
62-
jlpm release:bump release --force
63-
64-
- name: Major Release
96+
set -eux
97+
98+
UPDATE_LOG="$(
99+
jlpm update:dependency @jupyterlab/application '~4.5.0-rc.1' --dry-run 2>&1
100+
)"
101+
printf '%s\n' "${UPDATE_LOG}"
102+
103+
grep -F 'packages/application/package.json' <<< "${UPDATE_LOG}"
104+
grep -F 'packages/lab-extension/package.json' <<< "${UPDATE_LOG}"
105+
git diff --exit-code
106+
107+
- name: Check JupyterLab version update helpers
65108
run: |
66-
jlpm release:bump major --force
109+
set -eux
110+
111+
EXACT_VERSION=$(node ./buildutils/lib/get-latest-lab-version.js --set-version v4.5.0rc1)
112+
test "${EXACT_VERSION}" = "4.5.0rc1"
113+
114+
node ./buildutils/lib/upgrade-lab-dependencies.js --set-version 4.5.0rc1
115+
116+
grep -nF 'jupyterlab>=4.5.0rc1,<4.6' pyproject.toml .pre-commit-config.yaml
117+
grep -nF '"@jupyterlab/application": "~4.5.0-rc.1"' app/package.json packages/lab-extension/package.json
118+
git diff --name-only -- ui-tests/package.json | grep -Fx 'ui-tests/package.json'
67119
68120
npm:
69121
runs-on: ubuntu-latest

.github/workflows/upgrade-jupyterlab-dependencies.yml

Lines changed: 46 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -71,24 +71,40 @@ jobs:
7171
7272
echo "latest=${LATEST}" >> $GITHUB_ENV
7373
jlpm upgrade:lab:dependencies --set-version ${LATEST}
74-
if [[ ! -z "$(git status --porcelain package.json)" ]]; then
75-
jlpm
76-
jlpm deduplicate
7774
78-
cd ui-tests
79-
jlpm
80-
jlpm deduplicate
75+
- name: Detect tracked changes
76+
id: detect-changes
77+
shell: bash
78+
run: |
79+
if [[ -n "$(git status --porcelain --untracked-files=no)" ]]; then
80+
echo "has_changes=true" >> "$GITHUB_OUTPUT"
81+
else
82+
echo "has_changes=false" >> "$GITHUB_OUTPUT"
8183
fi
84+
85+
- name: Refresh JavaScript lockfiles
86+
if: steps.detect-changes.outputs.has_changes == 'true'
87+
run: |
88+
jlpm
89+
jlpm deduplicate
90+
91+
cd ui-tests
92+
jlpm
93+
jlpm deduplicate
94+
8295
- uses: prefix-dev/setup-pixi@v0.9.4
96+
if: steps.detect-changes.outputs.has_changes == 'true'
8397
with:
8498
pixi-version: v0.41.4
8599
manifest-path: pyproject.toml
86100
locked: false
87101

88102
- name: Update pixi.lock
103+
if: steps.detect-changes.outputs.has_changes == 'true'
89104
run: pixi install
90105

91106
- name: Create a PR
107+
if: steps.detect-changes.outputs.has_changes == 'true'
92108
env:
93109
GH_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
94110
run: |
@@ -97,32 +113,34 @@ jobs:
97113
export LATEST=${{ env.latest }}
98114
export BRANCH_NAME=update-to-v${LATEST}
99115
100-
# if resulted in any change:
101-
if [[ ! -z "$(git status --porcelain package.json)" ]]; then
102-
# if branch already exists.
103-
if git ls-remote --heads origin | grep "refs/heads/${BRANCH_NAME}$" > /dev/null; then
104-
echo "Branch '${BRANCH_NAME}' exists."
105-
else
106-
# new branch is created
107-
git checkout -b "${BRANCH_NAME}"
108-
git config user.name "github-actions[bot]"
109-
git config user.email 'github-actions[bot]@users.noreply.github.com'
116+
if [[ -z "$(git status --porcelain --untracked-files=no)" ]]; then
117+
echo "No tracked changes to commit."
118+
exit 0
119+
fi
110120
111-
git commit . -m "Update to JupyterLab v${LATEST}"
121+
# if branch already exists.
122+
if git ls-remote --heads origin | grep "refs/heads/${BRANCH_NAME}$" > /dev/null; then
123+
echo "Branch '${BRANCH_NAME}' exists."
124+
else
125+
# new branch is created
126+
git checkout -b "${BRANCH_NAME}"
127+
git config user.name "github-actions[bot]"
128+
git config user.email 'github-actions[bot]@users.noreply.github.com'
112129
113-
git push --set-upstream origin "${BRANCH_NAME}"
130+
git commit . -m "Update to JupyterLab v${LATEST}"
114131
115-
PR_ARGS=(
116-
--base "${{ inputs.branch || 'main' }}"
117-
--title "Update to JupyterLab v${LATEST}"
118-
--body "New JupyterLab release [v${LATEST}](https://github.com/jupyterlab/jupyterlab/releases/tag/v${LATEST}) is available. Please review the lock file carefully."
119-
)
132+
git push --set-upstream origin "${BRANCH_NAME}"
120133
121-
# Add --repo flag only if target_repo is specified
122-
if [[ -n "${{ inputs.target_repo }}" ]]; then
123-
PR_ARGS+=(--repo "${{ inputs.target_repo }}")
124-
fi
134+
PR_ARGS=(
135+
--base "${{ inputs.branch || 'main' }}"
136+
--title "Update to JupyterLab v${LATEST}"
137+
--body "New JupyterLab release [v${LATEST}](https://github.com/jupyterlab/jupyterlab/releases/tag/v${LATEST}) is available. Please review the lock file carefully."
138+
)
125139
126-
gh pr create "${PR_ARGS[@]}"
140+
# Add --repo flag only if target_repo is specified
141+
if [[ -n "${{ inputs.target_repo }}" ]]; then
142+
PR_ARGS+=(--repo "${{ inputs.target_repo }}")
127143
fi
144+
145+
gh pr create "${PR_ARGS[@]}"
128146
fi

CONTRIBUTING.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -137,27 +137,6 @@ Running the end to end tests in headful mode will trigger something like the fol
137137

138138
![playwright-headed-demo](https://user-images.githubusercontent.com/591645/141274633-ca9f9c2f-eef6-430e-9228-a35827f8133d.gif)
139139

140-
## Tasks caching
141-
142-
The repository is configured to use the Lerna caching system (via `nx`) for some of the development scripts.
143-
144-
This helps speed up rebuilds when running `jlpm run build` multiple times to avoid rebuilding packages that have not changed on disk.
145-
146-
You can generate a graph to have a better idea of the dependencies between all the packages using the following command:
147-
148-
```
149-
npx nx graph
150-
```
151-
152-
Running the command will open a browser tab by default with a graph that looks like the following:
153-
154-
![a screenshot showing the nx task graph](https://github.com/jupyter/notebook/assets/591645/34eb46f0-b0e5-44b6-9430-ae5fbd673a4b)
155-
156-
To learn more about Lerna caching:
157-
158-
- https://lerna.js.org/docs/features/cache-tasks
159-
- https://nx.dev/docs/features/cache-task-results
160-
161140
### Updating reference snapshots
162141

163142
Often a PR might make changes to the user interface, which can cause the visual regression tests to fail.

app/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@
196196
},
197197
"devDependencies": {
198198
"@jupyterlab/builder": "~4.6.0-alpha.4",
199-
"@jupyterlab/buildutils": "~4.6.0-alpha.4",
200199
"@rspack/cli": "^1.7.1",
201200
"@rspack/core": "^1.7.1",
202201
"@types/rimraf": "^3.0.2",

0 commit comments

Comments
 (0)