commit:     dce2ca7d7db3a6260762217db5a98be0d7e4f73a
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 20 13:48:41 2020 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Sep 20 14:08:48 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dce2ca7d

dev-python/virtualenv: Remove python2

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 ...16.7.10.ebuild => virtualenv-16.7.10-r1.ebuild} | 31 +++++++++++-----------
 ...20.0.31.ebuild => virtualenv-20.0.31-r1.ebuild} | 21 +++++++--------
 2 files changed, 25 insertions(+), 27 deletions(-)

diff --git a/dev-python/virtualenv/virtualenv-16.7.10.ebuild 
b/dev-python/virtualenv/virtualenv-16.7.10-r1.ebuild
similarity index 70%
rename from dev-python/virtualenv/virtualenv-16.7.10.ebuild
rename to dev-python/virtualenv/virtualenv-16.7.10-r1.ebuild
index e4d99e7a79d..898e23e80b6 100644
--- a/dev-python/virtualenv/virtualenv-16.7.10.ebuild
+++ b/dev-python/virtualenv/virtualenv-16.7.10-r1.ebuild
@@ -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 ..."
+}

diff --git a/dev-python/virtualenv/virtualenv-20.0.31.ebuild 
b/dev-python/virtualenv/virtualenv-20.0.31-r1.ebuild
similarity index 86%
rename from dev-python/virtualenv/virtualenv-20.0.31.ebuild
rename to dev-python/virtualenv/virtualenv-20.0.31-r1.ebuild
index 874b73871c3..4e1a69e4749 100644
--- a/dev-python/virtualenv/virtualenv-20.0.31.ebuild
+++ b/dev-python/virtualenv/virtualenv-20.0.31-r1.ebuild
@@ -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 ..."
+}

Reply via email to