summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorBen West <bewest@gmail.com>2015-05-14 18:26:53 -0700
committerBen West <bewest@gmail.com>2015-05-14 18:26:53 -0700
commit852d95794acb91bb6e27116575a361e48a3eaeaa (patch)
tree8e6c57c48d63e42a5302bd27ae666c1fa8df9e39 /setup.py
parenteeaec3f010f89118d3770fbdd826fbd6b29d3112 (diff)
try not to violate Sandbox rules in virtualenvwrapper
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index 504f204..ea857e4 100644
--- a/setup.py
+++ b/setup.py
@@ -2,6 +2,13 @@
2 2
3from setuptools import setup, find_packages 3from setuptools import setup, find_packages
4import platform 4import platform
5import subprocess
6
7def is_virtualenv ( ):
8 import os
9 proc = subprocess.Popen(['which', 'virtualenvwrapper'], stderr=subprocess.PIPE, stdout=subprocess.PIPE)
10 has_venv = proc.poll( ) == 0
11 return os.environ.get('VIRTUAL_ENV', has_venv)
5 12
6import dexcom_reader 13import dexcom_reader
7def readme(): 14def readme():
@@ -10,8 +17,11 @@ def readme():
10 17
11dataFiles = [ ] 18dataFiles = [ ]
12if platform.system( ) == 'Linux': 19if platform.system( ) == 'Linux':
20 prefix = '/'
21 if is_virtualenv( ):
22 prefix = ''
13 dataFiles = [ 23 dataFiles = [
14 ('/etc/udev/rules.d', ['etc/udev/rules.d/80-dexcom.rules']), 24 (prefix + 'etc/udev/rules.d', ['etc/udev/rules.d/80-dexcom.rules']),
15 ] 25 ]
16 26
17setup(name='dexcom_reader', 27setup(name='dexcom_reader',