-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
42 lines (32 loc) · 1.19 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
''' setup.py '''
# Verify the latest pip version
from os import system
system('pip install --upgrade pip')
# install required packages from PyPI
from pip import main as pip_main
pip_req = ['matplotlib', 'numpy', 'pandas', 'seaborn', 'scipy']
pip_main(['install'] + pip_req)
# set "develop" option
import setuptools
from glob import glob
from numpy.distutils.core import Extension, setup
from os.path import join
name = 'pyigrf'
sourcePath = 'source'
extra_compile_args = []
extra_f77_compile_args = ['-w', '-fno-align-commons']
ext = []
modName = 'get_igrf'
igrfSource = ['get_igrf.pyf', 'get_igrf.for', 'igrf_sub.for']
sources = []
for src in igrfSource: sources.append(join(sourcePath, src))
ext.append(Extension(name=modName, sources=sources,
f2py_options=['--quiet'], extra_compile_args=extra_compile_args,
extra_f77_compile_args=extra_f77_compile_args))
igrfData = glob(join('data', '*.dat'))
igrfDataFiles = [(join(name, 'data'), igrfData)]
if __name__ == '__main__':
setup(name=name, version='1.0.0', author='Ronald Ilma',
author_email='rri5@cornell.edu', description='IGRF model',
packages=[name], ext_package=name, ext_modules=ext,
data_files=igrfDataFiles)