Tuesday, October 05, 2021

update py-certifi

Latest matplotlib needs an updated py-certifi.

Here's an update to the minimum version that matplotlib needs.

All direct consumers of this port were built on amd64.

ok?

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/py-certifi/Makefile,v
retrieving revision 1.25
diff -u -p -u -r1.25 Makefile
--- Makefile 21 May 2021 19:50:24 -0000 1.25
+++ Makefile 6 Oct 2021 03:36:47 -0000
@@ -2,11 +2,10 @@

COMMENT = Python package to check certificates using the OpenBSD CA

-MODPY_EGG_VERSION = 2020.4.5.1
+MODPY_EGG_VERSION = 2020.6.20
DISTNAME = certifi-${MODPY_EGG_VERSION}
PKGNAME = py-${DISTNAME}
CATEGORIES = devel security
-REVISION = 1

HOMEPAGE = https://certifi.io/

Index: distinfo
===================================================================
RCS file: /cvs/ports/devel/py-certifi/distinfo,v
retrieving revision 1.14
diff -u -p -u -r1.14 distinfo
--- distinfo 14 May 2020 11:44:48 -0000 1.14
+++ distinfo 6 Oct 2021 03:36:47 -0000
@@ -1,2 +1,2 @@
-SHA256 (certifi-2020.4.5.1.tar.gz) = UfyzEXS+bmZkxfaePhaRotcqGhLpD4csvbFWfrR7ZRk=
-SIZE (certifi-2020.4.5.1.tar.gz) = 158038
+SHA256 (certifi-2020.6.20.tar.gz) = WTBZWBdJbdIbuNw12tCQ8cLNCt+vISBL9nMspdjuNNM=
+SIZE (certifi-2020.6.20.tar.gz) = 157997
Index: patches/patch-certifi_core_py
===================================================================
RCS file: /cvs/ports/devel/py-certifi/patches/patch-certifi_core_py,v
retrieving revision 1.7
diff -u -p -u -r1.7 patch-certifi_core_py
--- patches/patch-certifi_core_py 14 May 2020 11:44:48 -0000 1.7
+++ patches/patch-certifi_core_py 6 Oct 2021 03:36:47 -0000
@@ -3,13 +3,55 @@ $OpenBSD: patch-certifi_core_py,v 1.7 20
Index: certifi/core.py
--- certifi/core.py.orig
+++ certifi/core.py
-@@ -21,9 +21,7 @@ except ImportError:
+@@ -9,36 +9,7 @@ This module returns the installation location of cacer
+ import os

-
- def where():
-- f = os.path.dirname(__file__)
+ try:
+- from importlib.resources import path as get_path, read_text
+-
+- _CACERT_CTX = None
+- _CACERT_PATH = None
+-
+- def where():
+- # This is slightly terrible, but we want to delay extracting the file
+- # in cases where we're inside of a zipimport situation until someone
+- # actually calls where(), but we don't want to re-extract the file
+- # on every call of where(), so we'll do it once then store it in a
+- # global variable.
+- global _CACERT_CTX
+- global _CACERT_PATH
+- if _CACERT_PATH is None:
+- # This is slightly janky, the importlib.resources API wants you to
+- # manage the cleanup of this file, so it doesn't actually return a
+- # path, it returns a context manager that will give you the path
+- # when you enter it and will do any cleanup when you leave it. In
+- # the common case of not needing a temporary file, it will just
+- # return the file system location and the __exit__() is a no-op.
+- #
+- # We also have to hold onto the actual context manager, because
+- # it will do the cleanup whenever it gets garbage collected, so
+- # we will also store that at the global level as well.
+- _CACERT_CTX = get_path("certifi", "cacert.pem")
+- _CACERT_PATH = str(_CACERT_CTX.__enter__())
+-
+- return _CACERT_PATH
-
-- return os.path.join(f, "cacert.pem")
+-
++ from importlib.resources import read_text
+ except ImportError:
+ # This fallback will work for Python versions prior to 3.7 that lack the
+ # importlib.resources module but relies on the existing `where` function
+@@ -48,12 +19,9 @@ except ImportError:
+ with open(where(), "r", encoding=encoding) as data:
+ return data.read()
+
+- # If we don't have importlib.resources, then we will just do the old logic
+- # of assuming we're on the filesystem and munge the path directly.
+- def where():
+- f = os.path.dirname(__file__)
+
+- return os.path.join(f, "cacert.pem")
++def where():
+ return '/etc/ssl/cert.pem'

No comments:

Post a Comment