Mercurial > repos > shellac > sam_consensus_v3
comparison env/lib/python3.9/site-packages/pip/__main__.py @ 0:4f3585e2f14b draft default tip
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
author | shellac |
---|---|
date | Mon, 22 Mar 2021 18:12:50 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4f3585e2f14b |
---|---|
1 import os | |
2 import sys | |
3 | |
4 # Remove '' and current working directory from the first entry | |
5 # of sys.path, if present to avoid using current directory | |
6 # in pip commands check, freeze, install, list and show, | |
7 # when invoked as python -m pip <command> | |
8 if sys.path[0] in ('', os.getcwd()): | |
9 sys.path.pop(0) | |
10 | |
11 # If we are running from a wheel, add the wheel to sys.path | |
12 # This allows the usage python pip-*.whl/pip install pip-*.whl | |
13 if __package__ == '': | |
14 # __file__ is pip-*.whl/pip/__main__.py | |
15 # first dirname call strips of '/__main__.py', second strips off '/pip' | |
16 # Resulting path is the name of the wheel itself | |
17 # Add that to sys.path so we can import pip | |
18 path = os.path.dirname(os.path.dirname(__file__)) | |
19 sys.path.insert(0, path) | |
20 | |
21 from pip._internal.cli.main import main as _main | |
22 | |
23 if __name__ == '__main__': | |
24 sys.exit(_main()) |