commit:     ce229874b1a5340b2c6f933af3d49ef8a1ff8c28
Author:     Oz Tiram <oz.tiram <AT> gmail <DOT> com>
AuthorDate: Thu Aug 15 10:17:35 2024 +0000
Commit:     Petr Vaněk <arkamar <AT> gentoo <DOT> org>
CommitDate: Thu Aug 15 13:40:30 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ce229874

dev-python/pipdeptree: fix import from pip._vendor

 add dev-python/pytest-console-scripts
 pass -p to epytest

Closes: https://bugs.gentoo.org/937953
Signed-off-by: Oz Tiram <oz.tiram <AT> gmail.com>
Signed-off-by: Petr Vaněk <arkamar <AT> gentoo.org>

 .../files/pipdeptree-2.18.1-fix-pypy-7.3.14.patch        | 16 ++++++++++++----
 dev-python/pipdeptree/pipdeptree-2.18.1.ebuild           | 10 +++++++++-
 2 files changed, 21 insertions(+), 5 deletions(-)

diff --git 
a/dev-python/pipdeptree/files/pipdeptree-2.18.1-fix-pypy-7.3.14.patch 
b/dev-python/pipdeptree/files/pipdeptree-2.18.1-fix-pypy-7.3.14.patch
index 6179d823a021..32d039fed519 100644
--- a/dev-python/pipdeptree/files/pipdeptree-2.18.1-fix-pypy-7.3.14.patch
+++ b/dev-python/pipdeptree/files/pipdeptree-2.18.1-fix-pypy-7.3.14.patch
@@ -1,6 +1,15 @@
---- a/tests/test_non_host.py   2024-06-12 21:33:13.696206671 +0200
-+++ b/tests/test_non_host.py   2024-06-12 21:46:40.146193582 +0200
-@@ -32,10 +32,10 @@
+diff --git a/tests/test_non_host.py b/tests/test_non_host.py
+index 2849375..ed7b7b3 100644
+--- a/tests/test_non_host.py
++++ b/tests/test_non_host.py
+@@ -1,5 +1,6 @@
+ from __future__ import annotations
+
++import json
+ import sys
+ from platform import python_implementation
+ from typing import TYPE_CHECKING
+@@ -31,10 +32,10 @@ def test_custom_interpreter(
      result = virtualenv.cli_run([str(tmp_path / "venv"), "--activators", ""])
      py = str(result.creator.exe.relative_to(tmp_path))
      cmd = ["", f"--python={result.creator.exe}"] if args_joined else ["", 
"--python", py]
@@ -13,4 +22,3 @@
      implementation = python_implementation()
      if implementation == "CPython":
          expected = {"pip", "setuptools", "wheel"}
-

diff --git a/dev-python/pipdeptree/pipdeptree-2.18.1.ebuild 
b/dev-python/pipdeptree/pipdeptree-2.18.1.ebuild
index 3cd1aa8e171f..b99c9659bda4 100644
--- a/dev-python/pipdeptree/pipdeptree-2.18.1.ebuild
+++ b/dev-python/pipdeptree/pipdeptree-2.18.1.ebuild
@@ -26,6 +26,7 @@ BDEPEND="
        dev-python/hatch-vcs[${PYTHON_USEDEP}]
        test? (
                dev-python/graphviz[${PYTHON_USEDEP}]
+               >=dev-python/pytest-console-scripts-1.4.1[${PYTHON_USEDEP}]
                dev-python/pytest-mock[${PYTHON_USEDEP}]
                dev-python/virtualenv[${PYTHON_USEDEP}]
        )
@@ -39,9 +40,16 @@ PATCHES=(
 
 distutils_enable_tests pytest
 
+src_prepare() {
+       distutils-r1_src_prepare
+
+       find -name '*.py' -exec \
+               sed -i -e 's:pip[.]_vendor[.]::' {} + || die
+}
+
 python_test() {
        local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
-       epytest -p pytest_mock
+       epytest -p pytest_mock -p console-scripts
 }
 
 pkg_postinst() {

Reply via email to