88import pathlib
99import sys
1010import tempfile
11+ from configparser import ConfigParser
1112from importlib .util import find_spec
1213
1314import jsonschema
2829if True :
2930 # a workaround for isort 4.0 limitations
3031 # 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
3234 from versions import REQUIRED_JUPYTERLAB as LAB_SPEC # noqa
3335
3436REQS = ROOT / "requirements"
5860JS_CJS_NAME = f"{ NPM_NS } /code-jumpers"
5961JS_CJS_VERSION = PACKAGES [JS_CJS_NAME ][1 ]["version" ]
6062
63+ PY_PATH = ROOT / "python_packages"
64+ PY_SERVER_PATH = PY_PATH / "jupyter_lsp"
65+ PY_FRONT_PATH = PY_PATH / "jupyterlab_lsp"
66+
6167# py stuff
6268PY_NAME = "jupyter-lsp"
6369
@@ -161,7 +167,7 @@ def test_jlab_versions(path):
161167@pytest .mark .parametrize (
162168 "pkg,version" ,
163169 [
164- [PY_NAME , Version (PY_VERSION ).base_version ],
170+ [PY_NAME , Version (PY_SERVER_VERSION ).base_version ],
165171 [JS_LSP_NAME , JS_LSP_VERSION ],
166172 [JS_CJS_NAME , JS_CJS_VERSION ],
167173 ],
@@ -174,9 +180,9 @@ def test_changelog_versions(pkg, version):
174180@pytest .mark .parametrize (
175181 "pkg,sep,version,expected" ,
176182 [
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 ],
180186 [JS_LSP_NAME , "@" , JS_LSP_VERSION , 4 ],
181187 ],
182188)
@@ -209,6 +215,21 @@ def test_contributing_versions(the_contributing_doc, the_binder_env, pkg):
209215 assert spec in the_contributing_doc
210216
211217
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+
212233def check_integrity ():
213234 """actually run the tests"""
214235 args = ["-vv" , __file__ ]
0 commit comments