diff --git a/tests/hghave.py b/tests/hghave.py --- a/tests/hghave.py +++ b/tests/hghave.py @@ -886,17 +886,16 @@ 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 - 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 --- a/tests/test-install.t +++ b/tests/test-install.t @@ -222,13 +222,11 @@ no problems detected #endif -#if py2virtualenv +#if virtualenv no-py3 -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 - $ "$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)