Skip to content

Commit cdee4d1

Browse files
committed
Restore and check setup.cfg integrity
1 parent 495bc5c commit cdee4d1

File tree

2 files changed

+28
-7
lines changed

2 files changed

+28
-7
lines changed

python_packages/jupyterlab_lsp/setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ zip_safe = False
2929
python_requires = >=3.6
3030

3131
install_requires =
32-
jupyter_lsp >=1.0.0
33-
jupyterlab >=3.0.0, <4.0.0
32+
jupyter_lsp >=1.0.0rc0
33+
jupyterlab >=3.0.0,<4.0.0a0

scripts/integrity.py

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import pathlib
99
import sys
1010
import tempfile
11+
from configparser import ConfigParser
1112
from importlib.util import find_spec
1213

1314
import jsonschema
@@ -28,7 +29,8 @@
2829
if 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

3436
REQS = ROOT / "requirements"
@@ -58,6 +60,10 @@
5860
JS_CJS_NAME = f"{NPM_NS}/code-jumpers"
5961
JS_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
6268
PY_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+
212233
def check_integrity():
213234
"""actually run the tests"""
214235
args = ["-vv", __file__]

0 commit comments

Comments
 (0)