* [gentoo-commits] repo/gentoo:master commit in: dev-python/jsonpickle/, dev-python/jsonpickle/files/
@ 2023-01-08 5:16 Michał Górny
0 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2023-01-08 5:16 UTC (permalink / raw
To: gentoo-commits
commit: 7436f097bfbddcd3ec06acef160d10c78953b553
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 8 05:13:31 2023 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Jan 8 05:13:31 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7436f097
dev-python/jsonpickle: Remove old
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/jsonpickle/Manifest | 2 -
.../files/jsonpickle-2.2.0-python3.11.patch | 46 ----------------
dev-python/jsonpickle/jsonpickle-2.2.0-r1.ebuild | 63 ----------------------
dev-python/jsonpickle/jsonpickle-3.0.0.ebuild | 59 --------------------
4 files changed, 170 deletions(-)
diff --git a/dev-python/jsonpickle/Manifest b/dev-python/jsonpickle/Manifest
index 5351b9632fd1..0f06523c022f 100644
--- a/dev-python/jsonpickle/Manifest
+++ b/dev-python/jsonpickle/Manifest
@@ -1,3 +1 @@
-DIST jsonpickle-2.2.0.tar.gz 189866 BLAKE2B d8fcd0e8b71947b734c59240d9fa4f0b35b9b0ac2e2940a9baf05c160771db0eae5f011b61e3b1c0bc746a740ac2e137a392931e270fea3acf4884578133283e SHA512 b6cb35316e32f38875cbfa3784a3930f669d4ea730ead6117242070590647987383e9f933c193b8c246c40dba87ad56600a65db89c45c18a790b3c1f9232b245
-DIST jsonpickle-3.0.0.tar.gz 192204 BLAKE2B de46fce9b4cee97ededb4e6febff234c499e0a1025d01dc5e90278e35744938ed1d8bc4f0ac0a0ba5e6006c9bea777479f338849c449aa1e6005c3eb5162d721 SHA512 825e70ccbc35554e7a1938307a81c0672c3a43a10d79a2159e6f453a12a98d36ab5839cf56cd1927c37f30a10efdc33d43a26c91dc7791e788537e2dbd449181
DIST jsonpickle-3.0.1.gh.tar.gz 257651 BLAKE2B 4875985085c8303b316b387968ad46bc35672259f8f6799270bff5dee1b4d341bd92e520155d5c5ff644b289ac21275e95911a38165303c07c4634a93e17ae62 SHA512 3190716491c01de1e5ce16cd8fee3163c20831521503803a5282b43c6653756554fa6184de78755f3232ac6c9bc51baccb91305f9ac9462c8e22fc57fbcc52eb
diff --git a/dev-python/jsonpickle/files/jsonpickle-2.2.0-python3.11.patch b/dev-python/jsonpickle/files/jsonpickle-2.2.0-python3.11.patch
deleted file mode 100644
index 10c266a2a696..000000000000
--- a/dev-python/jsonpickle/files/jsonpickle-2.2.0-python3.11.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-diff --git a/jsonpickle/pickler.py b/jsonpickle/pickler.py
-index 3d391cb..2103e46 100644
---- a/jsonpickle/pickler.py
-+++ b/jsonpickle/pickler.py
-@@ -476,8 +476,12 @@ def _flatten_obj_instance(self, obj):
-
- # Support objects with __getstate__(); this ensures that
- # both __setstate__() and __getstate__() are implemented
-- has_getstate = hasattr(obj, '__getstate__')
-+ has_own_getstate = (
-+ hasattr(type(obj), '__getstate__')
-+ and type(obj).__getstate__ is not getattr(object, '__getstate__', None)
-+ )
- # not using has_method since __getstate__() is handled separately below
-+ # Note: on Python 3.11+, all objects have __getstate__.
-
- if has_class:
- cls = obj.__class__
-@@ -549,7 +553,7 @@ def _flatten_obj_instance(self, obj):
- # check that getstate/setstate is sane
- if not (
- state
-- and hasattr(obj, '__getstate__')
-+ and has_own_getstate
- and not hasattr(obj, '__setstate__')
- and not isinstance(obj, dict)
- ):
-@@ -581,7 +585,7 @@ def _flatten_obj_instance(self, obj):
- if has_getinitargs:
- data[tags.INITARGS] = self._flatten(obj.__getinitargs__())
-
-- if has_getstate:
-+ if has_own_getstate:
- try:
- state = obj.__getstate__()
- except TypeError:
-@@ -590,7 +594,8 @@ def _flatten_obj_instance(self, obj):
- self._pickle_warning(obj)
- return None
- else:
-- return self._getstate(state, data)
-+ if state:
-+ return self._getstate(state, data)
-
- if util.is_module(obj):
- if self.unpicklable:
diff --git a/dev-python/jsonpickle/jsonpickle-2.2.0-r1.ebuild b/dev-python/jsonpickle/jsonpickle-2.2.0-r1.ebuild
deleted file mode 100644
index 0d12c49d69df..000000000000
--- a/dev-python/jsonpickle/jsonpickle-2.2.0-r1.ebuild
+++ /dev/null
@@ -1,63 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{8..11} )
-
-inherit distutils-r1 optfeature
-
-DESCRIPTION="Python library for serializing any arbitrary object graph into JSON"
-HOMEPAGE="
- https://github.com/jsonpickle/jsonpickle/
- https://pypi.org/project/jsonpickle/
-"
-SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="amd64 ~arm ~arm64 ~ppc64 ~riscv x86 ~amd64-linux ~x86-linux"
-
-BDEPEND="
- dev-python/setuptools_scm[${PYTHON_USEDEP}]
- test? (
- dev-python/feedparser[${PYTHON_USEDEP}]
- dev-python/numpy[${PYTHON_USEDEP}]
- dev-python/pandas[${PYTHON_USEDEP}]
- dev-python/simplejson[${PYTHON_USEDEP}]
- dev-python/sqlalchemy[${PYTHON_USEDEP}]
- dev-python/ujson[${PYTHON_USEDEP}]
- )
-"
-
-PATCHES=(
- # https://github.com/jsonpickle/jsonpickle/pull/396
- "${FILESDIR}/${P}-python3.11.patch"
-)
-
-distutils_enable_tests pytest
-
-python_prepare_all() {
- sed -i -e 's:--flake8 --cov::' pytest.ini || die
- distutils-r1_python_prepare_all
-}
-
-python_test() {
- local EPYTEST_IGNORE=(
- # unpackaged bson dependency
- tests/bson_test.py
- # broken when gmpy is installed
- # https://github.com/jsonpickle/jsonpickle/issues/328
- # https://github.com/jsonpickle/jsonpickle/issues/316
- tests/ecdsa_test.py
- )
- epytest
-}
-
-pkg_postinst() {
- # Unpackaged optional backends: yajl, demjson
- optfeature "encoding numpy-based data" dev-python/numpy
- optfeature "encoding pandas objects" dev-python/pandas
- optfeature "fast JSON backend" dev-python/simplejson
-}
diff --git a/dev-python/jsonpickle/jsonpickle-3.0.0.ebuild b/dev-python/jsonpickle/jsonpickle-3.0.0.ebuild
deleted file mode 100644
index 3b17a7408f52..000000000000
--- a/dev-python/jsonpickle/jsonpickle-3.0.0.ebuild
+++ /dev/null
@@ -1,59 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{8..11} )
-
-inherit distutils-r1 optfeature
-
-DESCRIPTION="Python library for serializing any arbitrary object graph into JSON"
-HOMEPAGE="
- https://github.com/jsonpickle/jsonpickle/
- https://pypi.org/project/jsonpickle/
-"
-SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86 ~amd64-linux ~x86-linux"
-
-BDEPEND="
- dev-python/setuptools_scm[${PYTHON_USEDEP}]
- test? (
- dev-python/feedparser[${PYTHON_USEDEP}]
- dev-python/gmpy[${PYTHON_USEDEP}]
- dev-python/numpy[${PYTHON_USEDEP}]
- dev-python/pandas[${PYTHON_USEDEP}]
- dev-python/simplejson[${PYTHON_USEDEP}]
- dev-python/sqlalchemy[${PYTHON_USEDEP}]
- dev-python/ujson[${PYTHON_USEDEP}]
- )
-"
-
-distutils_enable_tests pytest
-
-python_prepare_all() {
- sed -i -e 's:--cov::' pytest.ini || die
- distutils-r1_python_prepare_all
-}
-
-python_test() {
- local EPYTEST_IGNORE=(
- # unpackaged bson dependency
- tests/bson_test.py
- # broken when gmpy is installed
- # https://github.com/jsonpickle/jsonpickle/issues/328
- # https://github.com/jsonpickle/jsonpickle/issues/316
- tests/ecdsa_test.py
- )
- epytest
-}
-
-pkg_postinst() {
- # Unpackaged optional backends: yajl, demjson
- optfeature "encoding numpy-based data" dev-python/numpy
- optfeature "encoding pandas objects" dev-python/pandas
- optfeature "fast JSON backend" dev-python/simplejson
-}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/jsonpickle/, dev-python/jsonpickle/files/
@ 2024-06-10 14:41 Michał Górny
0 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2024-06-10 14:41 UTC (permalink / raw
To: gentoo-commits
commit: c42eca470bc5f0f48fc90ab03865f5707c52510a
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 10 14:22:59 2024 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Jun 10 14:41:36 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c42eca47
dev-python/jsonpickle: Add a numpy-2 patch
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
.../files/jsonpickle-3.2.1-numpy-2.patch | 157 +++++++++++++++++++++
dev-python/jsonpickle/jsonpickle-3.2.1.ebuild | 8 +-
2 files changed, 164 insertions(+), 1 deletion(-)
diff --git a/dev-python/jsonpickle/files/jsonpickle-3.2.1-numpy-2.patch b/dev-python/jsonpickle/files/jsonpickle-3.2.1-numpy-2.patch
new file mode 100644
index 000000000000..6fdc989d990e
--- /dev/null
+++ b/dev-python/jsonpickle/files/jsonpickle-3.2.1-numpy-2.patch
@@ -0,0 +1,157 @@
+From 0ab3cf0ffcdb364a8a75e71acfb267e5aaabc0a0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Mon, 10 Jun 2024 03:55:47 +0200
+Subject: [PATCH 1/2] Fix data types in tests for NumPy 2
+
+Fix a number of test compatibility issues with NumPy 2. That is:
+
+- replace `np.float_` with `np.float64`,
+- replace `np.complex_` with `np.complex128`,
+- remove `np.unicode_` as equivalent to `np.str_`.
+
+The LHS types are also aliases to the RHS types in NumPy 1.x, so this
+is NFC on NumPy 1.x. These aliases were removed in 2.x, so the code
+needs to be updated for tests to pass on NumPy 2.x.
+---
+ tests/numpy_test.py | 7 ++-----
+ tests/pandas_test.py | 13 +++++--------
+ 2 files changed, 7 insertions(+), 13 deletions(-)
+
+diff --git a/tests/numpy_test.py b/tests/numpy_test.py
+index e271725..dd50d5e 100644
+--- a/tests/numpy_test.py
++++ b/tests/numpy_test.py
+@@ -32,9 +32,7 @@ def test_dtype_roundtrip():
+ dtypes = [
+ np.int_,
+ np.int32,
+- np.float_,
+ np.float64,
+- np.complex_,
+ np.complex128,
+ np.str_,
+ np.object_,
+@@ -86,15 +84,14 @@ def test_generic_roundtrip():
+ values = [
+ np.int_(1),
+ np.int32(-2),
+- np.float_(2.5),
++ np.float64(2.5),
+ np.nan,
+ -np.inf,
+ np.inf,
+ np.datetime64('2014-01-01'),
+ np.str_('foo'),
+- np.unicode_('bar'),
+ np.object_({'a': 'b'}),
+- np.complex_(1 - 2j),
++ np.complex128(1 - 2j),
+ ]
+ for value in values:
+ decoded = roundtrip(value)
+diff --git a/tests/pandas_test.py b/tests/pandas_test.py
+index 532563f..414bd65 100644
+--- a/tests/pandas_test.py
++++ b/tests/pandas_test.py
+@@ -34,14 +34,13 @@ def test_series_roundtrip():
+ ser = pd.Series(
+ {
+ 'an_int': np.int_(1),
+- 'a_float': np.float_(2.5),
++ 'a_float': np.float64(2.5),
+ 'a_nan': np.nan,
+ 'a_minus_inf': -np.inf,
+ 'an_inf': np.inf,
+ 'a_str': np.str_('foo'),
+- 'a_unicode': np.unicode_('bar'),
+ 'date': np.datetime64('2014-01-01'),
+- 'complex': np.complex_(1 - 2j),
++ 'complex': np.complex128(1 - 2j),
+ # TODO: the following dtypes are not currently supported.
+ # 'object': np.object_({'a': 'b'}),
+ }
+@@ -54,14 +53,13 @@ def test_dataframe_roundtrip():
+ df = pd.DataFrame(
+ {
+ 'an_int': np.int_([1, 2, 3]),
+- 'a_float': np.float_([2.5, 3.5, 4.5]),
++ 'a_float': np.float64([2.5, 3.5, 4.5]),
+ 'a_nan': np.array([np.nan] * 3),
+ 'a_minus_inf': np.array([-np.inf] * 3),
+ 'an_inf': np.array([np.inf] * 3),
+ 'a_str': np.str_('foo'),
+- 'a_unicode': np.unicode_('bar'),
+ 'date': np.array([np.datetime64('2014-01-01')] * 3, dtype="datetime64[s]"),
+- 'complex': np.complex_([1 - 2j, 2 - 1.2j, 3 - 1.3j]),
++ 'complex': np.complex128([1 - 2j, 2 - 1.2j, 3 - 1.3j]),
+ # TODO: the following dtypes are not currently supported.
+ # 'object': np.object_([{'a': 'b'}]*3),
+ }
+@@ -76,12 +74,11 @@ def test_multindex_dataframe_roundtrip():
+ 'idx_lvl0': ['a', 'b', 'c'],
+ 'idx_lvl1': np.int_([1, 1, 2]),
+ 'an_int': np.int_([1, 2, 3]),
+- 'a_float': np.float_([2.5, 3.5, 4.5]),
++ 'a_float': np.float64([2.5, 3.5, 4.5]),
+ 'a_nan': np.array([np.nan] * 3),
+ 'a_minus_inf': np.array([-np.inf] * 3),
+ 'an_inf': np.array([np.inf] * 3),
+ 'a_str': np.str_('foo'),
+- 'a_unicode': np.unicode_('bar'),
+ }
+ )
+ df = df.set_index(['idx_lvl0', 'idx_lvl1'])
+
+From 8bc2bdd42bc111d90edbcef8005640d5a51627bf Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Mon, 10 Jun 2024 04:02:17 +0200
+Subject: [PATCH 2/2] Fix `newbyteorder()` use for NumPy 2.x
+
+Replace the `arr.newbyteorder()` use with:
+
+ arr.view(arr.dtype.newbyteorder())
+
+as suggested in the exception that's raised when the tests are run
+in NumPy 2.x. With this change, the code works both with NumPy 1.x
+and NumPy 2.x.
+---
+ tests/numpy_test.py | 24 ++++++++++++++----------
+ 1 file changed, 14 insertions(+), 10 deletions(-)
+
+diff --git a/tests/numpy_test.py b/tests/numpy_test.py
+index dd50d5e..2e6725b 100644
+--- a/tests/numpy_test.py
++++ b/tests/numpy_test.py
+@@ -306,18 +306,22 @@ def test_immutable():
+ def test_byteorder():
+ """Test the byteorder for text and binary encodings"""
+ # small arr is stored as text
+- a = np.arange(10).newbyteorder()
+- b = a[:].newbyteorder()
+- _a, _b = roundtrip([a, b])
+- npt.assert_array_equal(a, _a)
+- npt.assert_array_equal(b, _b)
++ a = np.arange(10)
++ av = a.view(a.dtype.newbyteorder())
++ b = a[:]
++ bv = b.view(b.dtype.newbyteorder())
++ _av, _bv = roundtrip([av, bv])
++ npt.assert_array_equal(av, _av)
++ npt.assert_array_equal(bv, _bv)
+
+ # bigger arr is stored as binary
+- a = np.arange(100).newbyteorder()
+- b = a[:].newbyteorder()
+- _a, _b = roundtrip([a, b])
+- npt.assert_array_equal(a, _a)
+- npt.assert_array_equal(b, _b)
++ a = np.arange(100)
++ av = a.view(a.dtype.newbyteorder())
++ b = a[:]
++ bv = b.view(b.dtype.newbyteorder())
++ _av, _bv = roundtrip([av, bv])
++ npt.assert_array_equal(av, _av)
++ npt.assert_array_equal(bv, _bv)
+
+
+ def test_zero_dimensional_array():
diff --git a/dev-python/jsonpickle/jsonpickle-3.2.1.ebuild b/dev-python/jsonpickle/jsonpickle-3.2.1.ebuild
index 3bed0a414fd2..155b209d25ad 100644
--- a/dev-python/jsonpickle/jsonpickle-3.2.1.ebuild
+++ b/dev-python/jsonpickle/jsonpickle-3.2.1.ebuild
@@ -38,8 +38,14 @@ BDEPEND="
distutils_enable_tests pytest
python_prepare_all() {
- sed -i -e 's:--cov::' pytest.ini || die
+ local PATCHES=(
+ # https://github.com/jsonpickle/jsonpickle/pull/512
+ "${FILESDIR}/${P}-numpy-2.patch"
+ )
+
distutils-r1_python_prepare_all
+
+ sed -i -e 's:--cov::' pytest.ini || die
export SETUPTOOLS_SCM_PRETEND_VERSION=${PV}
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/jsonpickle/, dev-python/jsonpickle/files/
@ 2022-10-17 11:53 Andrew Ammerlaan
0 siblings, 0 replies; 4+ messages in thread
From: Andrew Ammerlaan @ 2022-10-17 11:53 UTC (permalink / raw
To: gentoo-commits
commit: 433700e8ebfb60937f7004051f5079379d39e2b2
Author: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 17 11:07:16 2022 +0000
Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Mon Oct 17 11:07:16 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=433700e8
dev-python/jsonpickle: enable python3.11
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>
.../files/jsonpickle-2.2.0-python3.11.patch | 46 ++++++++++++++++
dev-python/jsonpickle/jsonpickle-2.2.0-r1.ebuild | 63 ++++++++++++++++++++++
2 files changed, 109 insertions(+)
diff --git a/dev-python/jsonpickle/files/jsonpickle-2.2.0-python3.11.patch b/dev-python/jsonpickle/files/jsonpickle-2.2.0-python3.11.patch
new file mode 100644
index 000000000000..10c266a2a696
--- /dev/null
+++ b/dev-python/jsonpickle/files/jsonpickle-2.2.0-python3.11.patch
@@ -0,0 +1,46 @@
+diff --git a/jsonpickle/pickler.py b/jsonpickle/pickler.py
+index 3d391cb..2103e46 100644
+--- a/jsonpickle/pickler.py
++++ b/jsonpickle/pickler.py
+@@ -476,8 +476,12 @@ def _flatten_obj_instance(self, obj):
+
+ # Support objects with __getstate__(); this ensures that
+ # both __setstate__() and __getstate__() are implemented
+- has_getstate = hasattr(obj, '__getstate__')
++ has_own_getstate = (
++ hasattr(type(obj), '__getstate__')
++ and type(obj).__getstate__ is not getattr(object, '__getstate__', None)
++ )
+ # not using has_method since __getstate__() is handled separately below
++ # Note: on Python 3.11+, all objects have __getstate__.
+
+ if has_class:
+ cls = obj.__class__
+@@ -549,7 +553,7 @@ def _flatten_obj_instance(self, obj):
+ # check that getstate/setstate is sane
+ if not (
+ state
+- and hasattr(obj, '__getstate__')
++ and has_own_getstate
+ and not hasattr(obj, '__setstate__')
+ and not isinstance(obj, dict)
+ ):
+@@ -581,7 +585,7 @@ def _flatten_obj_instance(self, obj):
+ if has_getinitargs:
+ data[tags.INITARGS] = self._flatten(obj.__getinitargs__())
+
+- if has_getstate:
++ if has_own_getstate:
+ try:
+ state = obj.__getstate__()
+ except TypeError:
+@@ -590,7 +594,8 @@ def _flatten_obj_instance(self, obj):
+ self._pickle_warning(obj)
+ return None
+ else:
+- return self._getstate(state, data)
++ if state:
++ return self._getstate(state, data)
+
+ if util.is_module(obj):
+ if self.unpicklable:
diff --git a/dev-python/jsonpickle/jsonpickle-2.2.0-r1.ebuild b/dev-python/jsonpickle/jsonpickle-2.2.0-r1.ebuild
new file mode 100644
index 000000000000..5d7a8f7f0267
--- /dev/null
+++ b/dev-python/jsonpickle/jsonpickle-2.2.0-r1.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{8..11} )
+
+inherit distutils-r1 optfeature
+
+DESCRIPTION="Python library for serializing any arbitrary object graph into JSON"
+HOMEPAGE="
+ https://github.com/jsonpickle/jsonpickle/
+ https://pypi.org/project/jsonpickle/
+"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86 ~amd64-linux ~x86-linux"
+
+BDEPEND="
+ dev-python/setuptools_scm[${PYTHON_USEDEP}]
+ test? (
+ dev-python/feedparser[${PYTHON_USEDEP}]
+ dev-python/numpy[${PYTHON_USEDEP}]
+ dev-python/pandas[${PYTHON_USEDEP}]
+ dev-python/simplejson[${PYTHON_USEDEP}]
+ dev-python/sqlalchemy[${PYTHON_USEDEP}]
+ dev-python/ujson[${PYTHON_USEDEP}]
+ )
+"
+
+PATCHES=(
+ # https://github.com/jsonpickle/jsonpickle/pull/396
+ "${FILESDIR}/${P}-python3.11.patch"
+)
+
+distutils_enable_tests pytest
+
+python_prepare_all() {
+ sed -i -e 's:--flake8 --cov::' pytest.ini || die
+ distutils-r1_python_prepare_all
+}
+
+python_test() {
+ local EPYTEST_IGNORE=(
+ # unpackaged bson dependency
+ tests/bson_test.py
+ # broken when gmpy is installed
+ # https://github.com/jsonpickle/jsonpickle/issues/328
+ # https://github.com/jsonpickle/jsonpickle/issues/316
+ tests/ecdsa_test.py
+ )
+ epytest
+}
+
+pkg_postinst() {
+ # Unpackaged optional backends: yajl, demjson
+ optfeature "encoding numpy-based data" dev-python/numpy
+ optfeature "encoding pandas objects" dev-python/pandas
+ optfeature "fast JSON backend" dev-python/simplejson
+}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/jsonpickle/, dev-python/jsonpickle/files/
@ 2020-09-12 22:58 Michał Górny
0 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2020-09-12 22:58 UTC (permalink / raw
To: gentoo-commits
commit: c24c654c3d877d497cb5c224b437547fea5b4a1c
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 12 22:52:05 2020 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Sep 12 22:58:21 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c24c654c
dev-python/jsonpickle: Backport importlib_metadata fix + add dep
Backport a fix not to require importlib_metadata in py3.8+, and add
a missing dep on it for earlier implementations.
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
.../jsonpickle-1.4.1-importlib-metadata.patch | 44 ++++++++++++++++++++++
...-1.4.1-r1.ebuild => jsonpickle-1.4.1-r2.ebuild} | 7 ++++
2 files changed, 51 insertions(+)
diff --git a/dev-python/jsonpickle/files/jsonpickle-1.4.1-importlib-metadata.patch b/dev-python/jsonpickle/files/jsonpickle-1.4.1-importlib-metadata.patch
new file mode 100644
index 00000000000..eefb41d73d7
--- /dev/null
+++ b/dev-python/jsonpickle/files/jsonpickle-1.4.1-importlib-metadata.patch
@@ -0,0 +1,44 @@
+From 7e5752de7d49f222cec5107aa5044fa8f8ffbb39 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
+Date: Wed, 22 Apr 2020 20:38:28 +0200
+Subject: [PATCH] Use importlib.metadata from the standard library on Python
+ 3.8+
+
+Fixes https://github.com/jsonpickle/jsonpickle/issues/303
+---
+ jsonpickle/version.py | 7 ++++++-
+ setup.cfg | 2 +-
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/jsonpickle/version.py b/jsonpickle/version.py
+index 01c83c4..92b44b2 100644
+--- a/jsonpickle/version.py
++++ b/jsonpickle/version.py
+@@ -1,5 +1,10 @@
++import sys
++
+ try:
+- import importlib_metadata as metadata
++ if sys.version_info < (3, 8):
++ import importlib_metadata as metadata
++ else:
++ from importlib import metadata
+ except (ImportError, OSError):
+ metadata = None
+
+diff --git a/setup.cfg b/setup.cfg
+index 9f0eab2..46707ec 100644
+--- a/setup.cfg
++++ b/setup.cfg
+@@ -36,7 +36,7 @@ packages = find:
+ include_package_data = true
+ python_requires = >=2.7
+ install_requires =
+- importlib_metadata
++ importlib_metadata; python_version<"3.8"
+ setup_requires = setuptools_scm[toml] >= 3.4.1
+
+ [options.extras_require]
+--
+2.28.0
+
diff --git a/dev-python/jsonpickle/jsonpickle-1.4.1-r1.ebuild b/dev-python/jsonpickle/jsonpickle-1.4.1-r2.ebuild
similarity index 88%
rename from dev-python/jsonpickle/jsonpickle-1.4.1-r1.ebuild
rename to dev-python/jsonpickle/jsonpickle-1.4.1-r2.ebuild
index c990ed01191..752307b9830 100644
--- a/dev-python/jsonpickle/jsonpickle-1.4.1-r1.ebuild
+++ b/dev-python/jsonpickle/jsonpickle-1.4.1-r2.ebuild
@@ -23,6 +23,9 @@ RDEPEND="
dev-python/simplejson[${PYTHON_USEDEP}]
dev-python/feedparser[${PYTHON_USEDEP}]
dev-python/ujson[${PYTHON_USEDEP}]
+ $(python_gen_cond_dep '
+ dev-python/importlib_metadata[${PYTHON_USEDEP}]
+ ' python3_{6,7})
"
# toml via setuptools_scm[toml]
BDEPEND="
@@ -32,6 +35,10 @@ BDEPEND="
distutils_enable_sphinx "docs/source"
distutils_enable_tests pytest
+PATCHES=(
+ "${FILESDIR}"/jsonpickle-1.4.1-importlib-metadata.patch
+)
+
python_prepare_all() {
# too many dependencies
rm tests/pandas_test.py || die
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-06-10 14:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-08 5:16 [gentoo-commits] repo/gentoo:master commit in: dev-python/jsonpickle/, dev-python/jsonpickle/files/ Michał Górny
-- strict thread matches above, loose matches on Subject: below --
2024-06-10 14:41 Michał Górny
2022-10-17 11:53 Andrew Ammerlaan
2020-09-12 22:58 Michał Górny
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox