Skip to content

Commit

Permalink
python3-opt-einsum: Use ConfigParser instead of SafeConfigParser
Browse files Browse the repository at this point in the history
The SafeConfigParser class will be renamed to ConfigParser in Python
3.12 [1]. This alias will be removed in future versions.So we can use
ConfigParser directly instead.

[1] python/cpython#89336

Signed-off-by: Hongxu Jia <[email protected]>
  • Loading branch information
hongxu-jia authored and Hongxu Jia committed Nov 18, 2022
1 parent 7bcfb08 commit 164f1d3
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
From 0beacf96923bbb2dd1939a9c59398a38ce7a11b1 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <[email protected]>
Date: Thu, 17 Nov 2022 17:04:54 -0800
Subject: [PATCH] Use ConfigParser instead of SafeConfigParser

The SafeConfigParser class will be renamed to ConfigParser in Python
3.12 [1]. This alias will be removed in future versions.So we can use
ConfigParser directly instead.

[1] https://github.com/python/cpython/issues/89336

Upstream-Status: Submitted [https://github.com/dgasmith/opt_einsum/pull/208]
Signed-off-by: Hongxu Jia <[email protected]>
---
versioneer.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/versioneer.py b/versioneer.py
index d3db643..6d732af 100644
--- a/versioneer.py
+++ b/versioneer.py
@@ -339,9 +339,9 @@ def get_config_from_root(root):
# configparser.NoOptionError (if it lacks "VCS="). See the docstring at
# the top of versioneer.py for instructions on writing your setup.cfg .
setup_cfg = os.path.join(root, "setup.cfg")
- parser = configparser.SafeConfigParser()
+ parser = configparser.ConfigParser()
with open(setup_cfg, "r") as f:
- parser.readfp(f)
+ parser.read_file(f)
VCS = parser.get("versioneer", "VCS") # mandatory

def get(parser, name):
--
2.37.1

3 changes: 3 additions & 0 deletions recipes-devtools/python/python3-opt-einsum_3.3.0.bb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ inherit pypi setuptools3

SRCNAME = "opt_einsum"
PYPI_SRC_URI = "https://files.pythonhosted.org/packages/source/o/${PYPI_PACKAGE}/${SRCNAME}-${PV}.tar.gz"
SRC_URI += " \
file://0001-Use-ConfigParser-instead-of-SafeConfigParser.patch \
"
S = "${WORKDIR}/${SRCNAME}-${PV}"

BBCLASSEXTEND = "native"

0 comments on commit 164f1d3

Please sign in to comment.