summaryrefslogtreecommitdiff
path: root/dev-python/immutables
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/immutables')
-rw-r--r--dev-python/immutables/Manifest3
-rw-r--r--dev-python/immutables/files/immutables-0.20-opt-ext.patch28
-rw-r--r--dev-python/immutables/immutables-0.20.ebuild22
3 files changed, 46 insertions, 7 deletions
diff --git a/dev-python/immutables/Manifest b/dev-python/immutables/Manifest
index 7890c4516982..ff9ef500c613 100644
--- a/dev-python/immutables/Manifest
+++ b/dev-python/immutables/Manifest
@@ -1,3 +1,4 @@
+AUX immutables-0.20-opt-ext.patch 1122 BLAKE2B 93454accb29307244498a1cbc86a5cee706c076e77903d259d8c243af50f3c96695652c018c1f67f5014a7c34cde4f4f7e23319ad9009ccd5c9496bc2c1539ee SHA512 47f3628c9a5476b258141cc60a378851efd41e418a16af548e9da6d2b614d627527458e243cc37e6e22ab669b373b298f630ba98fb94bc6e5f5a64c49a5cb9ab
DIST immutables-0.20.gh.tar.gz 88169 BLAKE2B fb76793d8d908ea35999a9d3d36cdb6cc2021fda07d0822b23bf1eb7fe02031ac26a7aa3e83e890af24b949eedf6d81089a3670e96f9873a60339d0da44d2484 SHA512 b20a661e4a9161a2fe3db674aac8e84a36dd3e56083e6f6d6b1261a00d38adc136c0a2dce67243a5a4cd5b0568aa48a9d4c758fb27cf74e055f378a501c0f725
-EBUILD immutables-0.20.ebuild 1114 BLAKE2B b64f8c71a859d05d3ddabbd93148c534df58ff2dbbe2bbefa6e6550512cfb3635f9191bb17ed4f3c0386ad4279830b07fd78b7520a3f164c1cb628f34597a1b2 SHA512 c1427d7507173923e758fbaf4a2972dce8aee983bc3c7085b42e145694d820082088f9c3549785c61d1b164959ec5798eae1ce085aeac7292fe492eae7271903
+EBUILD immutables-0.20.ebuild 1314 BLAKE2B efbe0f3624054de1b26227eb9d11b7943446fe7891ac70ede97a1e78fa9a01d84d9db3c5af8eab974516fd6b530fd9e2734b499ca89915f3be132227a2ffe9c1 SHA512 667b6728fd4b41f83321c23312cc6a0d7c6e69c0e856ac59a6fb4dd101f066b65bd93ed609a172f2dad05e8b11733ffe35ee4c7f1ba984beaf0929d23d76576e
MISC metadata.xml 500 BLAKE2B 6e0ecbab5e2bb4832c5365f1a8942fb4c3838520347031f917a2c834e74ddd17c5d36032f967a1e89a457ddc2da3ab7cbe1145ca80dd9053cfbcbcf4fdfeeaa0 SHA512 b1078749accb64b17f39e884467e1826eaae0bc2cb736d9e97657ae2d06ca86042c5b12c3ea2f430d9a82d65339d2a4bbe9297f2f16d1f8b299e94bb5e2174fe
diff --git a/dev-python/immutables/files/immutables-0.20-opt-ext.patch b/dev-python/immutables/files/immutables-0.20-opt-ext.patch
new file mode 100644
index 000000000000..6dbcb183a612
--- /dev/null
+++ b/dev-python/immutables/files/immutables-0.20-opt-ext.patch
@@ -0,0 +1,28 @@
+From b1cb26389d8c8aa646c4debae429fb1515408812 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Mon, 13 May 2024 15:51:04 +0200
+Subject: [PATCH] Support disabling C extensions via IMMUTABLES_EXT=0
+
+Support using IMMUTABLES_EXT environment variable to control whether
+the C extension is built explicitly. When set to a value other than 1,
+the extension built is disabled. This is helpful e.g. for future Python
+versions where the extension does not work (this is affecting 3.13 right
+now, but having an explicit option is more future-proof).
+---
+ setup.py | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/setup.py b/setup.py
+index 8cfc9c97..870de2d1 100644
+--- a/setup.py
++++ b/setup.py
+@@ -27,7 +27,8 @@
+ 'unable to read the version from immutables/_version.py')
+
+
+-if platform.python_implementation() == 'CPython':
++if (platform.python_implementation() == 'CPython' and
++ os.environ.get('IMMUTABLES_EXT', '1') == '1'):
+ if os.environ.get("DEBUG_IMMUTABLES") == '1':
+ define_macros = []
+ undef_macros = ['NDEBUG']
diff --git a/dev-python/immutables/immutables-0.20.ebuild b/dev-python/immutables/immutables-0.20.ebuild
index bac9e6016261..a3dda207372a 100644
--- a/dev-python/immutables/immutables-0.20.ebuild
+++ b/dev-python/immutables/immutables-0.20.ebuild
@@ -1,11 +1,11 @@
-# Copyright 2019-2023 Gentoo Authors
+# Copyright 2019-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_EXT=1
DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( pypy3 python3_{10..12} )
+PYTHON_COMPAT=( pypy3 python3_{10..13} )
inherit distutils-r1
@@ -27,17 +27,26 @@ IUSE="+native-extensions"
distutils_enable_tests pytest
src_prepare() {
+ local PATCHES=(
+ # https://github.com/MagicStack/immutables/pull/117
+ "${FILESDIR}/${P}-opt-ext.patch"
+ )
+
sed -i -e '/mypy/d' tests/conftest.py || die
- # NB: upstream never builds extensions on PyPy
- if ! use native-extensions; then
- sed -i -e '/ext_modules=/d' setup.py || die
- fi
distutils-r1_src_prepare
}
python_compile() {
# upstream controls NDEBUG explicitly
use debug && local -x DEBUG_IMMUTABLES=1
+ local -x IMMUTABLES_EXT=$(usex native-extensions 1 0)
+ case ${EPYTHON} in
+ python3.13)
+ # https://github.com/MagicStack/immutables/issues/116
+ IMMUTABLES_EXT=0
+ ;;
+ esac
+
distutils-r1_python_compile
}
@@ -47,5 +56,6 @@ python_test() {
)
rm -rf immutables || die
+ local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
epytest
}