diff --git a/tests/hghave.py b/tests/hghave.py index 4d5e2fd53707527129c353bb8eaa1246c6f7f1da_dGVzdHMvaGdoYXZlLnB5..1b5e0d0bdb05d724abbf049fcbca00ba6e905208_dGVzdHMvaGdoYXZlLnB5 100644 --- a/tests/hghave.py +++ b/tests/hghave.py @@ -886,11 +886,8 @@ return False -@check("py2virtualenv", "Python2 virtualenv support") -def has_py2virtualenv(): - if sys.version_info[0] != 2: - return False - +@check("virtualenv", "virtualenv support") +def has_virtualenv(): try: import virtualenv @@ -894,9 +891,11 @@ try: import virtualenv - virtualenv.ACTIVATE_SH - return True - except ImportError: + # --no-site-package became the default in 1.7 (Nov 2011), and the + # argument was removed in 20.0 (Feb 2020). Rather than make the + # script complicated, just ignore ancient versions. + return int(virtualenv.__version__.split('.')[0]) > 1 + except (AttributeError, ImportError, IndexError): return False diff --git a/tests/test-install.t b/tests/test-install.t index 4d5e2fd53707527129c353bb8eaa1246c6f7f1da_dGVzdHMvdGVzdC1pbnN0YWxsLnQ=..1b5e0d0bdb05d724abbf049fcbca00ba6e905208_dGVzdHMvdGVzdC1pbnN0YWxsLnQ= 100644 --- a/tests/test-install.t +++ b/tests/test-install.t @@ -222,5 +222,5 @@ no problems detected #endif -#if py2virtualenv +#if virtualenv no-py3 @@ -226,5 +226,3 @@ -Note: --no-site-packages is deprecated, but some places have an -ancient virtualenv from their linux distro or similar and it's not yet -the default for them. +Note: --no-site-packages is the default for all versions enabled by hghave @@ -230,5 +228,5 @@ - $ "$PYTHON" -m virtualenv --no-site-packages --never-download installenv >> pip.log + $ "$PYTHON" -m virtualenv --never-download installenv >> pip.log DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. (?) DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support (?) @@ -237,6 +235,7 @@ $ ./installenv/*/pip install --no-index $TESTDIR/.. >> pip.log DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. (?) DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support (?) + DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality. (?) $ ./installenv/*/hg debuginstall || cat pip.log checking encoding (ascii)... checking Python executable (*) (glob)