forked from spectraphilic/reflexible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
62 lines (53 loc) · 1.93 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
52
53
54
55
56
57
58
59
60
61
62
#/usr/bin/env python
from __future__ import print_function
from distutils.dep_util import newer
import os, os.path
from setuptools import setup
import subprocess
# reflexible version
VERSION = open('VERSION').read().strip()
# Create the version.py file
open('reflexible/version.py', 'w').write('__version__ = "%s"\n' % VERSION)
# Build the FortFlex extension if necessary
if (not os.path.exists("reflexible/conv2netcdf4/FortFlex.so") or
newer("reflexible/conv2netcdf4/fortflex/FortFlex.f",
"reflexible/conv2netcdf4/FortFlex.so")):
try:
print(subprocess.check_output(
"cd reflexible/conv2netcdf4/fortflex; "
"sh build_FortFlex.sh", shell=True))
except:
print("Problems compiling the FortFlex module. "
"Will continue using a slower fallback...")
else:
print("FortFlex.so extension has been created in reflexible/conv2netcdf4/!")
def find_package_data(pdir):
"""Recursively get all the data files that are in pdir."""
return [(d, [os.path.join(d, f) for f in files])
for d,folders,files in os.walk(pdir)]
setup(
name = 'reflexible',
version = VERSION,
author = 'John F. Burkhart, Francesc Alted',
url = 'https://github.com/spectraphilic/reflexible',
description = 'A Python interface to FLEXPART data.',
license = 'Creative Commons',
packages = [
'reflexible',
'reflexible.scripts',
'reflexible.conv2netcdf4',
'reflexible.tests',
'reflexible.legacy',
],
data_files = [
('reflexible/conv2netcdf4', ['reflexible/conv2netcdf4/FortFlex.so'])] + \
find_package_data('reflexible/uio_examples'),
zip_safe=False,
entry_points={
'console_scripts': [
'create_ncfile = reflexible.scripts.create_ncfile:main',
'readpartpositions = reflexible.scripts.readpartpositions:main',
]
},
)