1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python{2_7,3_{6,7,8,9}} pypy3 )
7 DISTUTILS_USE_SETUPTOOLS=manual
11 DESCRIPTION="Virtual Python Environment builder"
13 https://virtualenv.pypa.io/en/stable/
14 https://pypi.org/project/virtualenv/
15 https://github.com/pypa/virtualenv/
17 SRC_URI="https://github.com/pypa/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
20 KEYWORDS="~amd64 ~arm64 ~ia64 ~ppc ~ppc64 ~x86"
23 RESTRICT="!test? ( test )"
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}]
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
44 dev-python/setuptools_scm[${PYTHON_USEDEP}]
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}]
56 distutils_enable_sphinx docs \
57 dev-python/sphinx_rtd_theme \
59 distutils_enable_tests pytest
62 "${FILESDIR}"/${P}-py39.patch
67 rm tests/unit/activation/test_xonsh.py || die
69 sed -e 's:test_seed_link_via_app_data:_&:' \
70 -i tests/unit/seed/test_boostrap_link_via_app_data.py || die
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
77 distutils-r1_src_prepare
81 export SETUPTOOLS_SCM_PRETEND_VERSION=${PV}
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"
91 distutils_install_for_testing
93 pytest -vv || die "Tests fail with ${EPYTHON}"