summaryrefslogtreecommitdiff
path: root/dev-python/pipx/pipx-1.4.1.ebuild
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/pipx/pipx-1.4.1.ebuild')
-rw-r--r--dev-python/pipx/pipx-1.4.1.ebuild45
1 files changed, 42 insertions, 3 deletions
diff --git a/dev-python/pipx/pipx-1.4.1.ebuild b/dev-python/pipx/pipx-1.4.1.ebuild
index 1b7ee2c493b3..388b94a953f1 100644
--- a/dev-python/pipx/pipx-1.4.1.ebuild
+++ b/dev-python/pipx/pipx-1.4.1.ebuild
@@ -8,6 +8,7 @@ PYTHON_COMPAT=( python3_{10..12} )
inherit distutils-r1
+TEST_SHIM=pipx-1.4.1-test-shim
DESCRIPTION="Install and Run Python Applications in Isolated Environments"
HOMEPAGE="
https://pipx.pypa.io/stable/
@@ -18,6 +19,9 @@ HOMEPAGE="
SRC_URI="
https://github.com/pypa/pipx/archive/${PV}.tar.gz
-> ${P}.gh.tar.gz
+ test? (
+ https://dev.gentoo.org/~mgorny/dist/${TEST_SHIM}.tar.xz
+ )
"
LICENSE="MIT"
@@ -35,14 +39,49 @@ RDEPEND="
"
BDEPEND="
dev-python/hatch-vcs[${PYTHON_USEDEP}]
+ test? (
+ dev-python/ensurepip-pip
+ dev-python/ensurepip-setuptools
+ dev-python/ensurepip-wheel
+ dev-python/pypiserver[${PYTHON_USEDEP}]
+ )
"
-PROPERTIES="test_network"
-RESTRICT="test"
+EPYTEST_XDIST=1
distutils_enable_tests pytest
export SETUPTOOLS_SCM_PRETEND_VERSION=${PV}
+src_prepare() {
+ if use test; then
+ cp -vs "${BROOT}"/usr/lib/python/ensurepip/{pip,setuptools,wheel}-*.whl \
+ "${WORKDIR}/${TEST_SHIM}/" || die
+ mkdir -p .pipx_tests/package_cache || die
+ local v
+ for v in 3.{10..12}; do
+ ln -s "${WORKDIR}/${TEST_SHIM}" \
+ ".pipx_tests/package_cache/${v}" || die
+ done
+
+ : > scripts/update_package_cache.py || die
+ # sigh
+ sed -e 's:server = str.*:server = "pypi-server":' \
+ -i tests/conftest.py || die
+ fi
+
+ distutils-r1_src_prepare
+}
+
python_test() {
- epytest --net-pypiserver
+ local EPYTEST_DESELECT=(
+ # Internet
+ tests/test_run.py::test_run_ensure_null_pythonpath
+ tests/test_run.py::test_run_script_from_internet
+ 'tests/test_install.py::test_install_package_specs[pycowsay-git+https://github.com/cs01/pycowsay.git@master]'
+ tests/test_install.py::test_force_install_changes
+ 'tests/test_install.py::test_install_package_specs[nox-https://github.com/wntrblm/nox/archive/2022.1.7.zip]'
+ )
+
+ local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
+ epytest -x
}