forked from jamesorr/mocsy
-
Notifications
You must be signed in to change notification settings - Fork 5
/
setup.py
106 lines (89 loc) · 2.94 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
from __future__ import division, absolute_import, print_function
import os
import sys
from setuptools import setup
from numpy.distutils.core import setup
from numpy.distutils.misc_util import Configuration
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.verbose = True
def run_tests(self):
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)
def extract_version(module='mocsy'):
version = None
fdir = os.path.dirname(__file__)
fnme = os.path.join(fdir, module, '__init__.py')
with open(fnme) as fd:
for line in fd:
if (line.startswith('__version__')):
_, version = line.split('=')
# Remove quotation characters.
version = version.strip()[1:-1]
break
return version
rootpath = os.path.abspath(os.path.dirname(__file__))
def read(*parts):
return open(os.path.join(rootpath, *parts), 'r').read()
long_description = '{}\n{}'.format(read('README.rst'), read('ChangeLog'))
LICENSE = read('LICENSE')
with open('requirements.txt') as f:
require = f.readlines()
install_requires = [r.strip() for r in require]
sources = [
'src/singledouble.f90',
'src/eos.f90',
'src/p80.f90',
'src/sw_adtg.f90',
'src/sw_ptmp.f90',
'src/sw_temp.f90',
'src/constants.f90',
'src/p2fCO2.f90',
'src/phsolvers.f90',
'src/rho.f90',
'src/rhoinsitu.f90',
'src/tis.f90',
'src/tpot.f90',
'src/varsolver.f90',
'src/vars.f90',
'src/depth2press.f90',
'src/f2pCO2.f90',
'src/buffesm.f90',
'src/DNAD.f90',
'src/derivauto.f90',
'src/derivnum.f90',
'src/errors.f90',
'src/gasx.f90'
]
config = Configuration('')
config.add_extension('_mocsy',
sources=sources)
setup(name='mocsy',
version=extract_version(),
license=LICENSE,
long_description=long_description,
classifiers=['Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Science/Research',
'Intended Audience :: Developers',
'Intended Audience :: Education',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Scientific/Engineering',
'Topic :: Education',
],
description='Routines to model ocean carbonate system thermodynamics',
url='https://github.com/jamesorr/mocsy.git',
platforms='any',
keywords=['carbonate', 'ocean acidification', 'CO2SYS'],
install_requires=install_requires,
packages=['mocsy'],
ext_package='mocsy',
tests_require=['pytest'],
cmdclass=dict(test=PyTest),
**config.todict()
)