Commit 5ef7e75d authored by mergify[bot]'s avatar mergify[bot] Committed by GitHub

Merge pull request #1907 from benoit-pierre/tweak_workaround_for_1644

tweak workaround for #1644
parents 57938024 77fa2369
......@@ -17,12 +17,21 @@ def pip(args):
'pip'])
shutil.rmtree(glob(os.path.join(TOX_PIP_DIR, 'pip-*.dist-info'))[0])
# And use that version.
pypath = os.environ.get('PYTHONPATH')
pypath = pypath.split(os.pathsep) if pypath is not None else []
pypath.insert(0, TOX_PIP_DIR)
os.environ['PYTHONPATH'] = os.pathsep.join(pypath)
# Disable PEP 517 support when using editable installs.
for n, a in enumerate(args):
if not a.startswith('-'):
if a in 'install' and '-e' in args[n:]:
args.insert(n + 1, '--no-use-pep517')
break
subprocess.check_call([sys.executable, os.path.join(TOX_PIP_DIR, 'pip')] + args)
# Fix call for setuptools editable install.
for n, a in enumerate(args):
if a == '.':
args[n] = os.getcwd()
subprocess.check_call([sys.executable, '-m', 'pip'] + args, cwd=TOX_PIP_DIR)
if __name__ == '__main__':
......
......@@ -14,7 +14,7 @@ envlist=python
pip = python {toxinidir}/tools/tox_pip.py
[testenv]
deps=-rtests/requirements.txt
deps=-r{toxinidir}/tests/requirements.txt
install_command = {[helpers]pip} install {opts} {packages}
list_dependencies_command = {[helpers]pip} freeze --all
setenv=COVERAGE_FILE={toxworkdir}/.coverage.{envname}
......
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