Commit 6d4e2388 authored by Jason R. Coombs's avatar Jason R. Coombs

Move test dependencies to package metadata.

parent 7cd8b496
......@@ -57,3 +57,16 @@ ssl =
wincertstore==0.2; sys_platform=='win32'
certs =
certifi==2016.9.26
tests =
mock
pytest-flake8
flake8-2020; python_version>="3.6"
virtualenv>=13.0.0
pytest-virtualenv>=1.2.7
pytest>=3.7
wheel
coverage>=4.5.1
pytest-cov>=2.5.1
paver; python_version>="3.6"
futures; python_version=="2.7"
pip>=19.1 # For proper file:// URLs support.
mock
pytest-flake8
flake8-2020; python_version>="3.6"
virtualenv>=13.0.0
pytest-virtualenv>=1.2.7
pytest>=3.7
wheel
coverage>=4.5.1
pytest-cov>=2.5.1
paver; python_version>="3.6"
futures; python_version=="2.7"
pip>=19.1 # For proper file:// URLs support.
import os
import subprocess
import sys
import re
def remove_setuptools():
......@@ -20,12 +21,29 @@ def bootstrap():
subprocess.check_call(cmd)
def is_install_self(args):
"""
Do the args represent an install of .?
"""
def strip_extras(arg):
match = re.match(r'(.*)?\[.*\]$', arg)
return match.group(1) if match else arg
return (
'install' in args
and any(
arg in ['.', os.getcwd()]
for arg in map(strip_extras, args)
)
)
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'
if '.' in args:
if is_install_self(args):
remove_setuptools()
bootstrap()
......
......@@ -13,7 +13,6 @@ requires =
pip = python {toxinidir}/tools/tox_pip.py
[testenv]
deps=-r{toxinidir}/tests/requirements.txt
pip_version = pip
install_command = {[helpers]pip} install {opts} {packages}
list_dependencies_command = {[helpers]pip} freeze --all
......@@ -25,6 +24,8 @@ setenv =
passenv=APPDATA HOMEDRIVE HOMEPATH windir APPVEYOR APPVEYOR_* CI CODECOV_* TRAVIS TRAVIS_* NETWORK_REQUIRED
commands=pytest --cov-config={toxinidir}/tox.ini --cov-report= {posargs}
usedevelop=True
extras =
tests
[testenv:coverage]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment