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@gmail.com>
Signed-off-by: Petr Vaněk <arkamar@gentoo.org>
This commit is contained in:
Oz Tiram
2024-08-15 12:17:35 +02:00
committed by Petr Vaněk
parent 2253836869
commit ce229874b1
2 changed files with 21 additions and 5 deletions

View File

@@ -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"}

View File

@@ -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() {