summaryrefslogtreecommitdiff
path: root/dev-python/braintree
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/braintree')
-rw-r--r--dev-python/braintree/Manifest3
-rw-r--r--dev-python/braintree/braintree-4.23.0.ebuild7
-rw-r--r--dev-python/braintree/files/braintree-4.23.0-py312.patch81
3 files changed, 89 insertions, 2 deletions
diff --git a/dev-python/braintree/Manifest b/dev-python/braintree/Manifest
index 1c0126387859..43b5df326f91 100644
--- a/dev-python/braintree/Manifest
+++ b/dev-python/braintree/Manifest
@@ -1,3 +1,4 @@
+AUX braintree-4.23.0-py312.patch 3071 BLAKE2B 827df33cf30a5bfb8c233fbada4fbe9e06ccb5952d68e20f71b781d62bd79ab3a8fea46555c7df3d0c6679ec324e203ea78a295b2f23723e1ff8c7e59afd8842 SHA512 add39a785694faeb2ef7bf6e7e25aeb7d7f89f006919ba3294aad4978b0d23949e438303472d1474824ed328b932010be9d24326aaee07cb7feff0fb3633ac82
DIST braintree_python-4.23.0.gh.tar.gz 220576 BLAKE2B 23d158c0216a63ce7746a521c339663dc4f1fcc355f3cf65d526c19f7b6a29e49da6a8905059a1410bcf0390c7d44bc267963d68e44e5f4ddc0de57b2500c06f SHA512 e5be83985a6605e68317eafa7533e826d3965707e691791a045f1cbeddded718b21d62e5156c402142228742b13de9859e586b4236865ea675c5c57a3410ffb3
-EBUILD braintree-4.23.0.ebuild 793 BLAKE2B 47195a75604a7c00b3a29d41f11242b0ca4015130e01792ae6317510d2fe7098656f941e3132ffb8335fbb48ff11b3ec24b5ee1cc040be38bbdba48f4c1c09a9 SHA512 3d61c2c378cceddbad9f1317f36de0454b5eccc496bf5ec151a55817cf18f2572e2b1d63f2630212a7dc62cb7d5a125620758249b2f3fda3ab3af5089e994a23
+EBUILD braintree-4.23.0.ebuild 896 BLAKE2B a9112a658e1329ae3a33e72fb3e7096b28b14785f02a3418c0c1202de8d1428ac0703a6de9708f2edbc3fd81b8900f0aba445375b731c7e887cadf6d7504a810 SHA512 cff9fbe2f2063a30505c07702e88dda69988f3798fee24b4205ea1dfe6792e9c5a85afea74896eddec3bd2b4a1786c77e87844babc7d35077837086ea4738914
MISC metadata.xml 484 BLAKE2B 17a5993a7630126f55e88b92bf917ae068282c36813ea739407b65d91542d2a9977f3057889838bce776b38c5e64e4a17fabc3367ac01ae8512d06897de1a060 SHA512 c0f5406afc289683369998c79009defdd07735e6aaf60d777e524eee6c58dbaff4b936e990490cd15cd53f175accbfb3adbe55896511c79e9655f08bda24ba49
diff --git a/dev-python/braintree/braintree-4.23.0.ebuild b/dev-python/braintree/braintree-4.23.0.ebuild
index c50e26d97b9e..06d433d74228 100644
--- a/dev-python/braintree/braintree-4.23.0.ebuild
+++ b/dev-python/braintree/braintree-4.23.0.ebuild
@@ -4,7 +4,7 @@
EAPI=8
DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{10..11} )
+PYTHON_COMPAT=( python3_{10..12} )
inherit distutils-r1
@@ -34,6 +34,11 @@ DOCS=( README.md )
distutils_enable_tests unittest
+PATCHES=(
+ # https://github.com/braintree/braintree_python/pull/154
+ "${FILESDIR}/${P}-py312.patch"
+)
+
python_test() {
eunittest tests/unit
}
diff --git a/dev-python/braintree/files/braintree-4.23.0-py312.patch b/dev-python/braintree/files/braintree-4.23.0-py312.patch
new file mode 100644
index 000000000000..4ecbd9e555dd
--- /dev/null
+++ b/dev-python/braintree/files/braintree-4.23.0-py312.patch
@@ -0,0 +1,81 @@
+From 9fbdf874ef6a6874db5e98cb2c93ab9736810d4e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Sun, 29 Oct 2023 11:18:56 +0100
+Subject: [PATCH] Fix test suite compatibility with Python 3.12
+
+Replace the deprecated `unittest.TestCase.assertRaisesRegexp()` method
+with `assertRaisesRegex()`. The former is no longer present in Python
+3.12, while the latter is available since Python 3.2.
+
+Replace the deprecated `imp.reload()` function with
+`importlib.reload()`. The former module is no longer present
+in Python 3.12, while `importlib.reload()` is available since
+Python 3.4.
+
+With these changes, unit tests pass with Python 3.12.0.
+
+Fixes #153
+---
+ CHANGELOG.md | 3 +++
+ tests/unit/test_client_token.py | 2 +-
+ tests/unit/test_configuration.py | 6 +++---
+ 3 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/CHANGELOG.md b/CHANGELOG.md
+index 56e4373..792ee9c 100644
+--- a/CHANGELOG.md
++++ b/CHANGELOG.md
+@@ -1,5 +1,8 @@
+ # Changelog
+
++## 4.24.0
++* Fix unittest compatibility with Python 3.12
++
+ ## 4.23.0
+ * Deprecate `evidenceSubmittable` in Dispute
+ * Add missing `escape` calls in `generator` for:
+diff --git a/tests/unit/test_client_token.py b/tests/unit/test_client_token.py
+index 7216a6b..74eb8a2 100644
+--- a/tests/unit/test_client_token.py
++++ b/tests/unit/test_client_token.py
+@@ -3,7 +3,7 @@ from tests.test_helper import *
+ class TestClientToken(unittest.TestCase):
+ def test_credit_card_options_require_customer_id(self):
+ for option in ["verify_card", "make_default", "fail_on_duplicate_payment_method"]:
+- with self.assertRaisesRegexp(InvalidSignatureError, option):
++ with self.assertRaisesRegex(InvalidSignatureError, option):
+ ClientToken.generate({
+ "options": {option: True}
+ })
+diff --git a/tests/unit/test_configuration.py b/tests/unit/test_configuration.py
+index cf82831..5b24540 100644
+--- a/tests/unit/test_configuration.py
++++ b/tests/unit/test_configuration.py
+@@ -1,13 +1,13 @@
+ from tests.test_helper import *
+ import braintree
+ import os
+-import imp
++import importlib
+
+ class TestConfiguration(unittest.TestCase):
+ def test_works_with_unconfigured_configuration(self):
+ try:
+ # reset class level attributes on Configuration set in test helper
+- imp.reload(braintree.configuration)
++ importlib.reload(braintree.configuration)
+ config = Configuration(
+ environment=braintree.Environment.Sandbox,
+ merchant_id='my_merchant_id',
+@@ -21,7 +21,7 @@ class TestConfiguration(unittest.TestCase):
+ finally:
+ # repopulate class level attributes on Configuration
+ import tests.test_helper
+- imp.reload(tests.test_helper)
++ importlib.reload(tests.test_helper)
+
+ def test_base_merchant_path_for_development(self):
+ self.assertEqual("/merchants/integration_merchant_id", Configuration.instantiate().base_merchant_path())
+--
+2.42.0
+