Skip to content

Commit

Permalink
Add support for JupyterLab 4.x (#34)
Browse files Browse the repository at this point in the history
Co-authored-by: Michał Krassowski <[email protected]>
  • Loading branch information
isumitjha and krassowski authored Mar 5, 2024
1 parent 072b219 commit 9f72cd9
Show file tree
Hide file tree
Showing 12 changed files with 12,876 additions and 9,027 deletions.
34 changes: 16 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: 'Install dependencies 📦'
run: python -m pip install -U "jupyterlab<4"
run: python -m pip install -U jupyterlab>4

- name: 'Lint the extension 🧹'
run: |
Expand Down Expand Up @@ -85,9 +85,7 @@ jobs:
sudo rm -rf $(which node)
sudo rm -rf $(which node)
pip install "jupyterlab<4" jupyterlab_conda_store*.whl
pip install "jupyterlab>4" jupyterlab_conda_store*.whl
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "jupyterlab-conda-store.*OK"
python -m jupyterlab.browser_check --no-chrome-test
Expand Down Expand Up @@ -115,7 +113,7 @@ jobs:
- name: 'Install the extension'
run: |
set -eux
python -m pip install "jupyterlab~=3.1" jupyterlab_conda_store*.whl
python -m pip install "jupyterlab>4" jupyterlab_conda_store*.whl
- name: 'Install dependencies'
working-directory: ui-tests
Expand All @@ -134,16 +132,16 @@ jobs:
run: jlpm playwright install chromium
working-directory: ui-tests

# - name: Execute integration tests
# working-directory: ui-tests
# run: |
# jlpm playwright test

# - name: Upload Playwright Test report
# if: always()
# uses: actions/upload-artifact@v2
# with:
# name: jupyterlab_conda_store-playwright-tests
# path: |
# ui-tests/test-results
# ui-tests/playwright-report
- name: Execute integration tests
working-directory: ui-tests
run: |
jlpm playwright test
- name: Upload Playwright Test report
if: always()
uses: actions/upload-artifact@v2
with:
name: jupyterlab_conda_store-playwright-tests
path: |
ui-tests/test-results
ui-tests/playwright-report
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: 'Install dependencies 📦'
run: python -m pip install -U "jupyterlab<4"
run: python -m pip install -U "jupyterlab>=4"

- name: 'Lint the extension 🧹'
run: |
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ dmypy.json
# vim stuff
*.swp

# frontend stuff
.yarn/
# eslint cache
.eslintcache
# stylelint cache
.stylelintcache
.stylelintcache
2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
enableImmutableInstalls: true
nodeLinker: node-modules
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
A JupyterLab extension for [conda-store][conda-store-repo].

> [!NOTE]
> Currently, this extension is only compatible with JupyterLab `>= 3.0 <= 4.0`.
> This extension is only compatible with JupyterLab `>= 4.0`.
## Installation 📦

### Pre-requisites

You will need to have [conda-store][conda-store-repo] installed and running on your local computer to use this extension. As well as:

- `JupyterLab >= 3.0 <= 4.0`
- `JupyterLab >= 4.0`
- Python `>= 3.8`

You can install the extension with pip:
Expand Down Expand Up @@ -76,7 +76,7 @@ pip uninstall jupyterlab-conda-store

```bash
# Install node and jupyterlab from conda-forge
conda install -c conda-forge 'nodejs>16' 'jupyterlab<4'
conda install -c conda-forge 'nodejs>16' 'jupyterlab>=4'
```

5. Install the package in development mode:
Expand Down
55 changes: 29 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
"type": "git",
"url": "https://github.com/telamonian/jupyterlab-conda-store.git"
},
"workspaces": [
"ui-tests"
],
"scripts": {
"build": "jlpm build:lib && jlpm build:labextension:dev",
"build:prod": "jlpm clean && jlpm build:lib && jlpm build:labextension",
Expand Down Expand Up @@ -58,39 +61,39 @@
},
"dependencies": {
"@conda-store/conda-store-ui": "2024.1.1",
"@jupyterlab/application": "^3.1.0",
"@jupyterlab/apputils": "^3.1.0",
"@jupyterlab/mainmenu": "^3.1.0",
"@jupyterlab/settingregistry": "^3.1.0",
"@jupyterlab/ui-components": "^3.1.0",
"@lumino/widgets": "^1.37.1",
"react": "^17.0.1",
"react-dom": "^17.0.1"
"@jupyterlab/application": "^4.0.9",
"@jupyterlab/apputils": "^4.1.2",
"@jupyterlab/mainmenu": "^4.0.9",
"@jupyterlab/settingregistry": "^4.0.9",
"@jupyterlab/ui-components": "^4.0.9",
"@lumino/widgets": "^2.3.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@jupyterlab/builder": "^3.0.0 || ^4.0.0",
"@jupyterlab/testutils": "^3.0.0 || ^4.0.0",
"@jupyterlab/builder": "^4.0.0",
"@jupyterlab/testutils": "^4.0.0",
"@types/jest": "^26.0.0",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"@typescript-eslint/eslint-plugin": "^4.8.1",
"@typescript-eslint/parser": "^4.8.1",
"eslint": "^7.14.0",
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-prettier": "^3.1.4",
"jest": "^26.4.2",
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.0",
"@typescript-eslint/eslint-plugin": "~6.13.2",
"@typescript-eslint/parser": "~6.13.2",
"eslint": "~8.55.0",
"eslint-config-prettier": "~9.1.0",
"eslint-plugin-prettier": "~5.0.1",
"jest": "^29.2.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.1.1",
"prettier": "~3.0.0",
"rimraf": "^3.0.2",
"stylelint": "^14.3.0",
"stylelint": "^15.10.1",
"stylelint-config-prettier": "^9.0.3",
"stylelint-config-recommended": "^6.0.0",
"stylelint-config-standard": "~24.0.0",
"stylelint-prettier": "^2.0.0",
"ts-jest": "^26.3.0",
"typescript": "~4.7.3"
"stylelint-config-recommended": "^13.0.0",
"stylelint-config-standard": "^34.0.0",
"stylelint-prettier": "^4.0.0",
"ts-jest": "^29.1.1",
"typescript": "~5.0.2"
},
"sideEffects": [
"style/*.css",
Expand All @@ -108,7 +111,7 @@
"jupyter-releaser": {
"hooks": {
"before-build-npm": [
"python -m pip install jupyterlab~=3.1",
"python -m pip install jupyterlab>4",
"jlpm"
],
"before-build-python": [
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["hatchling", "jupyterlab<4", "hatch-nodejs-version"]
requires = ["hatchling", "jupyterlab>4", "hatch-nodejs-version"]
build-backend = "hatchling.build"

[project]
Expand All @@ -9,11 +9,11 @@ readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.8"
maintainers = [{ name = "Tania Allard", email = "[email protected]" }]
keywords = ["Jupyter", "JupyterLab", "JupyterLab3", "conda", "environments"]
keywords = ["Jupyter", "JupyterLab", "JupyterLab4", "conda", "environments"]
classifiers = [
"Framework :: Jupyter",
"Framework :: Jupyter :: JupyterLab",
"Framework :: Jupyter :: JupyterLab :: 3",
"Framework :: Jupyter :: JupyterLab :: 4",
"Framework :: Jupyter :: JupyterLab :: Extensions",
"Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt",
"License :: OSI Approved :: BSD License",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ async function activate(
command,
args: {}
});
mainMenu.addMenu(condaStoreMenu, { rank: 1000 });
mainMenu.addMenu(condaStoreMenu, true, { rank: 1000 });
} else {
mainMenu.settingsMenu.addGroup([{ command }], 900);
}
Expand Down
14 changes: 2 additions & 12 deletions ui-tests/jupyter_server_test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,7 @@
opens the server to the world and provide access to JupyterLab
JavaScript objects through the global window variable.
"""
from tempfile import mkdtemp

c.ServerApp.port = 8888
c.ServerApp.port_retries = 0
c.ServerApp.open_browser = False
from jupyterlab.galata import configure_jupyter_server

c.ServerApp.root_dir = mkdtemp(prefix='galata-test-')
c.ServerApp.token = ""
c.ServerApp.password = ""
c.ServerApp.disable_check_xsrf = True
c.LabApp.expose_app_in_browser = True

# Uncomment to set server log level to debug level
# c.ServerApp.log_level = "DEBUG"
configure_jupyter_server(c)
3 changes: 2 additions & 1 deletion ui-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"test": "jlpm playwright test"
},
"devDependencies": {
"@jupyterlab/galata": "^4.3.0"
"@jupyterlab/galata": "^5.0.9",
"@playwright/test": "^1.32.0"
}
}
4 changes: 1 addition & 3 deletions ui-tests/tests/jupyterlab_conda_store.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ test('should emit an activation console message', async ({ page }) => {
await page.goto();

expect(
logs.filter(
s => s === 'JupyterLab extension jupyterlab-conda-store is activated!'
)
logs.filter(s => s === 'JupyterLab extension conda-store is activated!')
).toHaveLength(1);
});
Loading

0 comments on commit 9f72cd9

Please sign in to comment.