Repository: jupyterlab/jupyterlab_server (language: python)

Issue:
Support for openapi-core-0.17*
### Problem

The package currently requires openapi-core-16*. However, 0.17* was released in March already.

### Proposed Solution

Add support for openapi-core-0.17*.

### Additional context

n/a


Discussion / hints:
Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
<br>If you haven't done so already, check out [Jupyter's Code of Conduct](https://github.com/jupyter/governance/blob/master/conduct/code_of_conduct.md). Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
![welcome](https://raw.githubusercontent.com/jupyterlab/.github/master/images/welcome.jpg)
You can meet the other [Jovyans](https://jupyter.readthedocs.io/en/latest/community/content-community.html?highlight=jovyan#what-is-a-jovyan) by joining our [Discourse forum](http://discourse.jupyter.org/). There is also an intro thread there where you can stop by and say Hi! :wave:
<br>Welcome to the Jupyter community! :tada:

PRs welcome, but these dependencies were pinned due to the highly unstable
upstream API. Any new pin would have to be similarly conservative.

Any chance to bump it to openapi-core 0.18? We have a gordian knot with
 * openapi-spec-validator 0.6 (#403)
 * openapi-schema-validator 0.6 
 * jsonschema 4.18

Fix patch:
diff --git a/pyproject.toml b/pyproject.toml
index 8e5bc169..842bf455 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -2,7 +2,7 @@
 # Distributed under the terms of the Modified BSD License.
 
 [build-system]
-requires = ["hatchling>=1.5"]
+requires = ["hatchling>=1.7"]
 build-backend = "hatchling.build"
 
 [project]
@@ -20,22 +20,22 @@ classifiers = [
   "License :: OSI Approved :: BSD License",
   "Programming Language :: Python",
   "Programming Language :: Python :: 3 :: Only",
-  "Programming Language :: Python :: 3.7",
   "Programming Language :: Python :: 3.8",
   "Programming Language :: Python :: 3.9",
   "Programming Language :: Python :: 3.10",
   "Programming Language :: Python :: 3.11",
+  "Programming Language :: Python :: 3.12",
   "Typing :: Typed"]
-requires-python = ">=3.7"
+requires-python = ">=3.8"
 dependencies = [
   "babel>=2.10",
   "importlib_metadata>=4.8.3;python_version<\"3.10\"",
   "jinja2>=3.0.3",
   "json5>=0.9.0",
-  "jsonschema>=4.17.3",
+  "jsonschema>=4.18.0",
   "jupyter_server>=1.21,<3",
   "packaging>=21.3",
-  "requests>=2.28",
+  "requests>=2.31",
 ]
 
 [[project.authors]]
@@ -65,17 +65,18 @@ docs = [
   "jinja2<3.2.0"
 ]
 openapi = [
-  "openapi_core~=0.16.1",
+  "openapi_core~=0.18.0",
   "ruamel.yaml",
 ]
 test = [
   "hatch",
   "ipykernel",
   "pytest-jupyter[server]>=0.6.2",
-  "jupyterlab_server[openapi]",
-  "openapi-spec-validator>=0.5.1,<0.7.0",
+  "openapi_core~=0.18.0",
+  "openapi-spec-validator>=0.6.0,<0.7.0",
   "sphinxcontrib_spelling",
   "requests_mock",
+  "ruamel.yaml",
   "pytest>=7.0",
   "pytest-console-scripts",
   "pytest-cov",
@@ -108,7 +109,7 @@ nowarn = "test -W default {args}"
 
 [tool.hatch.envs.typing]
 features = ["test"]
-dependencies = ["mypy>=0.990"]
+dependencies = ["mypy>=1.5.1"]
 [tool.hatch.envs.typing.scripts]
 test = "mypy --install-types --non-interactive {args:jupyterlab_server tests}"
 
@@ -148,6 +149,9 @@ filterwarnings = [
   "module:read property is deprecated:DeprecationWarning",
   # From tornado.netutil.bind_sockets
   "module:unclosed <socket.socket:ResourceWarning",
+  # From jupyter_client
+  "module:datetime.datetime.utcfromtimestamp:DeprecationWarning",
+  "module:datetime.datetime.utcnow:DeprecationWarning",
 ]
 
 [tool.coverage.report]


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 19476df4..e24cea79 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -19,16 +19,16 @@ jobs:
       fail-fast: false
       matrix:
         os: [ubuntu-latest, windows-latest, macos-latest]
-        python-version: ["3.7", "3.11"]
+        python-version: ["3.8", "3.12"]
         include:
           - os: windows-latest
             python-version: "3.9"
           - os: ubuntu-latest
-            python-version: "pypy-3.8"
+            python-version: "pypy-3.9"
           - os: ubuntu-latest
             python-version: "3.10"
           - os: macos-latest
-            python-version: "3.8"
+            python-version: "3.11"
     steps:
       - name: Checkout
         uses: actions/checkout@v4
diff --git a/jupyterlab_server/test_utils.py b/jupyterlab_server/test_utils.py
index f761ec8c..eb6a1387 100644
--- a/jupyterlab_server/test_utils.py
+++ b/jupyterlab_server/test_utils.py
@@ -12,13 +12,7 @@
 
 import tornado.httpclient
 import tornado.web
-
-try:
-    from openapi_core import V30RequestValidator, V30ResponseValidator  # type:ignore[attr-defined]
-except ImportError:
-    V30RequestValidator = None
-    V30ResponseValidator = None
-    from openapi_core import openapi_request_validator, openapi_response_validator
+from openapi_core import V30RequestValidator, V30ResponseValidator
 from openapi_core.spec.paths import Spec
 from openapi_core.validation.request.datatypes import RequestParameters
 from tornado.httpclient import HTTPRequest, HTTPResponse
@@ -152,18 +146,10 @@ def validate_request(response):
     openapi_spec = get_openapi_spec()
 
     request = TornadoOpenAPIRequest(response.request, openapi_spec)
-    if V30RequestValidator:
-        result = V30RequestValidator(openapi_spec).validate(request)
-    else:
-        result = openapi_request_validator.validate(openapi_spec, request)
-    result.raise_for_errors()
+    V30RequestValidator(openapi_spec).validate(request)
 
     response = TornadoOpenAPIResponse(response)
-    if V30ResponseValidator:
-        result2 = V30ResponseValidator(openapi_spec).validate(request, response)
-    else:
-        result2 = openapi_response_validator.validate(openapi_spec, request, response)
-    result2.raise_for_errors()
+    V30ResponseValidator(openapi_spec).validate(request, response)
 
 
 def maybe_patch_ioloop():