-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.py
75 lines (68 loc) · 2.34 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
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/usr/bin/env python
import os
import re
import sys
import warnings
import versioneer
from setuptools import setup, find_packages
from numpy.distutils.core import setup, Extension
from numpy.distutils.fcompiler import get_default_fcompiler, CompilerNotFound
DISTNAME = 'xlayers'
LICENSE = 'MIT'
AUTHOR = 'xlayers Developers'
AUTHOR_EMAIL = '[email protected]'
URL = 'https://github.com/cspencerjones/xlayers'
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Intended Audience :: Science/Research',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Topic :: Scientific/Engineering',
]
INSTALL_REQUIRES = ['xarray>=0.13.0', 'dask', 'numpy>=1.16']
PYTHON_REQUIRES = '>=3.6'
# figure out which compiler we're going to use
compiler = get_default_fcompiler()
# set some fortran compiler-dependent flags
f90flags = []
if compiler == 'gnu95':
f90flags.append('-fno-range-check')
f90flags.append('-ffree-form')
elif compiler == 'intel' or compiler == 'intelem':
f90flags.append('-132')
# Set aggressive optimization level
f90flags.append('-O3')
# Suppress all compiler warnings (avoid huge CI log files)
f90flags.append('-w')
finegrid = Extension(name = 'finegrid',
sources = ['xlayers/finegrid.f'],
extra_f90_compile_args=f90flags,
f2py_options=['--quiet'])
layers = Extension(name = 'layers',
sources = ['xlayers/looplayers.f',
'xlayers/layers.f'],
extra_f90_compile_args=f90flags,
f2py_options=['--quiet'])
DESCRIPTION = "Fast convective parameters for numpy, dask, and xarray"
def readme():
with open('README.rst') as f:
return f.read()
setup(name=DISTNAME,
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
license=LICENSE,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
classifiers=CLASSIFIERS,
description=DESCRIPTION,
long_description=readme(),
#install_requires=INSTALL_REQUIRES,
#python_requires=PYTHON_REQUIRES,
url=URL,
packages = find_packages(),
ext_package = 'xlayers',
ext_modules = [finegrid, layers]
)