-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·70 lines (66 loc) · 2.31 KB
/
setup.py
File metadata and controls
executable file
·70 lines (66 loc) · 2.31 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
70
from __future__ import absolute_import
import os
from setuptools import find_packages
from Cython.Build import cythonize
from numpy.distutils.core import setup, Extension
if os.environ.get('READTHEDOCS') == 'True':
# print some helpful readthedocs debugging info:
print('------ setup.py for readthedocs ------')
import sys
print('python: ' + sys.version)
import setuptools
print('setuptools: ' + setuptools.__version__)
import numpy as np
print('numpy: ' + np.__version__)
import cython
print('cython: ' + cython.__version__)
print('--------------------------------------')
# link to the conda fortran compiler for readthedocs
file_path = os.path.realpath(__file__)
checkout_name = os.path.basename(os.path.dirname(file_path))
gfortran_rel_path = '../../conda/' + checkout_name + '/bin/x86_64-conda_cos6-linux-gnu-gfortran'
gfortran_path = os.path.realpath(gfortran_rel_path)
os.environ['F77'] = gfortran_path
os.environ['F90'] = gfortran_path
# remove some package dependencies
install_requires=[
'cython',
'numpy'
]
else:
install_requires=[
'cython',
'matplotlib',
'metpy',
'numpy',
'pandas',
'scipy',
'statsmodels',
'xarray'
]
# organize libraries and extensions
bufr_lib = ('BUFR_1_07_1',
{'depends': [], 'sources': ['src/BUFR_1_07_1.f']})
exts = [
Extension('wxprofilers._cape', ['src/getcape.f90']),
Extension('wxprofilers._median', ['src/filter.cc'], language='c++'),
Extension('wxprofilers._rrs_decoder', ['src/RRS_Decoder_1_04.f'],
libraries=['BUFR_1_07_1'])
]
seg_ext = Extension('wxprofilers._segmentation._segmentation',
['wxprofilers/_segmentation/_segmentation.pyx',
'wxprofilers/_segmentation/mrf.c'])
exts += cythonize([seg_ext, 'wxprofilers/_uniform.pyx'])
setup(name='wxprofilers',
version='0.1dev',
description='Utilities for working with weather profiler instruments',
url='https://github.com/ASRCsoft/wxprofilers',
author='William May',
author_email='wcmay@albany.edu',
packages=find_packages(),
libraries=[bufr_lib],
ext_modules=exts,
install_requires=install_requires,
test_suite='nose.collector',
tests_require=['nose']
)