From b4800dc925dd67dbfd667971a00d00f1747f3ac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Mon, 6 Nov 2023 23:27:48 -0300 Subject: [PATCH] python3-jupyter_server: update to 2.11.0. --- .../patches/utcnow-deprecation.patch | 47 ------------------- srcpkgs/python3-jupyter_server/template | 4 +- 2 files changed, 2 insertions(+), 49 deletions(-) delete mode 100644 srcpkgs/python3-jupyter_server/patches/utcnow-deprecation.patch diff --git a/srcpkgs/python3-jupyter_server/patches/utcnow-deprecation.patch b/srcpkgs/python3-jupyter_server/patches/utcnow-deprecation.patch deleted file mode 100644 index 7a69b8f834e..00000000000 --- a/srcpkgs/python3-jupyter_server/patches/utcnow-deprecation.patch +++ /dev/null @@ -1,47 +0,0 @@ -commit 13def167faf8898b2e19fc04f24c0ff6f6cc35fa -Author: Gonzalo TornarĂ­a -Date: Mon Oct 16 10:38:36 2023 -0300 - - utcnow deprecation - - See: https://github.com/jupyter-server/jupyter_server/issues/1296#issuecomment-1751887150 - -diff --git a/jupyter_server/_tz.py b/jupyter_server/_tz.py -index 24847b430..ea3e65fe2 100644 ---- a/jupyter_server/_tz.py -+++ b/jupyter_server/_tz.py -@@ -7,7 +7,7 @@ Just UTC-awareness right now - # Distributed under the terms of the Modified BSD License. - from __future__ import annotations - --from datetime import datetime, timedelta, tzinfo -+from datetime import datetime, timedelta, tzinfo, timezone - from typing import Callable - - # constant for zero offset -@@ -42,6 +42,12 @@ def utc_aware(unaware: Callable[..., datetime]) -> Callable[..., datetime]: - utcfromtimestamp = utc_aware(datetime.utcfromtimestamp) - utcnow = utc_aware(datetime.utcnow) - -+def utcnow() -> datetime: -+ """ Return timezone-aware UTC timestamp""" -+ return datetime.now(timezone.utc) -+ -+def utcfromtimestamp(timestamp): -+ return datetime.fromtimestamp(timestamp, timezone.utc) - - def isoformat(dt: datetime) -> str: - """Return iso-formatted timestamp -diff --git a/tests/test_gateway.py b/tests/test_gateway.py -index 37ce8b03e..e1ea0869e 100644 ---- a/tests/test_gateway.py -+++ b/tests/test_gateway.py -@@ -78,7 +78,7 @@ omitted_kernels: Dict[str, bool] = {} - - def generate_model(name): - """Generate a mocked kernel model. Caller is responsible for adding model to running_kernels dictionary.""" -- dt = datetime.utcnow().isoformat() + "Z" # noqa -+ dt = datetime.now(timezone.utc).isoformat().replace("+00:00", "Z") # noqa - kernel_id = str(uuid.uuid4()) - model = { - "id": kernel_id, diff --git a/srcpkgs/python3-jupyter_server/template b/srcpkgs/python3-jupyter_server/template index f38ab9ed7ee..456a0c3993d 100644 --- a/srcpkgs/python3-jupyter_server/template +++ b/srcpkgs/python3-jupyter_server/template @@ -1,6 +1,6 @@ # Template file for 'python3-jupyter_server' pkgname=python3-jupyter_server -version=2.9.1 +version=2.11.0 revision=1 build_style=python3-pep517 # these tests are flaky with jupyter_core 5.5.0 @@ -23,7 +23,7 @@ license="BSD-3-Clause" homepage="https://github.com/jupyter-server/jupyter_server" changelog="https://raw.githubusercontent.com/jupyter-server/jupyter_server/main/CHANGELOG.md" distfiles="${PYPI_SITE}/j/jupyter-server/jupyter_server-${version}.tar.gz" -checksum=9ba71be4b9c16e479e4c50c929f8ac4b1015baf90237a08681397a98c76c7e5e +checksum=78c97ec8049f9062f0151725bc8a1364dfed716646a66819095e0e8a24793eba if [ "$XBPS_BUILD_ENVIRONMENT" = void-packages-ci ]; then # these tests fail on CI (connect to a tcp address)