guix_mirror_bot pushed a commit to branch python-team
in repository guix.

commit 3bc6461ebeb359c52378cd30411fed04ee9fb2db
Author: Sharlatan Hellseher <[email protected]>
AuthorDate: Thu Nov 5 13:13:13 2026 +0000

    gnu: python-jupyterlab-server: Update to 2.28.1.
    
    * gnu/packages/jupyter.scm (python-jupyterlab-server): Update to 2.28.1.
    [sources] <patches>: Add upstream patch to support OpenAPI Core 0.23+.
    
    * 
gnu/packages/patches/python-jupyterlab-server-support-python-openapi-core-0.23.patch:
    New file.
    
    Signed-off-by: Sharlatan Hellseher <[email protected]>
---
 gnu/packages/jupyter.scm                           |  10 +-
 ...b-server-support-python-openapi-core-0.23.patch | 134 +++++++++++++++++++++
 2 files changed, 142 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/jupyter.scm b/gnu/packages/jupyter.scm
index 4b062e609ab..a5f7e991e7d 100644
--- a/gnu/packages/jupyter.scm
+++ b/gnu/packages/jupyter.scm
@@ -48,6 +48,7 @@
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system pyproject)
   #:use-module (guix utils)
+  #:use-module (gnu packages)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages check)
@@ -1000,13 +1001,18 @@ the JupyterLab CSS variables.")
 (define-public python-jupyterlab-server
   (package
     (name "python-jupyterlab-server")
-    (version "2.27.1")
+    (version "2.28.1")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "jupyterlab_server" version))
        (sha256
-        (base32 "07b3m34akrf79xpaim9cymhsac0ry5ry7if998lcfxmn173mlyq9"))))
+        (base32 "0cfv1mb8zj9kak1fayvqwas8d0xs9kz3vrhn14lcw88hslc28g0c"))
+        ;; See: <https://github.com/python-openapi/openapi-core/issues/1225>,
+        ;; <https://github.com/jupyterlab/jupyterlab_server/pull/477>.
+       (patches
+        (search-patches
+         "python-jupyterlab-server-support-python-openapi-core-0.23.patch"))))
     (build-system pyproject-build-system)
     (arguments
      (list
diff --git 
a/gnu/packages/patches/python-jupyterlab-server-support-python-openapi-core-0.23.patch
 
b/gnu/packages/patches/python-jupyterlab-server-support-python-openapi-core-0.23.patch
new file mode 100644
index 00000000000..4ec19579153
--- /dev/null
+++ 
b/gnu/packages/patches/python-jupyterlab-server-support-python-openapi-core-0.23.patch
@@ -0,0 +1,134 @@
+From 50e398a4f85e1f0ee002dfe25a6d97be31aa6433 Mon Sep 17 00:00:00 2001
+From: Evgeniy Martynenko <[email protected]>
+Date: Mon, 17 Aug 2026 14:00:52 +0300
+Subject: [PATCH] openapi: support openapi-core 0.19 through 0.23
+
+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().
+---
+ jupyterlab_server/spec.py       |  8 ++++----
+ jupyterlab_server/test_utils.py | 24 ++++++++++++------------
+ pyproject.toml                  |  6 +++---
+ 3 files changed, 19 insertions(+), 19 deletions(-)
+
+diff --git a/jupyterlab_server/spec.py b/jupyterlab_server/spec.py
+index 94347b96..3c07466e 100644
+--- a/jupyterlab_server/spec.py
++++ b/jupyterlab_server/spec.py
+@@ -9,17 +9,17 @@
+ 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 094f0204..592c60d0 100644
+--- a/jupyterlab_server/test_utils.py
++++ b/jupyterlab_server/test_utils.py
+@@ -7,19 +7,22 @@
+ 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 @@ def path(self) -> str:
+         # 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,13 @@ def headers(self) -> Headers:
+ 
+ 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 0dd1bca5..f48ecf91 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",

Reply via email to