diff options
| author | Michał Górny <mgorny@gentoo.org> | 2026-09-16 15:41:26 +0200 |
|---|---|---|
| committer | Michał Górny <mgorny@gentoo.org> | 2026-09-16 15:41:26 +0200 |
| commit | 263c351da61c72a67d553123c850234435c17c97 (patch) | |
| tree | dc172ff36764509ba93ef89e1ee521c7c5b34406 /dev-python | |
| parent | 0f3385219e446df9d2c80d4031c86cd563a0a3d7 (diff) | |
dev-python/jupyterlab-server: Bump to 2.28.1
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python')
3 files changed, 201 insertions, 0 deletions
diff --git a/dev-python/jupyterlab-server/Manifest b/dev-python/jupyterlab-server/Manifest index e34234f90b82..82c604eb04d3 100644 --- a/dev-python/jupyterlab-server/Manifest +++ b/dev-python/jupyterlab-server/Manifest @@ -1 +1,2 @@ DIST jupyterlab_server-2.28.0.tar.gz 76996 BLAKE2B 7242e471f7d7630facdfce3112e797576521807245dc0cbd23937c716c70eb64ce8da655981bd04bc2f879a3e4c021f4d097d393e34c2d79fe75bdf71259c290 SHA512 b12119ca8c43dce3a4bbc385d944f70c391b95b55ba79cf9c7319e90a1e1fdb13d92dbac159fea147866accf5a2e29b3cff0ae3534f81af8ff763c688af75712 +DIST jupyterlab_server-2.28.1.tar.gz 78141 BLAKE2B 9173dbcc34025e429bfc3dead11ae55f19bc3194d0d72816d1c8c6eff741f5e1a392afa59d3ea3d2173f4623587a156f0dc625d2abc0ad15381beac93e3ade9e SHA512 fdfbb5464cdb3cbce702782df5b57ab53f595115cd6a0efbe70f26909c697af027c648f9d79e6cd1c499556ce30d9e0a254fcff07888981dc6b6b90670ac842e diff --git a/dev-python/jupyterlab-server/files/jupyterlab-server-2.28.1-openapi-0.23.patch b/dev-python/jupyterlab-server/files/jupyterlab-server-2.28.1-openapi-0.23.patch new file mode 100644 index 000000000000..39f6a628ccc0 --- /dev/null +++ b/dev-python/jupyterlab-server/files/jupyterlab-server-2.28.1-openapi-0.23.patch @@ -0,0 +1,139 @@ +From 204d494f1961ada729937a4df26afe4111b5a24a Mon Sep 17 00:00:00 2001 +From: Evgeniy Martynenko <enimalojd@altlinux.org> +Date: Mon, 17 Aug 2026 14:00:52 +0300 +Subject: [PATCH] openapi: support openapi-core 0.19 through 0.23 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +openapi-core 0.23 removed the openapi_core.spec module and its Spec class. + +Use the public OpenAPI API for loading specifications and validating requests +and responses. Update the dependency constraints and add coverage for +get_openapi_spec(). + +Signed-off-by: Michał Górny <mgorny@gentoo.org> +--- + jupyterlab_server/spec.py | 8 ++++---- + jupyterlab_server/test_utils.py | 21 ++++++++++++--------- + pyproject.toml | 6 +++--- + 3 files changed, 19 insertions(+), 16 deletions(-) + +diff --git a/jupyterlab_server/spec.py b/jupyterlab_server/spec.py +index 94347b9..3c07466 100644 +--- a/jupyterlab_server/spec.py ++++ b/jupyterlab_server/spec.py +@@ -9,17 +9,17 @@ import typing + from pathlib import Path + + if typing.TYPE_CHECKING: +- from openapi_core.spec.paths import Spec ++ from jsonschema_path import SchemaPath + + HERE = Path(os.path.dirname(__file__)).resolve() + + +-def get_openapi_spec() -> Spec: ++def get_openapi_spec() -> SchemaPath: + """Get the OpenAPI spec object.""" +- from openapi_core.spec.paths import Spec ++ from openapi_core import OpenAPI + + openapi_spec_dict = get_openapi_spec_dict() +- return Spec.from_dict(openapi_spec_dict) # type:ignore[arg-type] ++ return OpenAPI.from_dict(openapi_spec_dict).spec + + + def get_openapi_spec_dict() -> dict[str, typing.Any]: +diff --git a/jupyterlab_server/test_utils.py b/jupyterlab_server/test_utils.py +index 094f020..a19c022 100644 +--- a/jupyterlab_server/test_utils.py ++++ b/jupyterlab_server/test_utils.py +@@ -7,19 +7,22 @@ from __future__ import annotations + import json + import os + import sys ++import typing + from http.cookies import SimpleCookie + from pathlib import Path + from urllib.parse import parse_qs, urlparse + + import tornado.httpclient + import tornado.web +-from openapi_core import V30RequestValidator, V30ResponseValidator +-from openapi_core.spec.paths import Spec ++from openapi_core import OpenAPI + from openapi_core.validation.request.datatypes import RequestParameters + from tornado.httpclient import HTTPRequest, HTTPResponse + from werkzeug.datastructures import Headers, ImmutableMultiDict + +-from jupyterlab_server.spec import get_openapi_spec ++from jupyterlab_server.spec import get_openapi_spec_dict ++ ++if typing.TYPE_CHECKING: ++ from jsonschema_path import SchemaPath + + HERE = Path(os.path.dirname(__file__)).resolve() + +@@ -32,7 +35,7 @@ class TornadoOpenAPIRequest: + Converts a torando request to an OpenAPI one + """ + +- def __init__(self, request: HTTPRequest, spec: Spec): ++ def __init__(self, request: HTTPRequest, spec: SchemaPath): + """Initialize the request.""" + self.request = request + self.spec = spec +@@ -76,7 +79,7 @@ class TornadoOpenAPIRequest: + # https://github.com/OAI/OpenAPI-Specification/issues/892 + url = None + o = urlparse(self.request.url) +- for path_ in self.spec["paths"]: ++ for path_ in self.spec["paths"].keys(): # noqa: SIM118 + if url: + continue # type:ignore[unreachable] + has_arg = "{" in path_ +@@ -152,16 +155,16 @@ class TornadoOpenAPIResponse: + + def validate_request(response: HTTPResponse) -> None: + """Validate an API request""" +- openapi_spec = get_openapi_spec() ++ openapi = OpenAPI.from_dict(get_openapi_spec_dict()) + + # openapi_core 0.18 declares body, data and headers as str and Mapping in its + # Request and Response protocols. Tornado hands over bytes and a Headers object, + # and the validators read both, so the adapters above return what tornado gives. +- request = TornadoOpenAPIRequest(response.request, openapi_spec) +- V30RequestValidator(openapi_spec).validate(request) # type: ignore[arg-type] ++ request = TornadoOpenAPIRequest(response.request, openapi.spec) ++ openapi.validate_request(request) + + torn_response = TornadoOpenAPIResponse(response) +- V30ResponseValidator(openapi_spec).validate(request, torn_response) # type: ignore[arg-type] ++ openapi.validate_response(request, torn_response) + + + def maybe_patch_ioloop() -> None: +diff --git a/pyproject.toml b/pyproject.toml +index 0dd1bca..f48ecf9 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -64,15 +64,15 @@ docs = [ + "jinja2<3.2.0" + ] + openapi = [ +- "openapi_core~=0.18.0", ++ "openapi_core>=0.19,<0.24", + "ruamel.yaml", + ] + test = [ + "hatch", + "ipykernel", + "pytest-jupyter[server]>=0.6.2", +- "openapi_core~=0.18.0", +- "openapi-spec-validator>=0.6.0,<0.8.0", ++ "openapi_core>=0.19,<0.24", ++ "openapi-spec-validator>=0.6.0,<0.9.0", + "sphinxcontrib_spelling", + "requests_mock", + "ruamel.yaml", diff --git a/dev-python/jupyterlab-server/jupyterlab-server-2.28.1.ebuild b/dev-python/jupyterlab-server/jupyterlab-server-2.28.1.ebuild new file mode 100644 index 000000000000..23bbd0778715 --- /dev/null +++ b/dev-python/jupyterlab-server/jupyterlab-server-2.28.1.ebuild @@ -0,0 +1,61 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=hatchling +PYTHON_COMPAT=( python3_{12..14} ) + +inherit distutils-r1 pypi + +DESCRIPTION="Server components for JupyterLab and JupyterLab like applications" +HOMEPAGE=" + https://jupyter.org/ + https://github.com/jupyterlab/jupyterlab_server/ + https://pypi.org/project/jupyterlab-server/ +" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86" + +RDEPEND=" + >=dev-python/babel-2.10[${PYTHON_USEDEP}] + >=dev-python/jinja2-3.0.3[${PYTHON_USEDEP}] + >=dev-python/json5-0.9.0[${PYTHON_USEDEP}] + >=dev-python/jsonschema-4.18.0[${PYTHON_USEDEP}] + >=dev-python/packaging-21.3[${PYTHON_USEDEP}] + >=dev-python/requests-2.31[${PYTHON_USEDEP}] + >=dev-python/jupyter-server-1.21[${PYTHON_USEDEP}] + <dev-python/jupyter-server-3[${PYTHON_USEDEP}] +" + +BDEPEND=" + test? ( + dev-python/ipykernel[${PYTHON_USEDEP}] + dev-python/jupyter-server[${PYTHON_USEDEP}] + >=dev-python/openapi-core-0.19[${PYTHON_USEDEP}] + >=dev-python/openapi-spec-validator-0.7[${PYTHON_USEDEP}] + dev-python/requests-mock[${PYTHON_USEDEP}] + dev-python/ruamel-yaml[${PYTHON_USEDEP}] + dev-python/strict-rfc3339[${PYTHON_USEDEP}] + ) +" + +EPYTEST_PLUGINS=( pytest-{jupyter,tornasync,timeout} ) +distutils_enable_tests pytest +# TODO: package autodoc_traits +#distutils_enable_sphinx docs/source dev-python/pydata-sphinx-theme dev-python/myst-parser + +PATCHES=( + "${FILESDIR}/${PN}-2.28.1-openapi-0.23.patch" +) + +EPYTEST_IGNORE=( + tests/test_translation_api.py +) + +EPYTEST_DESELECT=( + # Fails if terminal not available + tests/test_labapp.py::test_page_config +) |
