Skip to content

Commit 5ef7e75

Browse files
authored
Merge pull request #1907 from benoit-pierre/tweak_workaround_for_1644
tweak workaround for #1644
2 parents 5793802 + 77fa236 commit 5ef7e75

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

tools/tox_pip.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,21 @@ def pip(args):
1717
'pip'])
1818
shutil.rmtree(glob(os.path.join(TOX_PIP_DIR, 'pip-*.dist-info'))[0])
1919
# And use that version.
20+
pypath = os.environ.get('PYTHONPATH')
21+
pypath = pypath.split(os.pathsep) if pypath is not None else []
22+
pypath.insert(0, TOX_PIP_DIR)
23+
os.environ['PYTHONPATH'] = os.pathsep.join(pypath)
24+
# Disable PEP 517 support when using editable installs.
2025
for n, a in enumerate(args):
2126
if not a.startswith('-'):
2227
if a in 'install' and '-e' in args[n:]:
2328
args.insert(n + 1, '--no-use-pep517')
2429
break
25-
subprocess.check_call([sys.executable, os.path.join(TOX_PIP_DIR, 'pip')] + args)
30+
# Fix call for setuptools editable install.
31+
for n, a in enumerate(args):
32+
if a == '.':
33+
args[n] = os.getcwd()
34+
subprocess.check_call([sys.executable, '-m', 'pip'] + args, cwd=TOX_PIP_DIR)
2635

2736

2837
if __name__ == '__main__':

tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ envlist=python
1414
pip = python {toxinidir}/tools/tox_pip.py
1515

1616
[testenv]
17-
deps=-rtests/requirements.txt
17+
deps=-r{toxinidir}/tests/requirements.txt
1818
install_command = {[helpers]pip} install {opts} {packages}
1919
list_dependencies_command = {[helpers]pip} freeze --all
2020
setenv=COVERAGE_FILE={toxworkdir}/.coverage.{envname}

0 commit comments

Comments
 (0)