Skip to content

Commit b60d765

Browse files
bollwyvlkrassowski
authored andcommitted
add lerna, metapackage, integrity checks, and move src (76 1️⃣ ) (#79)
* move src into packages * move more package things * finish rest of moving to packages * update ci to look for test artifacts * modify strategy for provisioning lab in ci, binder * move lint check up, call test correctly * chomp whitespace on azure variables * use prettier check instead of list different * add integrity script, add to separate job with linting * give lint a uniue name * check integrity of schema * check schemas in integrity, linting * add ruamel_yaml to test env * remove integrity from main test job * rename integrity tests * add ruamel.yaml for pip * linting * check lab versions * catch readme version issue
1 parent 99da868 commit b60d765

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+3403
-226
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ venv.bak/
107107
node_modules
108108
.yarn-packages
109109
*.tsbuildinfo
110+
*.tgz
110111

111112
atest/output/
112113
junit.xml

Diff for: README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ If a feature you need is not on the lists above, please feel free to suggest it
6464

6565
## Prerequisites
6666

67-
- JupyterLab
67+
- JupyterLab >=1.1,<1.2
6868

6969
## Installation
7070

@@ -120,7 +120,7 @@ jupyter labextension update @krassowski/jupyterlab-lsp
120120
Use install command (update does not seem to work) appending `@version` to the extension name, like this:
121121

122122
```bash
123-
jupyter labextension install @krassowski/jupyterlab-lsp@0.5.0-rc.0
123+
jupyter labextension install @krassowski/jupyterlab-lsp@0.6.0
124124
```
125125

126126
## Development
@@ -131,10 +131,10 @@ run the following in the repository directory:
131131
```bash
132132
jlpm
133133
jlpm build
134-
jupyter labextension install .
134+
jlpm lab:link
135135
```
136136

137-
To rebuild the package and the JupyterLab app:
137+
To rebuild the packages and the JupyterLab app:
138138

139139
```bash
140140
jlpm build
@@ -144,7 +144,7 @@ jupyter lab build
144144
To watch the files and build continuously:
145145

146146
```bash
147-
jlpm watch # leave this running...
147+
jlpm build --watch # leave this running...
148148
jupyter lab --watch # ...in another terminal
149149
```
150150

Diff for: atest/01_Editor.robot

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ${CM CURSORS} css:.CodeMirror-cursors:not([style='visibility: hidden'])
1111

1212
*** Test Cases ***
1313
Bash
14-
[Documentation] TODO: figure out why the first server is extra flaky
14+
[Documentation] TODO: figure out why the first server is extra flaky
1515
Wait Until Keyword Succeeds 3x 10s Editor Shows Features for Language Bash example.sh Diagnostics=Failed to parse expression
1616
... Jump to Definition=fib
1717

Diff for: azure-pipelines.yml

+8
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,17 @@ pr:
1111
variables:
1212
PYTHONUNBUFFERED: 1
1313
YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
14+
1415
PY_JLSP_VERSION: 0.6.0b0
1516
JS_JLLSP_VERSION: 0.6.0
1617

18+
FIRST_PARTY_LABEXTENSIONS: >-
19+
packages/jupyterlab-lsp/krassowski-jupyterlab-lsp-$(JS_JLLSP_VERSION).tgz
20+
21+
THIRD_PARTY_LABEXTENSIONS: >-
22+
@krassowski/jupyterlab_go_to_definition
23+
1724
jobs:
25+
- template: ci/job.lint.yml
1826
- template: ci/job.test.yml
1927
- template: ci/job.combine.yml

Diff for: ci/env-test.yml.in

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ dependencies:
2424
- pytest-cov
2525
- pytest-flake8
2626
- pytest-runner
27+
- ruamel_yaml
2728
# browser testing
2829
- robotframework-seleniumlibrary
2930
- firefox

Diff for: ci/job.lint.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
parameters:
2+
platforms:
3+
- name: Linux
4+
vmImage: ubuntu-16.04
5+
activate: source activate
6+
pythons:
7+
- name: ThreeSeven
8+
spec: '>=3.7,<3.8.0a0'
9+
env_update: conda env update -n jupyterlab-lsp --file env-test.yml --quiet
10+
11+
jobs:
12+
- ${{ each platform in parameters.platforms }}:
13+
- ${{ each python in parameters.pythons}}:
14+
- job: Lint
15+
pool:
16+
vmImage: ${{ platform.vmImage }}
17+
steps:
18+
- template: steps.conda.yml
19+
parameters:
20+
name: ${{ platform.name }}
21+
22+
- script: ${{ platform.activate }} && cd ci && python env_template.py "${{ python.spec }}"
23+
displayName: update environment with python version
24+
25+
- script: ${{ parameters.env_update }} || ${{ parameters.env_update }} || ${{ parameters.env_update }}
26+
displayName: update conda environment with test dependencies
27+
28+
- script: ${{ platform.activate }} jupyterlab-lsp && python scripts/integrity.py
29+
displayName: check integrity of package versions
30+
31+
- script: ${{ platform.activate }} jupyterlab-lsp && jlpm || jlpm || jlpm
32+
displayName: install npm dependencies
33+
34+
- script: ${{ platform.activate }} jupyterlab-lsp && jlpm lint:check
35+
displayName: lint frontend

Diff for: ci/job.test.yml

+10-7
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ parameters:
1515
- name: ThreeSeven
1616
spec: '>=3.7,<3.8.0a0'
1717
env_update: conda env update -n jupyterlab-lsp --file env-test.yml --quiet
18-
lab_build: jupyter labextension install krassowski-jupyterlab-lsp-$(JS_JLLSP_VERSION).tgz @krassowski/jupyterlab_go_to_definition
18+
lab_ext: jupyter labextension install --no-build $(THIRD_PARTY_LABEXTENSIONS) $(FIRST_PARTY_LABEXTENSIONS)
1919

2020
jobs:
2121
- ${{ each platform in parameters.platforms }}:
@@ -52,37 +52,40 @@ jobs:
5252
- script: ${{ platform.activate }} jupyterlab-lsp && python setup.py sdist bdist_wheel
5353
displayName: build python distributions
5454

55-
- script: ${{ platform.activate }} jupyterlab-lsp && cd dist && npm pack ..
56-
displayName: build npm bundle
55+
- script: ${{ platform.activate }} jupyterlab-lsp && jlpm lerna run bundle
56+
displayName: build npm bundles
5757

5858
- script: ${{ platform.activate }} jupyterlab-lsp && cd dist && python -m pip install jupyter_lsp-$(PY_JLSP_VERSION)-py3-none-any.whl --no-deps
5959
displayName: install python wheel
6060

61-
- script: ${{ platform.activate }} jupyterlab-lsp && jlpm tslint:check && jlpm test:jest
61+
- script: ${{ platform.activate }} jupyterlab-lsp && jlpm test
6262
displayName: run frontend unit tests
6363

6464
- task: PublishTestResults@2
6565
displayName: publish frontend test results
6666
inputs:
67-
testResultsFiles: junit.xml
67+
testResultsFiles: packages/**/junit.xml
6868
testRunTitle: 'Jest ${{ platform.name }}${{ python.name }}'
6969
mergeTestResults: true
7070
condition: always()
7171

7272
- task: PublishCodeCoverageResults@1
7373
inputs:
7474
codeCoverageTool: Cobertura
75-
summaryFileLocation: 'coverage/cobertura-coverage.xml'
75+
summaryFileLocation: 'packages/**/coverage/cobertura-coverage.xml'
7676

7777
- script: ${{ platform.activate }} jupyterlab-lsp && jupyter serverextension list
7878
displayName: list server extensions
7979

8080
- script: ${{ platform.activate }} jupyterlab-lsp && python scripts/utest.py --test-run-title="Pytest ${{ platform.name }}${{ python.name }}"
8181
displayName: run python tests
8282

83-
- script: ${{ platform.activate }} jupyterlab-lsp && cd dist && ${{ parameters.lab_build }} || ${{ parameters.lab_build }} || ${{ parameters.lab_build }}
83+
- script: ${{ platform.activate }} jupyterlab-lsp && ${{ parameters.lab_ext }} || ${{ parameters.lab_ext }} || ${{ parameters.lab_ext }}
8484
displayName: install labextensions
8585

86+
- script: ${{ platform.activate }} jupyterlab-lsp && jupyter lab build || jupyter lab build --debug || jupyter lab build --debug
87+
displayName: build lab
88+
8689
- script: ${{ platform.activate }} jupyterlab-lsp && jupyter labextension list
8790
displayName: list labextensions
8891

Diff for: environment.yml

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ dependencies:
1818
- pip
1919
- pylint
2020
- python-language-server
21+
- ruamel_yaml
2122
- pip: # not-yet-appearing-in-conda-forge
2223
- pyls-black
2324
- pyls-isort

Diff for: lerna.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"lerna": "3.2.1",
3+
"version": "independent",
4+
"npmClient": "yarn",
5+
"useWorkspaces": true
6+
}

Diff for: package.json

+31-114
Original file line numberDiff line numberDiff line change
@@ -1,137 +1,54 @@
11
{
2-
"name": "@krassowski/jupyterlab-lsp",
3-
"version": "0.6.0",
4-
"description": "Language Server Protocol integration for JupyterLab",
5-
"keywords": [
6-
"jupyter",
7-
"jupyterlab",
8-
"jupyterlab-extension",
9-
"lsp",
10-
"language-server-protocol",
11-
"intellisense",
12-
"code-intelligence",
13-
"linting"
14-
],
15-
"homepage": "https://github.com/krassowski/jupyterlab-lsp",
16-
"husky": {
17-
"hooks": {
18-
"pre-commit": "precise-commits"
19-
}
20-
},
21-
"bugs": {
22-
"url": "https://github.com/krassowski/jupyterlab-lsp/issues"
23-
},
24-
"license": "BSD-3-Clause",
25-
"author": "Michał Krassowski",
26-
"files": [
27-
"lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}",
28-
"style/**/*.{css,eot,gif,html,jpg,json,png,svg,woff2,ttf}",
29-
"schema/*.json"
30-
],
31-
"main": "lib/index.js",
32-
"types": "lib/index.d.ts",
33-
"repository": {
34-
"type": "git",
35-
"url": "https://github.com/krassowski/jupyterlab-lsp.git"
36-
},
37-
"scripts": {
38-
"bootstrap": "jlpm && jlpm clean && jlpm lint && jlpm build",
39-
"build": "tsc -b",
40-
"clean": "rimraf lib",
41-
"watch": "tsc -b -w",
42-
"lint": "jlpm prettier && jlpm tslint",
43-
"lint:check": "jlpm prettier:check && jlpm tslint:check",
44-
"prettier": "prettier --write '**/*{.ts,.tsx,.js,.jsx,.css,.json,.md,.yml}'",
45-
"prettier:check": "prettier --list-different '**/*{.ts,.tsx,.js,.jsx,.css,.json,.md,.yml}'",
46-
"tslint": "tslint --fix -c tslint.json --project tsconfig.json '**/*{.ts,.tsx}'",
47-
"tslint:check": "tslint -c tslint.json --project tsconfig.json '**/*{.ts,.tsx}'",
48-
"test": "jlpm lint:check && jlpm test:jest",
49-
"test:jest": "jlpm jest --coverage --coverageReporters=cobertura --coverageReporters=html --coverageReporters=text-summary"
50-
},
512
"dependencies": {
52-
"@krassowski/jupyterlab_go_to_definition": "^0.7.1",
53-
"lsp-editor-adapter": "0.0.10"
543
},
554
"devDependencies": {
56-
"@babel/preset-env": "^7.4.3",
57-
"@jupyterlab/application": "~1.1.3",
58-
"@jupyterlab/apputils": "~1.1.3",
59-
"@jupyterlab/cells": "~1.1.3",
60-
"@jupyterlab/codeeditor": "~1.1.0",
61-
"@jupyterlab/codemirror": "~1.1.3",
62-
"@jupyterlab/completer": "~1.1.3",
63-
"@jupyterlab/coreutils": "~3.1.0",
64-
"@jupyterlab/docmanager": "~1.1.3",
65-
"@jupyterlab/docregistry": "~1.1.3",
66-
"@jupyterlab/fileeditor": "~1.1.3",
67-
"@jupyterlab/notebook": "~1.1.3",
68-
"@jupyterlab/rendermime": "~1.1.3",
69-
"@jupyterlab/services": "~4.1.1",
70-
"@jupyterlab/statusbar": "~1.1.3",
71-
"@jupyterlab/testutils": "^1.0.0-alpha.6",
72-
"@jupyterlab/tooltip": "~1.1.3",
73-
"@phosphor/algorithm": "^1.1.3",
74-
"@types/chai": "^4.1.7",
75-
"@types/codemirror": "^0.0.74",
76-
"@types/events": "^3.0.0",
77-
"@types/jest": "^23.3.11",
5+
"@types/mocha": "^5.2.6",
786
"bash-language-server": "^1.6.1",
79-
"chai": "^4.2.0",
80-
"codemirror": "~5.47.0",
817
"dockerfile-language-server-nodejs": "^0.0.21",
82-
"events": "^3.0.0",
8+
"eslint": "^5.16.0",
9+
"eslint-config-prettier": "^4.1.0",
10+
"eslint-plugin-prettier": "^3.0.1",
8311
"husky": "^3.0.9",
8412
"javascript-typescript-langserver": "^2.11.3",
85-
"jest": "^24.7.1",
86-
"jest-junit": "^8.0.0",
8713
"jsonrpc-ws-proxy": "0.0.5",
14+
"lerna": "^3.13.2",
8815
"precise-commits": "^1.0.2",
8916
"prettier": "^1.18.2",
90-
"react": "~16.8.4",
91-
"rimraf": "^2.6.1",
92-
"ts-jest": "^24.0.2",
93-
"tslint": "^5.15.0",
9417
"tslint-config-prettier": "^1.18.0",
9518
"tslint-plugin-prettier": "^2.0.1",
9619
"tslint-react": "^4.0.0",
20+
"tslint": "^5.15.0",
9721
"typescript": "~3.5.1",
9822
"unified-language-server": "^0.3.0",
9923
"vscode-css-languageserver-bin": "^1.4.0",
10024
"vscode-html-languageserver-bin": "^1.4.0",
10125
"vscode-json-languageserver-bin": "^1.0.1",
102-
"yaml-language-server": "^0.4.0"
26+
"yaml-language-server": "^0.4.0",
27+
"yarn": "1.15.2"
10328
},
104-
"peerDependencies": {
105-
"@jupyterlab/application": "~1.1.3",
106-
"@jupyterlab/apputils": "~1.1.3",
107-
"@jupyterlab/cells": "~1.1.3",
108-
"@jupyterlab/codeeditor": "~1.1.0",
109-
"@jupyterlab/codemirror": "~1.1.3",
110-
"@jupyterlab/completer": "~1.1.3",
111-
"@jupyterlab/coreutils": "~3.1.0",
112-
"@jupyterlab/docmanager": "~1.1.3",
113-
"@jupyterlab/docregistry": "~1.1.3",
114-
"@jupyterlab/fileeditor": "~1.1.3",
115-
"@jupyterlab/notebook": "~1.1.3",
116-
"@jupyterlab/rendermime": "~1.1.3",
117-
"@jupyterlab/services": "~4.1.1",
118-
"@jupyterlab/tooltip": "~1.1.3",
119-
"@phosphor/algorithm": "^1.1.3",
120-
"codemirror": "~5.47.0",
121-
"react": "~16.8.4"
29+
"husky": {
30+
"hooks": {
31+
"pre-commit": "precise-commits"
32+
}
33+
},
34+
"private": true,
35+
"scripts": {
36+
"bootstrap": "jlpm && lerna bootstrap && jlpm lint && jlpm clean && jlpm build",
37+
"build": "cd packages/metapackage && jlpm build",
38+
"bundle": "lerna run bundle",
39+
"clean": "lerna run clean",
40+
"lab:link": "lerna run lab:link",
41+
"lint:check": "jlpm prettier:check && jlpm tslint:check",
42+
"lint": "jlpm prettier && jlpm tslint",
43+
"prettier:check": "prettier --check '**/*{.ts,.tsx,.js,.jsx,.css,.json,.md,.yml}'",
44+
"prettier": "prettier --write '**/*{.ts,.tsx,.js,.jsx,.css,.json,.md,.yml}'",
45+
"test": "lerna run test",
46+
"tslint": "tslint --fix -c tslint.json --project tsconfigbase.json 'packages/**/*{.ts,.tsx}'",
47+
"tslint:check": "tslint -c tslint.json --project tsconfigbase.json 'packages/**/*{.ts,.tsx}'"
12248
},
123-
"jupyterlab": {
124-
"extension": true,
125-
"discovery": {
126-
"server": {
127-
"base": {
128-
"name": "jupyter-lsp"
129-
},
130-
"managers": [
131-
"pip"
132-
]
133-
}
134-
},
135-
"schemaDir": "schema"
49+
"workspaces": {
50+
"packages": [
51+
"packages/*"
52+
]
13653
}
13754
}

Diff for: packages/jupyterlab-lsp/LICENSE

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2018,
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
* Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)