Skip to content

Commit

Permalink
Merge pull request #1961 from pypa/restore-python2-tests
Browse files Browse the repository at this point in the history
Restore testing on Python 2, bypassing the requires-python check when installing Setuptools.
  • Loading branch information
jaraco committed Jan 12, 2020
2 parents 3359377 + cb2138e commit 7bac1ed
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .travis.yml
Expand Up @@ -4,6 +4,11 @@ language: python
jobs:
fast_finish: true
include:
- &latest_py2
python: 2.7
env: TOXENV=py27
- <<: *latest_py2
env: LANG=C TOXENV=py27
- python: pypy3
env: DISABLE_COVERAGE=1 # Don't run coverage on pypy (too slow).
- python: 3.5
Expand Down
5 changes: 5 additions & 0 deletions tools/tox_pip.py
@@ -1,3 +1,4 @@
import os
import subprocess
import sys

Expand All @@ -14,6 +15,10 @@ def remove_setuptools():


def pip(args):
# Honor requires-python when installing test suite dependencies
if any('-r' in arg for arg in args):
os.environ['PIP_IGNORE_REQUIRES_PYTHON'] = '0'

# When installing '.', remove setuptools
'.' in args and remove_setuptools()

Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Expand Up @@ -19,7 +19,9 @@ deps=-r{toxinidir}/tests/requirements.txt
pip_version = pip
install_command = {[helpers]pip} install {opts} {packages}
list_dependencies_command = {[helpers]pip} freeze --all
setenv=COVERAGE_FILE={toxworkdir}/.coverage.{envname}
setenv =
COVERAGE_FILE={toxworkdir}/.coverage.{envname}
py27: PIP_IGNORE_REQUIRES_PYTHON=true
# TODO: The passed environment variables came from copying other tox.ini files
# These should probably be individually annotated to explain what needs them.
passenv=APPDATA HOMEDRIVE HOMEPATH windir APPVEYOR APPVEYOR_* CI CODECOV_* TRAVIS TRAVIS_* NETWORK_REQUIRED
Expand Down

0 comments on commit 7bac1ed

Please sign in to comment.