aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2019-11-15 19:05:25 +0000
committerGitHub <noreply@github.com>2019-11-15 19:05:25 +0000
commit5ef7e75dd7861b76ec2480a03717cc4b624d64ef (patch)
tree7556aaa080660e062501d6cd6f8a06619e416836
parent579380246fba55754cb43b660251d457050cfca0 (diff)
parent77fa2369892b7e45ede9cad18aaa3f0721c96cc3 (diff)
downloadexternal_python_setuptools-5ef7e75dd7861b76ec2480a03717cc4b624d64ef.tar.gz
external_python_setuptools-5ef7e75dd7861b76ec2480a03717cc4b624d64ef.tar.bz2
external_python_setuptools-5ef7e75dd7861b76ec2480a03717cc4b624d64ef.zip
Merge pull request #1907 from benoit-pierre/tweak_workaround_for_1644
tweak workaround for #1644
-rw-r--r--tools/tox_pip.py11
-rw-r--r--tox.ini2
2 files changed, 11 insertions, 2 deletions
diff --git a/tools/tox_pip.py b/tools/tox_pip.py
index 1117f996..5aeca805 100644
--- a/tools/tox_pip.py
+++ b/tools/tox_pip.py
@@ -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__':
diff --git a/tox.ini b/tox.ini
index 8b34c235..5d439cb3 100644
--- a/tox.ini
+++ b/tox.ini
@@ -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}