File tree 2 files changed +20
-6
lines changed
2 files changed +20
-6
lines changed Original file line number Diff line number Diff line change
1
+ """
2
+ Wrap the pip command to:
3
+
4
+ - Avoid the default 'python -m pip' invocation, which causes the current
5
+ working directory to be added to the path, which causes problems.
6
+ """
7
+
8
+
9
+ import sys
10
+ import subprocess
11
+
12
+
13
+ def main ():
14
+ cmd = sys .argv [1 :]
15
+ subprocess .check_call (cmd )
16
+
17
+
18
+ __name__ == '__main__' and main ()
Original file line number Diff line number Diff line change @@ -9,12 +9,8 @@ envlist=python
9
9
10
10
[testenv]
11
11
deps =-rtests/requirements.txt
12
- # Changed from default (`python -m pip ...`)
13
- # to prevent the current working directory
14
- # from being added to `sys.path`.
15
- install_command ={envbindir}/pip install {opts} {packages}
16
- # Same as above.
17
- list_dependencies_command ={envbindir}/pip freeze
12
+ install_command = python ./pip-wrapper.py {envbindir}/pip install {opts} {packages}
13
+ list_dependencies_command = python ./pip-wrapper.py {envbindir}/pip freeze
18
14
setenv =COVERAGE_FILE ={toxworkdir}/.coverage.{envname}
19
15
# TODO: The passed environment variables came from copying other tox.ini files
20
16
# These should probably be individually annotated to explain what needs them.
You can’t perform that action at this time.
0 commit comments