summaryrefslogtreecommitdiff
path: root/dev-python/isort
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-11-06 16:19:28 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-11-06 16:19:28 +0000
commit9afce155a599e5f4518f3c7913b6424ac13be12e (patch)
tree60420eafdcf940c0e4555d9aa8e4e9017a646344 /dev-python/isort
parenteb7aa327b218d640c8bda63ba0fd1ace2bd2d17b (diff)
gentoo auto-resync : 06:11:2023 - 16:19:27
Diffstat (limited to 'dev-python/isort')
-rw-r--r--dev-python/isort/Manifest3
-rw-r--r--dev-python/isort/files/isort-5.12.0-py312.patch40
-rw-r--r--dev-python/isort/isort-5.12.0.ebuild16
3 files changed, 56 insertions, 3 deletions
diff --git a/dev-python/isort/Manifest b/dev-python/isort/Manifest
index 03f4b7875fa1..33ab1d0297fd 100644
--- a/dev-python/isort/Manifest
+++ b/dev-python/isort/Manifest
@@ -1,3 +1,4 @@
+AUX isort-5.12.0-py312.patch 1563 BLAKE2B 719905427e91895261aa7282cc9f56759b47ec71f8459d3959dfff1f9e254ae7a906d4fc1bfdb241bc20249cd45563854496f6bf1efd1a9cfb74203dc7ba137d SHA512 ecd2b1cb734cfea8a169b5412f221279c226938ec9d18b98b81b6f3fbf122124875236a46f0ac8bb3213f4331c888553d036e6835b826be78fe9dc300bfa1fdb
DIST isort-5.12.0.gh.tar.gz 743141 BLAKE2B a7f8deef02b57162eebe15b35e71382c654372a80dedba7eee63d0c9b0899c053fb517401585af17014db3cf9ed44089f6cbd1e2b0ed17393cc667de06bfbddd SHA512 ceb861d1a077be6fecd82fde775bded1fb676c77135e2004c92a6221762e0b3ff6c1071d17957e1add4062ec26ba6c9264e4905724f2c659339cbd0601f4b45e
-EBUILD isort-5.12.0.ebuild 1463 BLAKE2B 0bf065e04d0b34b77de3a9a7fcbee63ab046c3f21c904f8ccc0062c6ed8bc68f347239867a16dea1b32b3233a3c3483bf6e35dd0f38dc9523ceedf3f5e24901a SHA512 6f25c931b5b30bccc55b53f7cbb0192bc552c425557d0c36efd3e7f8bafa73dbf1782a866a5d8e59e0ccc5d87de70e0fda460e948a5fd84ee01aa68df157a115
+EBUILD isort-5.12.0.ebuild 1685 BLAKE2B a76c9644a61577117de0bad8f8641b600762efce52890d8780233483e7d7890d6a48662838509b731ef34cdc0dab89658f4d6a8b0670c8bb169869b0a8520217 SHA512 1631f65ed82f03e1ab990f9dfeb4c1ed1841223740ea4ad1b672582e9adad3195104b119d81f05d2bbf0bcc1412d934841e56781b7c802b98aa640537c10f62b
MISC metadata.xml 574 BLAKE2B db8aac55351f15190d9b71508268f26b12a781b3b4f0f6836a30efc954b46b71da496129a9641655db483730435b44a5c5283132521dc3cc93279c57735a1ba4 SHA512 c8116bf66155ffeb7ac8d68822559e18252210dae604b4984aa5e6a3fb7161d785cbd235dc6f656513b5bab326f6e579489245bcef9d0a5dfadc34d7477758fb
diff --git a/dev-python/isort/files/isort-5.12.0-py312.patch b/dev-python/isort/files/isort-5.12.0-py312.patch
new file mode 100644
index 000000000000..a6de4a75311b
--- /dev/null
+++ b/dev-python/isort/files/isort-5.12.0-py312.patch
@@ -0,0 +1,40 @@
+From abfb91fd7da34111828d81a20fe7aeaaab7a58c7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Mon, 6 Nov 2023 13:29:21 +0100
+Subject: [PATCH] Fix assertions in `test_git_hook`
+
+Fix `called_once()` assertions in `test_git_hook` to use the correct
+`assert_called_once()` method. The former does not exist, so it
+evaluates to a mocked method in Python < 3.12, making the assert
+meaningless, and it triggers an error in Python 3.12+.
+
+While at it, split the mock into two because otherwise the test would
+fail because two `hooks.git_hook()` calls imply two mock calls.
+---
+ tests/unit/test_hooks.py | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/tests/unit/test_hooks.py b/tests/unit/test_hooks.py
+index 2757f414f..29685f503 100644
+--- a/tests/unit/test_hooks.py
++++ b/tests/unit/test_hooks.py
+@@ -11,7 +11,7 @@ def test_git_hook(src_dir):
+ # Ensure correct subprocess command is called
+ with patch("subprocess.run", MagicMock()) as run_mock:
+ hooks.git_hook()
+- assert run_mock.called_once()
++ run_mock.assert_called_once()
+ assert run_mock.call_args[0][0] == [
+ "git",
+ "diff-index",
+@@ -21,8 +21,9 @@ def test_git_hook(src_dir):
+ "HEAD",
+ ]
+
++ with patch("subprocess.run", MagicMock()) as run_mock:
+ hooks.git_hook(lazy=True)
+- assert run_mock.called_once()
++ run_mock.assert_called_once()
+ assert run_mock.call_args[0][0] == [
+ "git",
+ "diff-index",
diff --git a/dev-python/isort/isort-5.12.0.ebuild b/dev-python/isort/isort-5.12.0.ebuild
index c9fcff720b34..e3f28e100a52 100644
--- a/dev-python/isort/isort-5.12.0.ebuild
+++ b/dev-python/isort/isort-5.12.0.ebuild
@@ -4,7 +4,7 @@
EAPI=8
DISTUTILS_USE_PEP517=poetry
-PYTHON_COMPAT=( python3_{9..11} )
+PYTHON_COMPAT=( python3_{10..12} )
inherit distutils-r1
@@ -31,7 +31,6 @@ BDEPEND="
dev-python/colorama[${PYTHON_USEDEP}]
dev-python/hypothesis[${PYTHON_USEDEP}]
dev-python/natsort[${PYTHON_USEDEP}]
- dev-python/pylama[${PYTHON_USEDEP}]
dev-python/pytest-mock[${PYTHON_USEDEP}]
dev-vcs/git
)
@@ -40,6 +39,11 @@ BDEPEND="
distutils_enable_tests pytest
src_prepare() {
+ local PATCHES=(
+ # https://github.com/PyCQA/isort/pull/2196
+ "${FILESDIR}/${P}-py312.patch"
+ )
+
# unbundle tomli
sed -i -e 's:from ._vendored ::' isort/settings.py || die
rm -r isort/_vendored || die
@@ -63,5 +67,13 @@ python_test() {
# Excluded from upstream's test script
tests/unit/test_deprecated_finders.py
)
+
+ if ! has_version "dev-python/pylama[${PYTHON_USEDEP}]"; then
+ EPYTEST_IGNORE+=(
+ tests/unit/test_importable.py
+ tests/unit/test_pylama_isort.py
+ )
+ fi
+
epytest tests/unit
}