Skip to content

Commit 6ba6c0e

Browse files
authored
Move jupyterlab-chat-extension to packages directory (#196)
* Move jupyterlab-chat-extension in package and use a python script for dev install * Do not add licence in version file * Fix dev installation dependencies
1 parent c128e0b commit 6ba6c0e

File tree

24 files changed

+75
-60
lines changed

24 files changed

+75
-60
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
- name: Build the extensions
6666
run: |
6767
set -eux
68-
./scripts/dev_install.sh
68+
python ./scripts/dev_install.py
6969
pytest -vv -r ap --cov
7070
7171
build_extension:
@@ -113,7 +113,7 @@ jobs:
113113
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
114114

115115
- name: Install extension dependencies and build the extension
116-
run: ./scripts/dev_install.sh
116+
run: python ./scripts/dev_install.py
117117

118118
- name: Run mypy
119119
run: |

.github/workflows/ui-tests.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ jobs:
2828
- name: Install the extension
2929
run: |
3030
set -eux
31-
python -m pip install "jupyterlab>=4.0.0,<5"
32-
./scripts/dev_install.sh
31+
python ./scripts/dev_install.py
3332
3433
- name: Install tests dependencies
3534
working-directory: ui-tests
@@ -81,7 +80,7 @@ jobs:
8180
run: |
8281
set -eux
8382
python -m pip install "notebook>=7.0.0,<8"
84-
./scripts/dev_install.sh
83+
python ./scripts/dev_install.py
8584
8685
- name: Install dependencies
8786
working-directory: ui-tests

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
run: python -m pip install -U "jupyterlab>=4.0.0,<5"
7272

7373
- name: Install extension
74-
run: ./scripts/dev_install.sh
74+
run: python ./scripts/dev_install.py
7575

7676
- uses: jupyterlab/maintainer-tools/.github/actions/update-snapshots@v1
7777
with:

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ node_modules/
1111
labextension
1212

1313
# Version file is handled by hatchling
14-
python/**/_version.py
1514
docs/**/_version.py
1615

1716
# jest test reports

.licenserc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@ header:
2525
- 'coverage'
2626
- 'LICENSE'
2727
- 'yarn.lock'
28+
- '**/_version.py'
2829

2930
comment: on-failure

docs/source/developers/contributing/jupyterlab-chat-extension.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ The following commands install the extension in development mode:
1717

1818
```bash
1919
# Install the extension
20-
./scripts/dev_install.sh
21-
22-
# Symlink the assets
23-
jupyter labextension develop --overwrite python/jupyterlab-chat
20+
python ./scripts/dev_install.py
2421
```
2522

2623
To uninstall it, run:
@@ -31,8 +28,8 @@ pip uninstall jupyterlab-chat
3128

3229
## Building the assets
3330

34-
Changes in typescript sources of `@jupyter/chat` or `jupyterlab-chat` must
35-
be built again to be available in the jupyterlab.
31+
Changes in typescript sources of `@jupyter/chat`, `jupyterlab-chat` or
32+
`jupyterlab-chat-extension` must be built again to be available in jupyterlab.
3633

3734
```bash
3835
jlpm build

package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
},
2424
"workspaces": [
2525
"packages/*",
26-
"python/jupyterlab-chat",
2726
"docs/jupyter-chat-example"
2827
],
2928
"scripts": {
@@ -34,17 +33,17 @@
3433
"clean": "lerna run clean",
3534
"clean:all": "lerna run clean:all",
3635
"dev": "jupyter lab --config playground/config.py",
37-
"dev-install": "jlpm build && lerna run dev-install",
3836
"eslint": "eslint . --ext .ts,.tsx --cache --fix",
3937
"eslint:check": "eslint . --ext .ts,.tsx",
40-
"prettier": "prettier --write \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md,.yml}\"",
41-
"prettier:check": "prettier --list-different \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md,.yml}\"",
38+
"install:extension": "lerna run install:extension",
4239
"lint:check": "jlpm run prettier:check && jlpm run eslint:check",
4340
"lint": "jlpm run prettier && jlpm run eslint && jlpm stylelint",
41+
"prettier": "prettier --write \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md,.yml}\"",
42+
"prettier:check": "prettier --list-different \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md,.yml}\"",
4443
"stylelint": "jlpm stylelint:check --fix",
4544
"stylelint:check": "stylelint --cache \"**/style/**/*.css\"",
46-
"watch": "lerna run watch --parallel --stream",
47-
"test": "lerna run test"
45+
"test": "lerna run test",
46+
"watch": "lerna run watch --parallel --stream"
4847
},
4948
"devDependencies": {
5049
"@stylistic/eslint-plugin": "^3.0.1",

python/jupyterlab-chat/package.json renamed to packages/jupyterlab-chat-extension/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
"clean:lintcache": "rimraf .eslintcache .stylelintcache",
4242
"clean:labextension": "rimraf jupyterlab_chat/labextension jupyterlab_chat/_version.py",
4343
"clean:all": "jlpm clean:lib && jlpm clean:labextension && jlpm clean:lintcache",
44-
"dev-install": "pip install -e \".[test]\" && jupyter labextension develop . --overwrite",
4544
"install:extension": "jlpm build",
4645
"watch": "run-p watch:src watch:labextension",
4746
"watch:src": "tsc -w --sourceMap",
@@ -106,7 +105,7 @@
106105
}
107106
},
108107
"extension": true,
109-
"outputDir": "jupyterlab_chat/labextension",
108+
"outputDir": "../../python/jupyterlab-chat/jupyterlab_chat/labextension",
110109
"schemaDir": "schema",
111110
"sharedPackages": {
112111
"@jupyter/chat": {

0 commit comments

Comments
 (0)