dev-python/virtualenv: Remove python2

Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2020-09-20 15:48:41 +02:00
parent e3ea67130e
commit dce2ca7d7d
2 changed files with 25 additions and 27 deletions

View File

@@ -3,7 +3,7 @@
EAPI=7
PYTHON_COMPAT=( python{2_7,3_{6,7,8,9}} pypy3 )
PYTHON_COMPAT=( python3_{6,7,8,9} pypy3 )
DISTUTILS_USE_SETUPTOOLS=manual
inherit distutils-r1
@@ -26,16 +26,14 @@ RESTRICT="!test? ( test )"
RDEPEND=">=dev-python/setuptools-19.6.2[${PYTHON_USEDEP}]"
BDEPEND="${RDEPEND}
test? (
$(python_gen_cond_dep '
>=dev-python/pip-19.3.1-r1[${PYTHON_USEDEP}]
dev-python/mock[${PYTHON_USEDEP}]
dev-python/pypiserver[${PYTHON_USEDEP}]
dev-python/pytest-localserver[${PYTHON_USEDEP}]
dev-python/pytest-timeout[${PYTHON_USEDEP}]
dev-python/pytest[${PYTHON_USEDEP}]
dev-python/six[${PYTHON_USEDEP}]
dev-python/wheel[${PYTHON_USEDEP}]
' -3)
>=dev-python/pip-19.3.1-r1[${PYTHON_USEDEP}]
dev-python/mock[${PYTHON_USEDEP}]
dev-python/pypiserver[${PYTHON_USEDEP}]
dev-python/pytest-localserver[${PYTHON_USEDEP}]
dev-python/pytest-timeout[${PYTHON_USEDEP}]
dev-python/pytest[${PYTHON_USEDEP}]
dev-python/six[${PYTHON_USEDEP}]
dev-python/wheel[${PYTHON_USEDEP}]
)"
DOCS=( docs/index.rst docs/changes.rst )
@@ -55,13 +53,14 @@ distutils_enable_sphinx docs \
dev-python/towncrier
python_test() {
if ! python_is_python3; then
ewarn "Tests are skipped on py2, please test externally"
return
fi
cp "${S}"/LICENSE.txt "${BUILD_DIR}"/lib || \
die "Could not copy LICENSE.txt with ${EPYTHON}"
pytest -vv tests || die "Tests fail with ${EPYTHON}"
}
pkg_postinst() {
elog "Please note that while virtualenv package no longer supports"
elog "Python 2.7, you can still create py2.7 virtualenvs via:"
elog " $ virtualenv -p /usr/bin/python2.7 ..."
}

View File

@@ -3,7 +3,7 @@
EAPI=7
PYTHON_COMPAT=( python{2_7,3_{6..9}} pypy3 )
PYTHON_COMPAT=( python3_{6..9} pypy3 )
DISTUTILS_USE_SETUPTOOLS=manual
inherit distutils-r1
@@ -28,16 +28,12 @@ RDEPEND="
>=dev-python/filelock-3[${PYTHON_USEDEP}]
>=dev-python/setuptools-41[${PYTHON_USEDEP}]
>=dev-python/six-1.9.0[${PYTHON_USEDEP}]
$(python_gen_cond_dep '
>=dev-python/contextlib2-0.6.0[${PYTHON_USEDEP}]
>=dev-python/pathlib2-2.3.3[${PYTHON_USEDEP}]
' -2)
$(python_gen_cond_dep '
>=dev-python/importlib_metadata-0.12[${PYTHON_USEDEP}]
' -2 python3_{6,7} pypy3)
' python3_{6,7} pypy3)
$(python_gen_cond_dep '
>=dev-python/importlib_resources-1.0[${PYTHON_USEDEP}]
' -2 python3_6 pypy3)"
' python3_6 pypy3)"
# coverage is used somehow magically in virtualenv, maybe it actually
# tests something useful
BDEPEND="
@@ -79,10 +75,7 @@ src_configure() {
}
python_test() {
if ! python_is_python3; then
ewarn "Tests are skipped on py2, please test externally"
return
elif [[ ${EPYTHON} == pypy3 ]]; then
if [[ ${EPYTHON} == pypy3 ]]; then
# TODO: skip with better granularity
ewarn "Skipping broken tests on pypy3"
return
@@ -92,3 +85,9 @@ python_test() {
pytest -vv || die "Tests fail with ${EPYTHON}"
}
pkg_postinst() {
elog "Please note that while virtualenv package no longer supports"
elog "Python 2.7, you can still create py2.7 virtualenvs via:"
elog " $ virtualenv -p 2.7 ..."
}