dev-cpp/pangomm: stable 2.42.1 for hppa, bug #717144
[gentoo.git] / dev-python / virtualenv / virtualenv-20.0.18.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}} 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 ~ppc ~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 src_prepare() {
62         # we don't have xonsh
63         rm tests/unit/activation/test_xonsh.py || die
64         # TODO: investigate
65         sed -e 's:test_cross_major:_&:' \
66                 -i tests/unit/create/test_creator.py || die
67
68         distutils-r1_src_prepare
69 }
70
71 src_configure() {
72         export SETUPTOOLS_SCM_PRETEND_VERSION=${PV}
73 }
74
75 python_test() {
76         # TODO: fix/skip with more granularity tests on pypy3
77         if has "${EPYTHON}" pypy3 python2.7; then
78                 einfo "Skipping broken tests on pypy3"
79                 continue
80         fi
81
82         distutils_install_for_testing
83
84         pytest -vv || die "Tests fail with ${EPYTHON}"
85 }