-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·69 lines (51 loc) · 1.82 KB
/
setup.py
File metadata and controls
executable file
·69 lines (51 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env python
import os, urllib
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
packages = ['perses.util', 'perses.models', 'perses.beam',\
'perses.foregrounds', 'perses.simulations']
setup(name='perses',
version='0.1',
description='Pre-EoR Signal Extraction Software',
packages=packages,
)
PERSES_env = os.getenv('PERSES')
cwd = os.getcwd()
##
# TELL PEOPLE TO SET ENVIRONMENT VARIABLE
##
if not PERSES_env:
import re
shell = os.getenv('SHELL')
print("\n")
print("#" * 78)
print("It would be in your best interest to set an environment variable")
print("pointing to this directory.\n")
if shell:
if re.search('bash', shell):
print("Looks like you're using bash, so add the following to " +\
"your .bashrc:")
print("\n export PERSES={0}".format(cwd))
elif re.search('csh', shell):
print("Looks like you're using csh, so add the following to " +\
"your .cshrc:")
print("\n setenv PERSES {!s}".format(cwd))
print("\nGood luck!")
print("#" * 78)
print("\n")
# Print a warning if there's already an environment variable but it's pointing
# somewhere other than the current directory
elif PERSES_env != cwd:
print("\n")
print("#" * 78)
print("It looks like you've already got an PERSES environment variable " +\
"set but it's \npointing to a different directory:")
print("\n PERSES={!s}".format(PERSES_env))
print("\nHowever, we're currently in {!s}.\n".format(cwd))
print("Is this a different ares install (might not cause problems), or " +\
"perhaps just")
print("a typo in your environment variable?")
print("#" * 78)
print("\n")