8
8
import pathlib
9
9
import sys
10
10
import tempfile
11
+ from configparser import ConfigParser
11
12
from importlib .util import find_spec
12
13
13
14
import jsonschema
28
29
if True :
29
30
# a workaround for isort 4.0 limitations
30
31
# see https://github.com/timothycrosley/isort/issues/468
31
- from versions import JUPYTER_LSP_VERSION as PY_VERSION
32
+ from versions import JUPYTER_LSP_VERSION as PY_SERVER_VERSION
33
+ from versions import REQUIRED_JUPYTER_SERVER # noqa
32
34
from versions import REQUIRED_JUPYTERLAB as LAB_SPEC # noqa
33
35
34
36
REQS = ROOT / "requirements"
58
60
JS_CJS_NAME = f"{ NPM_NS } /code-jumpers"
59
61
JS_CJS_VERSION = PACKAGES [JS_CJS_NAME ][1 ]["version" ]
60
62
63
+ PY_PATH = ROOT / "python_packages"
64
+ PY_SERVER_PATH = PY_PATH / "jupyter_lsp"
65
+ PY_FRONT_PATH = PY_PATH / "jupyterlab_lsp"
66
+
61
67
# py stuff
62
68
PY_NAME = "jupyter-lsp"
63
69
@@ -161,7 +167,7 @@ def test_jlab_versions(path):
161
167
@pytest .mark .parametrize (
162
168
"pkg,version" ,
163
169
[
164
- [PY_NAME , Version (PY_VERSION ).base_version ],
170
+ [PY_NAME , Version (PY_SERVER_VERSION ).base_version ],
165
171
[JS_LSP_NAME , JS_LSP_VERSION ],
166
172
[JS_CJS_NAME , JS_CJS_VERSION ],
167
173
],
@@ -174,9 +180,9 @@ def test_changelog_versions(pkg, version):
174
180
@pytest .mark .parametrize (
175
181
"pkg,sep,version,expected" ,
176
182
[
177
- [PY_NAME , "=" , PY_VERSION , 2 ],
178
- [PY_NAME , "==" , PY_VERSION , 1 ],
179
- [PY_NAME + "-python" , "=" , PY_VERSION , 1 ],
183
+ [PY_NAME , "=" , PY_SERVER_VERSION , 2 ],
184
+ [PY_NAME , "==" , PY_SERVER_VERSION , 1 ],
185
+ [PY_NAME + "-python" , "=" , PY_SERVER_VERSION , 1 ],
180
186
[JS_LSP_NAME , "@" , JS_LSP_VERSION , 4 ],
181
187
],
182
188
)
@@ -209,6 +215,21 @@ def test_contributing_versions(the_contributing_doc, the_binder_env, pkg):
209
215
assert spec in the_contributing_doc
210
216
211
217
218
+ @pytest .mark .parametrize (
219
+ "pkg,requirement,spec" ,
220
+ [
221
+ [PY_FRONT_PATH , "jupyter_lsp" , f">={ PY_SERVER_VERSION } " ],
222
+ [PY_FRONT_PATH , "jupyterlab" , LAB_SPEC ],
223
+ [PY_SERVER_PATH , "jupyter_server" , REQUIRED_JUPYTER_SERVER ],
224
+ ],
225
+ )
226
+ def test_install_requires (pkg , requirement , spec ):
227
+ """are python packages requirements consistent with other versions?"""
228
+ config = ConfigParser ()
229
+ config .read (pkg / "setup.cfg" )
230
+ assert f"{ requirement } { spec } " in config ["options" ]["install_requires" ]
231
+
232
+
212
233
def check_integrity ():
213
234
"""actually run the tests"""
214
235
args = ["-vv" , __file__ ]
0 commit comments