dev-python/virtualenv: arm64 keyworded (bug #700918)
[gentoo.git] / dev-python / virtualenv / virtualenv-20.0.21.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python{2_7,3_{6,7,8,9}} pypy3 )
7 DISTUTILS_USE_SETUPTOOLS=manual
8
9 inherit distutils-r1
10
11 DESCRIPTION="Virtual Python Environment builder"
12 HOMEPAGE="
13         https://virtualenv.pypa.io/en/stable/
14         https://pypi.org/project/virtualenv/
15         https://github.com/pypa/virtualenv/
16 "
17 SRC_URI="https://github.com/pypa/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
18
19 LICENSE="MIT"
20 KEYWORDS="~amd64 ~arm64 ~ia64 ~ppc ~ppc64 ~x86"
21 SLOT="0"
22 IUSE="test"
23 RESTRICT="!test? ( test )"
24
25 RDEPEND="
26         >=dev-python/appdirs-1.4.3[${PYTHON_USEDEP}]
27         >=dev-python/distlib-0.3.0[${PYTHON_USEDEP}]
28         >=dev-python/filelock-3[${PYTHON_USEDEP}]
29         >=dev-python/setuptools-41[${PYTHON_USEDEP}]
30         >=dev-python/six-1.9.0[${PYTHON_USEDEP}]
31         $(python_gen_cond_dep '
32                 >=dev-python/contextlib2-0.6.0[${PYTHON_USEDEP}]
33                 >=dev-python/pathlib2-2.3.3[${PYTHON_USEDEP}]
34         ' -2)
35         $(python_gen_cond_dep '
36                 >=dev-python/importlib_metadata-0.12[${PYTHON_USEDEP}]
37         ' -2 python3_{6,7} pypy3)
38         $(python_gen_cond_dep '
39                 >=dev-python/importlib_resources-1.0[${PYTHON_USEDEP}]
40         ' -2 python3_6 pypy3)"
41 # coverage is used somehow magically in virtualenv, maybe it actually
42 # tests something useful
43 BDEPEND="${RDEPEND}
44         dev-python/setuptools_scm[${PYTHON_USEDEP}]
45         test? (
46                 dev-python/coverage[${PYTHON_USEDEP}]
47                 >=dev-python/pip-20.0.2[${PYTHON_USEDEP}]
48                 >=dev-python/pytest-mock-2.0.0[${PYTHON_USEDEP}]
49                 >=dev-python/pytest-timeout-1.3.4[${PYTHON_USEDEP}]
50                 dev-python/wheel[${PYTHON_USEDEP}]
51                 $(python_gen_cond_dep '
52                         >=dev-python/packaging-20.0[${PYTHON_USEDEP}]
53                 ' -3)
54         )"
55
56 distutils_enable_sphinx docs \
57         dev-python/sphinx_rtd_theme \
58         dev-python/towncrier
59 distutils_enable_tests pytest
60
61 PATCHES=(
62         "${FILESDIR}"/${P}-py39.patch
63 )
64
65 src_prepare() {
66         # we don't have xonsh
67         rm tests/unit/activation/test_xonsh.py || die
68         # require internet
69         sed -e 's:test_seed_link_via_app_data:_&:' \
70                 -i tests/unit/seed/test_boostrap_link_via_app_data.py || die
71         # TODO: investigate
72         sed -e 's:test_cross_major:_&:' \
73                 -i tests/unit/create/test_creator.py || die
74         sed -e 's:test_py_info_to_system_raises:_&:' \
75                 -i tests/unit/discovery/py_info/test_py_info.py || die
76
77         distutils-r1_src_prepare
78 }
79
80 src_configure() {
81         export SETUPTOOLS_SCM_PRETEND_VERSION=${PV}
82 }
83
84 python_test() {
85         # TODO: fix/skip with more granularity tests on pypy3
86         if has "${EPYTHON}" pypy3 python2.7; then
87                 einfo "Skipping broken tests on pypy3"
88                 continue
89         fi
90
91         distutils_install_for_testing
92
93         pytest -vv || die "Tests fail with ${EPYTHON}"
94 }