summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/setup.py b/setup.py
index 28f1979..b332abf 100644
--- a/setup.py
+++ b/setup.py
@@ -3,11 +3,15 @@
3from setuptools import setup, find_packages 3from setuptools import setup, find_packages
4import platform 4import platform
5import subprocess 5import subprocess
6import sys
6 7
7def is_virtualenv ( ): 8def is_virtualenv ( ):
8 import os 9 import os, os.path
9 proc = subprocess.Popen(['which', 'virtualenvwrapper'], stderr=subprocess.PIPE, stdout=subprocess.PIPE) 10 proc = subprocess.Popen(['which', 'add2virtualenv'], stderr=subprocess.PIPE, stdout=subprocess.PIPE)
11 shell = os.path.dirname(sys.argv[0])
10 has_venv = proc.poll( ) == 0 12 has_venv = proc.poll( ) == 0
13 print "shell root shares project root", shell, os.path.dirname(__file__)
14 print 'real_prefix', getattr(sys, 'real_prefix', '??')
11 print "RESULT", proc.poll( ), has_venv, os.environ.get('VIRTUAL_ENV') 15 print "RESULT", proc.poll( ), has_venv, os.environ.get('VIRTUAL_ENV')
12 return os.environ.get('VIRTUAL_ENV', has_venv) 16 return os.environ.get('VIRTUAL_ENV', has_venv)
13 17