forked from hypothesis/h
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun
More file actions
executable file
·24 lines (19 loc) · 684 Bytes
/
run
File metadata and controls
executable file
·24 lines (19 loc) · 684 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env python
from distutils.core import run_setup
from os import environ
from os.path import abspath, dirname, exists, join
import sys
def activate():
# Activate the virtual environment if it is present.
activate = abspath(join(dirname(__file__), 'bin', 'activate_this.py'))
if exists(activate):
with open(activate) as f:
code = compile(f.read(), activate, 'exec')
exec(code, {}, dict(__file__=activate))
if __name__ == '__main__':
# Ensure the virtual environment is really active.
if 'VIRTUAL_ENV' not in environ:
activate()
# Start the application
from h.script import start
start(sys.argv[1:])