Skip to content

Commit

Permalink
Remove enableImmutableInstalls: false (#39)
Browse files Browse the repository at this point in the history
* Remove `enableImmutableInstalls: false`

* Allow for non-immutable lock file on CI

* Fix defining YARN_ENABLE_IMMUTABLE_INSTALLS

* Close the file editor before opening the file in the dedicated viewer

* Bump ui test dep
  • Loading branch information
fcollonval authored Aug 16, 2023
1 parent 824f302 commit e7e4c2b
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 14 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/check-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
working-directory: myextension
run: |
set -eux
jlpm
YARN_ENABLE_IMMUTABLE_INSTALLS=false jlpm
jlpm test
- name: Install the extension
Expand All @@ -47,10 +47,11 @@ jobs:
run: |
jupyter labextension list
- name: Install dependencies
- name: Install UI tests dependencies
working-directory: myextension/ui-tests
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
YARN_ENABLE_IMMUTABLE_INSTALLS: false
run: jlpm install

- name: Set up browser cache
Expand Down Expand Up @@ -100,16 +101,17 @@ jobs:
working-directory: myextension
run: |
set -eux
python -m pip install -v .
YARN_ENABLE_IMMUTABLE_INSTALLS=false python -m pip install -v .
- name: List extensions
run: |
jupyter labextension list
- name: Install dependencies
- name: Install UI tests dependencies
working-directory: myextension/ui-tests
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
YARN_ENABLE_IMMUTABLE_INSTALLS: false
run: jlpm install

- name: Set up browser cache
Expand Down
18 changes: 12 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
python -m copier copy -l -d author_name="My Name" -d labextension_name="${NAME}" -d python_name="${PYNAME}" -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . ${NAME}
pushd ${NAME}
python -m pip install "jupyterlab>=4.0.0,<5"
jlpm
YARN_ENABLE_IMMUTABLE_INSTALLS=false jlpm
jlpm lint:check
python -m pip install -e .
jupyter labextension develop . --overwrite
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
python -m copier copy -l -d author_name="My Name" -d test=n -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . myextension
pushd myextension
pip install "jupyterlab>=4.0.0,<5"
jlpm
YARN_ENABLE_IMMUTABLE_INSTALLS=false jlpm
jlpm lint:check
pip install -e .
jupyter labextension develop . --overwrite
Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:
python -m copier copy -l -d author_name="My Name" -d has_settings=y -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . myextension
pushd myextension
pip install "jupyterlab>=4.0.0,<5"
jlpm
YARN_ENABLE_IMMUTABLE_INSTALLS=false jlpm
# It is not easily possible to get this version compatible with linter rules
jlpm lint
jlpm lint:check
Expand Down Expand Up @@ -178,6 +178,8 @@ jobs:
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Create server extension pip install
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
run: |
mkdir myextension
python -m copier copy -l -d kind=server -d author_name="My Name" -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . myextension
Expand All @@ -204,6 +206,8 @@ jobs:
shell: bash

- name: Create server extension pip develop
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
run: |
mkdir myextension
python -m copier copy -l -d kind=server -d author_name="My Name" -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . myextension
Expand Down Expand Up @@ -242,6 +246,8 @@ jobs:
shell: bash
- name: Install server extension from a tarball
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
run: |
mkdir myextension
python -m copier copy -l -d kind=server -d author_name="My Name" -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . myextension
Expand Down Expand Up @@ -348,7 +354,7 @@ jobs:
python -m copier copy -l -d kind=theme -d author_name="My Name" -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . mytheme
pushd mytheme
python -m pip install "jupyterlab>=4.0.0,<5"
jlpm
YARN_ENABLE_IMMUTABLE_INSTALLS=false jlpm
jlpm lint:check
python -m pip install -e .
jupyter labextension develop . --overwrite
Expand Down Expand Up @@ -392,7 +398,7 @@ jobs:
python -m copier copy -l -d kind=mimerenderer -d viewer_name="My Viewer" -d mimetype="application/vnd.my_org.my_type" -d mimetype_name="my_type" -d file_extension=".my_type" -d author_name="My Name" -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . myextension
pushd myextension
python -m pip install "jupyterlab>=4.0.0,<5"
jlpm
YARN_ENABLE_IMMUTABLE_INSTALLS=false jlpm
jlpm lint:check
python -m pip install -e .
jupyter labextension develop . --overwrite
Expand Down Expand Up @@ -438,7 +444,7 @@ jobs:
pushd myextension
sed -i 's/^\(nodeLinker:\s\).*$/\1pnpm/' .yarnrc.yml
python -m pip install "jupyterlab>=4.0.0,<5"
jlpm
YARN_ENABLE_IMMUTABLE_INSTALLS=false jlpm
if [ ! -d node_modules/.store ] ; then echo 'nodes_module directory should contain a .store directory when using pnpm nodeLinker'; exit 1; fi;
jlpm build
popd
Expand Down
2 changes: 0 additions & 2 deletions template/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
enableImmutableInstalls: false

nodeLinker: node-modules
4 changes: 2 additions & 2 deletions template/{% if test %}ui-tests{% endif %}/package.json.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"test:update": "jlpm playwright test --update-snapshots"
},
"devDependencies": {
"@jupyterlab/galata": "^5.0.0",
"@playwright/test": "^1.32.0"
"@jupyterlab/galata": "^5.0.5",
"@playwright/test": "^1.37.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ test('should emit an activation console message', async ({ page }) => {

await page.getByRole('button', { name: 'Rename' }).click();

// Close file opened as editor
await page.activity.closePanel('test.my_type');

await page.filebrowser.open(filename);

const view = page.getByRole('main').locator('.mimerenderer-{{ mimetype_name }}');
Expand Down

0 comments on commit e7e4c2b

Please sign in to comment.