Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for JupyterLab 4.x #34

Merged
merged 27 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4471a65
upgrade to jupyterlab 4 and fix tests
isumitjha Dec 27, 2023
1a42151
update yarn.lock
isumitjha Dec 27, 2023
417731a
upgrade version in CI
isumitjha Dec 27, 2023
0f8c48b
run ci on branch
isumitjha Dec 27, 2023
d8b41cc
fix ci
isumitjha Dec 27, 2023
707e029
bump jlab in ci
isumitjha Dec 27, 2023
fd04aae
add .yarnrc.yml and .yarn to .gitignore
isumitjha Dec 27, 2023
8992d9e
make ts pretty
isumitjha Dec 27, 2023
0dfeb63
upgrade packages in package.json
isumitjha Dec 27, 2023
9d3ca18
bump version in package.json
isumitjha Dec 27, 2023
82571d7
bump jlab in pyproject
isumitjha Dec 27, 2023
0d852c8
temp
isumitjha Dec 27, 2023
d99782c
Merge branch 'conda-incubator:main' into jlab4
isumitjha Jan 2, 2024
33115b4
update dependencies and lock file
isumitjha Jan 2, 2024
4f5237c
fix usage for mainmenu
isumitjha Jan 2, 2024
e0eea6f
remove tmate
isumitjha Jan 2, 2024
950047a
Fix jest dependencies
isumitjha Jan 2, 2024
bcad71d
undo ci change to run on fork
isumitjha Jan 2, 2024
e8a69a4
update README to include jupyterlab 4
isumitjha Jan 2, 2024
67eb1c4
Merge branch 'main' into jlab4
isumitjha Mar 3, 2024
74b3415
Apply suggestions from code review
isumitjha Mar 3, 2024
c90c49b
update lock file and dont pin jlab
isumitjha Mar 3, 2024
f108158
unpin jlab4
isumitjha Mar 3, 2024
493f4a2
update readme to include support for jlab>=4
isumitjha Mar 3, 2024
37ae52b
unpin in workflows
isumitjha Mar 3, 2024
3bde3e2
unpin from package.json
isumitjha Mar 3, 2024
c858388
bump react to 18
isumitjha Mar 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To maintainers: after releasing a new version I would update this to say something like "Version YYYY.MM.X+ is only compatible with JupyterLab `>= 4.0, use version YYYY.MM.Y for older JupyterLab".


## 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",
isumitjha marked this conversation as resolved.
Show resolved Hide resolved
"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
Loading