forked from jakevdp/pypropack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
52 lines (38 loc) · 1.32 KB
/
setup.py
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
import os
import sys
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration(None, parent_package, top_path)
config.set_options(ignore_setup_xxx_py=True,
assume_default_configuration=True,
delegate_options_to_subpackages=True,
quiet=True)
config.add_subpackage('pypropack')
return config
def setup_package():
from numpy.distutils.core import setup
old_path = os.getcwd()
local_path = os.path.dirname(os.path.abspath(sys.argv[0]))
src_path = local_path
os.chdir(local_path)
sys.path.insert(0, local_path)
sys.path.insert(0, os.path.join(local_path, 'propack')) # to retrieve version
# Run build
old_path = os.getcwd()
os.chdir(src_path)
sys.path.insert(0, src_path)
try:
setup(
name = 'pypropack',
maintainer = "Jake Vanderplas",
maintainer_email = "vanderplas@astro.washington.edu",
description = "PROPACK python wrappers",
long_description = "PROPACK python wrappers",
license = 'BSD',
configuration=configuration )
finally:
del sys.path[0]
os.chdir(old_path)
return
if __name__ == '__main__':
setup_package()