blob: f3894ca4fca69a3eb95205a9a9cc477ee4d47eec (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_SINGLE_IMPL=1
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{11..13} )
inherit distutils-r1 pypi
DESCRIPTION="Set of extensions to Ian Bicking's virtualenv tool"
HOMEPAGE="
https://github.com/python-virtualenvwrapper/virtualenvwrapper/
https://pypi.org/project/virtualenvwrapper/
"
LICENSE="BSD"
SLOT="0"
KEYWORDS="amd64 ~ppc64 x86"
IUSE="test"
RESTRICT="!test? ( test )"
RDEPEND="
$(python_gen_cond_dep '
dev-python/stevedore[${PYTHON_USEDEP}]
dev-python/virtualenv[${PYTHON_USEDEP}]
dev-python/virtualenv-clone[${PYTHON_USEDEP}]
')
"
BDEPEND="
$(python_gen_cond_dep '
dev-python/setuptools-scm[${PYTHON_USEDEP}]
')
test? (
$(python_gen_cond_dep '
dev-python/pip[${PYTHON_USEDEP}]
')
)
"
PATCHES=(
"${FILESDIR}/virtualenvwrapper-6.0.0-remove-use-of-which.patch"
"${FILESDIR}/virtualenvwrapper-4.8.4_p20230121-override-default-python-executable.patch"
)
src_prepare() {
default
# specify default python interpeter to align with PYTHON_SINGLE_TARGET
sed -i -e "s:@@GENTOO_PYTHON_EXECUTABLE@@:${PYTHON}:" virtualenvwrapper.sh || die
# remove tests which require an internet connection + bug #936086
rm tests/test_mkvirtualenv_install.sh || die
rm tests/test_mkvirtualenv_requirements.sh || die
sed -i -e '/test_new_env_activated () {/,/}/ d' tests/test_cp.sh || die
sed -i -e '/test_wipeenv () {/,/}/ d' tests/test_wipeenv.sh || die
# remove tests which require functional git repos with remotes
sed -i -e '/test_wipeenv_\(pip_e\|develop\) () {/,/}/ d' tests/test_wipeenv.sh || die
}
python_test() {
# tests have unusual expectations
local -x HOME="${HOME%/}"
local -x USER="${USER}"
local -x USING_TOX=1
# Make sure that users env doesn't leak to tests
unset VIRTUALENVWRAPPER_SCRIPT
unset _VIRTUALENVWRAPPER_API
local old_path="${PATH}"
# Tests are based on how upstream tox handles it
cp -a "${BUILD_DIR}"/{install/usr,test_bash} || die
local -x VIRTUAL_ENV="${BUILD_DIR}/test_bash"
touch "${VIRTUAL_ENV}"/bin/activate || die # silence warning
local -x PATH="${VIRTUAL_ENV}/bin:${old_path}"
local -x SHELL="/bin/bash"
local -x test_shell_opts=
bash ./tests/run_tests "${VIRTUAL_ENV}" || die "Tests failed under ${EPYTHON} with bash"
if has_version app-shells/zsh; then
cp -a "${BUILD_DIR}"/{install/usr,test_zsh} || die
local -x VIRTUAL_ENV="${BUILD_DIR}/test_zsh"
touch "${VIRTUAL_ENV}"/bin/activate || die # silence warning
local -x PATH="${VIRTUAL_ENV}/bin:${old_path}"
local -x SHELL="/bin/zsh"
local -x test_shell_opts="-o shwordsplit"
zsh -o shwordsplit ./tests/run_tests "${VIRTUAL_ENV}" || die "Tests failed under ${EPYTHON} with zsh"
fi
}
|