python3-jupyter_client: update to 8.3.1, adopt.

This commit is contained in:
Gonzalo Tornaría 2023-05-01 22:43:07 -03:00 committed by Andrew J. Hesford
parent 63261921f5
commit d7bd2e0724
2 changed files with 165 additions and 10 deletions

View file

@ -0,0 +1,149 @@
Taken from https://github.com/jupyter/jupyter_client/pull/972/
From 493366dd9e11736c32d32b1d84f5fa56d9ee74ab Mon Sep 17 00:00:00 2001
From: Mattias Ellert <mattias.ellert@physics.uu.se>
Date: Mon, 11 Sep 2023 06:37:16 +0200
Subject: [PATCH 1/4] Do not use datetime.utcnow() that is deprecated in Python
3.12
Import session.utcnow() into utils instead of reimplementing it
---
jupyter_client/session.py | 2 +-
jupyter_client/utils.py | 34 +---------------------------------
2 files changed, 2 insertions(+), 34 deletions(-)
diff --git a/jupyter_client/session.py b/jupyter_client/session.py
index ca9d9bbe..ee172d53 100644
--- a/jupyter_client/session.py
+++ b/jupyter_client/session.py
@@ -197,7 +197,7 @@ def default_secure(cfg: t.Any) -> None: # pragma: no cover
def utcnow() -> datetime:
"""Return timezone-aware UTC timestamp"""
- return datetime.utcnow().replace(tzinfo=utc) # noqa
+ return datetime.now(utc) # noqa
# -----------------------------------------------------------------------------
diff --git a/jupyter_client/utils.py b/jupyter_client/utils.py
index ab1cbcaa..4e2943c0 100644
--- a/jupyter_client/utils.py
+++ b/jupyter_client/utils.py
@@ -4,10 +4,10 @@
- vendor functions from ipython_genutils that should be retired at some point.
"""
import os
-from datetime import datetime, timedelta, tzinfo
from jupyter_core.utils import ensure_async, run_sync # noqa: F401 # noqa: F401
+from .session import utcnow
def _filefind(filename, path_dirs=None):
"""Find a file by looking through a sequence of paths.
@@ -84,35 +84,3 @@ def _expand_path(s):
if os.name == "nt":
s = s.replace("IPYTHON_TEMP", "$\\")
return s
-
-
-# constant for zero offset
-ZERO = timedelta(0)
-
-
-class tzUTC(tzinfo): # noqa
- """tzinfo object for UTC (zero offset)"""
-
- def utcoffset(self, d):
- """Compute utcoffset."""
- return ZERO
-
- def dst(self, d):
- """Compute dst."""
- return ZERO
-
-
-UTC = tzUTC() # type:ignore
-
-
-def utc_aware(unaware):
- """decorator for adding UTC tzinfo to datetime's utcfoo methods"""
-
- def utc_method(*args, **kwargs):
- dt = unaware(*args, **kwargs)
- return dt.replace(tzinfo=UTC)
-
- return utc_method
-
-
-utcnow = utc_aware(datetime.utcnow)
From 5468546499f5071171bcb8bccafe034837cc092d Mon Sep 17 00:00:00 2001
From: "pre-commit-ci[bot]"
<66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date: Mon, 11 Sep 2023 04:44:48 +0000
Subject: [PATCH 2/4] [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---
jupyter_client/utils.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/jupyter_client/utils.py b/jupyter_client/utils.py
index 4e2943c0..0186a001 100644
--- a/jupyter_client/utils.py
+++ b/jupyter_client/utils.py
@@ -9,6 +9,7 @@
from .session import utcnow
+
def _filefind(filename, path_dirs=None):
"""Find a file by looking through a sequence of paths.
From d78c153d819fb3da3dc80f916747291b5200a302 Mon Sep 17 00:00:00 2001
From: David Brochart <david.brochart@gmail.com>
Date: Mon, 11 Sep 2023 09:22:41 +0200
Subject: [PATCH 3/4] Remove unneeded noqa
---
jupyter_client/session.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/jupyter_client/session.py b/jupyter_client/session.py
index ee172d53..e22c9d44 100644
--- a/jupyter_client/session.py
+++ b/jupyter_client/session.py
@@ -197,7 +197,7 @@ def default_secure(cfg: t.Any) -> None: # pragma: no cover
def utcnow() -> datetime:
"""Return timezone-aware UTC timestamp"""
- return datetime.now(utc) # noqa
+ return datetime.now(utc)
# -----------------------------------------------------------------------------
From 7ba40db1c6fb505e95df4cf4c3f9176661f2f270 Mon Sep 17 00:00:00 2001
From: David Brochart <david.brochart@gmail.com>
Date: Mon, 11 Sep 2023 09:22:57 +0200
Subject: [PATCH 4/4] Add noqa
---
jupyter_client/utils.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/jupyter_client/utils.py b/jupyter_client/utils.py
index 0186a001..9f1c38e9 100644
--- a/jupyter_client/utils.py
+++ b/jupyter_client/utils.py
@@ -7,7 +7,7 @@
from jupyter_core.utils import ensure_async, run_sync # noqa: F401 # noqa: F401
-from .session import utcnow
+from .session import utcnow # noqa
def _filefind(filename, path_dirs=None):

View file

@ -1,21 +1,27 @@
# Template file for 'python3-jupyter_client'
pkgname=python3-jupyter_client
version=7.4.5
revision=2
version=8.3.1
revision=1
build_style=python3-pep517
hostmakedepends="python3-flit_core hatchling"
depends="python3-traitlets python3-jupyter_core python3-pyzmq
python3-dateutil python3-tornado python3-nest_asyncio python3-entrypoints"
hostmakedepends="hatchling"
depends="python3-dateutil python3-jupyter_core python3-pyzmq python3-tornado"
checkdepends="$depends inetutils-ifconfig iproute2 openssh
python3-pytest-jupyter python3-pytest-timeout"
short_desc="Jupyter protocol client APIs"
maintainer="Orphaned <orphan@voidlinux.org>"
maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
license="BSD-3-Clause"
homepage="https://github.com/jupyter/jupyter_client"
changelog="https://raw.githubusercontent.com/jupyter/jupyter_client/main/CHANGELOG.md"
distfiles="${PYPI_SITE}/j/jupyter_client/jupyter_client-${version}.tar.gz"
checksum=63eae06c40e1f2d9afa14447511fddc065c95dea3f2491fda2acccf91221954a
checksum=60294b2d5b869356c893f57b1a877ea6510d60d45cf4b38057f1672d85699ac9
conflicts="python-jupyter_client<=5.2.4_2"
# checks create a cycle with python3-jupyter_core and python3-ipython_ipykernel
make_check=no
make_check=extended # avoid a circular dependency
if [ "$XBPS_CHECK_PKGS" = full ]; then
# this would cause a build-time circular dependency
checkdepends+=" python3-ipython_ipykernel"
fi
post_install() {
vlicense COPYING.md LICENSE
vlicense LICENSE
}