Mercurial > hg > MakeItSo
annotate examples/hotinstall.py @ 215:360a70d3ef5f
stub a manifest file which may solve all of our problems
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Fri, 04 Dec 2015 13:12:07 -0800 |
parents | 388b4bb3516c |
children |
rev | line source |
---|---|
204 | 1 # python requirements |
2 # (key, value) = (module, PyPI name) | |
3 requirements = [('boto', 'boto'), | |
4 ('tempita', 'tempita')] | |
5 for module, package in requirements: | |
6 try: | |
7 globals()[module] = __import__(module) | |
8 except ImportError: | |
9 # install requirement and try again | |
10 import subprocess | |
11 subprocess.check_call(['pip', 'install', package]) | |
12 args = [sys.executable] + sys.argv | |
13 os.execl(sys.executable, *args) |