Skip to content

Commit 50edea7

Browse files
committed
Refactor version management and integrity testing
1 parent f0d73a7 commit 50edea7

File tree

9 files changed

+26
-25
lines changed

9 files changed

+26
-25
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Open it searching for "Show diagnostics panel" in JupyterLab commands palette or
7676

7777
Either:
7878

79-
- JupyterLab >=2.1,<3.0.0a0
79+
- JupyterLab >=2.1.0,<3.0.0a0
8080

8181
And:
8282

binder/environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ channels:
77
dependencies:
88
# runtime dependencies
99
- python >=3.7,<3.8.0a0
10-
- jupyterlab >=2,<3.0.0a0
10+
- jupyterlab >=2.1.0,<3.0.0a0
1111
- notebook >=4.3.1
1212
# build dependencies
1313
- nodejs >=10,<14

ci/job.test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ parameters:
1212
pythons:
1313
- name: ThreeSix
1414
spec: '=3.6'
15-
lab: '>=2,<3.0.0a0'
15+
lab: '>=2.1.0,<3.0.0a0'
1616
nodejs: '>=10,<11.0.0.a0'
1717
- name: ThreeSeven
1818
spec: '=3.7'
19-
lab: '>=2,<3.0.0a0'
19+
lab: '>=2.1.0,<3.0.0a0'
2020
nodejs: '>=12,<13.0.0a0'
2121
- name: ThreeEight
2222
spec: '=3.8'
23-
lab: '>=2,<3.0.0a0'
23+
lab: '>=2.1.0,<3.0.0a0'
2424
nodejs: '>=13,<14.0.0a0'
2525
js_cov_packages:
2626
- jupyterlab-go-to-definition

docs/Installation.ipynb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
"outputs": [],
1010
"source": [
1111
"from markdown import markdown\n",
12+
"import sys\n",
13+
"sys.path.insert(0, '..')\n",
1214
"from versions import (\n",
1315
" JUPYTER_LSP_VERSION,\n",
1416
" JUPYTERLAB_LSP_VERSION,\n",

docs/Releasing.ipynb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"\n",
5050
"- `packages/jupyterlab-lsp/package.json` > `devDependencies` >\n",
5151
" `@jupyterlab/application` (canonical)\n",
52+
"- `binder/environment.yml`\n",
5253
"- `README.md`\n",
5354
"\n",
5455
"### Releasing:\n",

docs/__init__.py

Whitespace-only changes.

requirements/lab.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# the version of jupyterlab
22
-r ./prod.txt
3-
jupyterlab >=2.1,<3.0.0a0
3+
jupyterlab >=2.1.0,<3.0.0a0

scripts/integrity.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
import json
88
import pathlib
9-
import re
109
import sys
1110
import tempfile
1211
from importlib.util import find_spec
@@ -22,21 +21,21 @@
2221
import ruamel_yaml as yaml
2322

2423
ROOT = pathlib.Path.cwd()
24+
25+
sys.path.insert(0, str(ROOT))
26+
27+
from versions import ( # noqa
28+
REQUIRED_JUPYTERLAB as LAB_SPEC,
29+
JUPYTER_LSP_VERSION as PY_VERSION
30+
)
31+
2532
REQS = ROOT / "requirements"
2633
BINDER = ROOT / "binder"
2734

2835
# docs
2936
MAIN_README = ROOT / "README.md"
3037
CHANGELOG = ROOT / "CHANGELOG.md"
3138

32-
# dependencies
33-
ENV = yaml.safe_load((BINDER / "environment.yml").read_text())
34-
LAB_SPEC = [
35-
d.split(" ", 1)[1]
36-
for d in ENV["dependencies"]
37-
if isinstance(d, str) and d.startswith("jupyterlab ")
38-
][0]
39-
4039
# TS stuff
4140
NPM_NS = "@krassowski"
4241
PACKAGES = {
@@ -57,8 +56,7 @@
5756

5857
# py stuff
5958
PY_NAME = "jupyter-lsp"
60-
_VERSION_PY = ROOT / "py_src" / "jupyter_lsp" / "_version.py"
61-
PY_VERSION = re.findall(r'= "(.*)"$', (_VERSION_PY).read_text())[0]
59+
6260

6361
# CI stuff
6462
PIPE_FILE = ROOT / "azure-pipelines.yml"
@@ -147,7 +145,7 @@ def test_ts_package_integrity(name, info, the_meta_package):
147145

148146

149147
@pytest.mark.parametrize(
150-
"path", map(str, [REQS / "lab.txt", CI / "job.test.yml", MAIN_README])
148+
"path", map(str, [REQS / "lab.txt", CI / "job.test.yml", MAIN_README, BINDER / "environment.yml"])
151149
)
152150
def test_jlab_versions(path):
153151
""" is the version of jupyterlab consistent?
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import json
2-
from sys import path
2+
from pathlib import Path
3+
from re import findall
34

4-
path.insert(0, '../py_src/jupyter_lsp')
5+
ROOT = Path(__file__).resolve().parent
56

6-
import _version # noqa
77

8+
_VERSION_PY = ROOT / "py_src" / "jupyter_lsp" / "_version.py"
9+
JUPYTER_LSP_VERSION = findall(r'= "(.*)"$', (_VERSION_PY).read_text())[0]
810

9-
JUPYTER_LSP_VERSION = _version.__version__
10-
11-
with open('../packages/jupyterlab-lsp/package.json') as f:
11+
with open(ROOT / "packages/jupyterlab-lsp/package.json") as f:
1212
jupyterlab_lsp_package = json.load(f)
1313

1414
JUPYTERLAB_LSP_VERSION = jupyterlab_lsp_package['version']
@@ -19,4 +19,4 @@
1919
.lstrip('~^')
2020
)
2121
JUPYTERLAB_NEXT_MAJOR_VERSION = int(JUPYTERLAB_VERSION.split('.')[0]) + 1
22-
REQUIRED_JUPYTERLAB = f'>={JUPYTERLAB_VERSION},<{JUPYTERLAB_NEXT_MAJOR_VERSION}'
22+
REQUIRED_JUPYTERLAB = f'>={JUPYTERLAB_VERSION},<{JUPYTERLAB_NEXT_MAJOR_VERSION}.0.0a0'

0 commit comments

Comments
 (0)