diff options
author | Ben West <bewest@gmail.com> | 2015-05-14 18:26:53 -0700 |
---|---|---|
committer | Ben West <bewest@gmail.com> | 2015-05-14 18:26:53 -0700 |
commit | 852d95794acb91bb6e27116575a361e48a3eaeaa (patch) | |
tree | 8e6c57c48d63e42a5302bd27ae666c1fa8df9e39 /setup.py | |
parent | eeaec3f010f89118d3770fbdd826fbd6b29d3112 (diff) |
try not to violate Sandbox rules in virtualenvwrapper
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -2,6 +2,13 @@ | |||
2 | 2 | ||
3 | from setuptools import setup, find_packages | 3 | from setuptools import setup, find_packages |
4 | import platform | 4 | import platform |
5 | import subprocess | ||
6 | |||
7 | def 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 | ||
6 | import dexcom_reader | 13 | import dexcom_reader |
7 | def readme(): | 14 | def readme(): |
@@ -10,8 +17,11 @@ def readme(): | |||
10 | 17 | ||
11 | dataFiles = [ ] | 18 | dataFiles = [ ] |
12 | if platform.system( ) == 'Linux': | 19 | if 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 | ||
17 | setup(name='dexcom_reader', | 27 | setup(name='dexcom_reader', |