forked from pypa/setuptools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make it possible to use a more recent version of pip for tests.
- Loading branch information
1 parent
734d09c
commit 0d831c9
Showing
4 changed files
with
38 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import os | ||
import shutil | ||
import subprocess | ||
import sys | ||
from glob import glob | ||
|
||
VIRTUAL_ENV = os.environ['VIRTUAL_ENV'] | ||
TOX_PIP_DIR = os.path.join(VIRTUAL_ENV, 'pip') | ||
|
||
|
||
def pip(args): | ||
# First things first, get a recent (stable) version of pip. | ||
if not os.path.exists(TOX_PIP_DIR): | ||
subprocess.check_call([sys.executable, '-m', 'pip', | ||
'--disable-pip-version-check', | ||
'install', '-t', TOX_PIP_DIR, | ||
'pip']) | ||
shutil.rmtree(glob(os.path.join(TOX_PIP_DIR, 'pip-*.dist-info'))[0]) | ||
# And use that version. | ||
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) | ||
|
||
|
||
if __name__ == '__main__': | ||
pip(sys.argv[1:]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters