-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsetup.py
130 lines (123 loc) · 4.07 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!/usr/bin/env python3
from setuptools import setup, Extension
from glob import glob
import shutil
import sys
import os
# Windows build: modify to point to HDF4 and HDF-EOS2 libraries.
WIN_HDF_DIR=r'C:\Program Files\HDF_Group\HDF\4.2.16'
WIN_HDFEOS_DIR=r'C:\Program Files\hdf-eos2-3.0'
try:
import numpy
numpy_include_dirs = [numpy.get_include()]
except ModuleNotFoundError:
numpy_include_dirs = []
if sys.platform == 'win32':
HDF_DIR = os.environ.get('HDF_DIR', WIN_HDF_DIR)
HDFEOS_DIR = os.environ.get('HDFEOS_DIR', WIN_HDFEOS_DIR)
hdf_libraries = ['hdf', 'mfhdf', 'libjpeg', 'libzlib', 'libszaec', 'xdr', 'Ws2_32']
hdf_include_dirs = [os.path.join(HDF_DIR, 'include')]
hdf_library_dirs = [os.path.join(HDF_DIR, 'lib')]
hdfeos_libraries = ['hdf-eos2']
hdfeos_include_dirs = [os.path.join(HDFEOS_DIR, r'include')]
hdfeos_library_dirs = [os.path.join(HDFEOS_DIR, r'vs2019\HDF-EOS2\x64\Release')]
dlls = [
os.path.join(HDF_DIR, 'bin', x)
for x in ['hdf.dll', 'mfhdf.dll', 'xdr.dll']
]
for filename in dlls:
shutil.copy(filename, 'ccplot')
package_data = {'ccplot': ['hdf.dll', 'mfhdf.dll', 'xdr.dll']}
else:
hdf_libraries = ['mfhdf', 'df', 'jpeg', 'z']
hdf_include_dirs = [
'/usr/include/hdf',
'/usr/local/include/hdf',
'/usr/include/x86_64-linux-gnu/hdf',
'/opt/local/include',
]
hdf_library_dirs = ['/opt/local/lib']
hdfeos_libraries = ['hdfeos']
hdfeos_include_dirs = []
hdfeos_library_dirs = []
package_data = {}
if sys.platform == 'darwin':
hdfeos_libraries += ['Gctp']
setup(
name='ccplot',
version='2.1.4',
description='CloudSat and CALIPSO plotting tool',
long_description="""ccplot is an open source command-line program for
plotting profile, layer and earth view data sets from CloudSat, CALIPSO
and Aqua MODIS products.""",
platforms='any',
author='Peter Kuma',
author_email='[email protected]',
url='http://www.ccplot.org/',
license='BSD',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Programming Language :: C',
'Programming Language :: Cython',
'Programming Language :: Python :: 3',
'Topic :: Scientific/Engineering :: Atmospheric Science',
'Topic :: Scientific/Engineering :: Visualization',
],
entry_points={
'console_scripts': ['ccplot = ccplot.bin.ccplot:main_wrapper'],
},
packages=[
'ccplot',
'ccplot.bin',
],
install_requires=[
'numpy>=1.1',
'matplotlib>=0.98.1',
'cartopy>=0.17.0',
'packaging>=20.03',
'pytz',
],
python_requires='>=3.0.0',
setup_requires=[
'cython',
'numpy',
],
data_files=[('share/doc/ccplot', ['NEWS']),
('share/ccplot/cmap', glob('cmap/*')),
('share/man/man1', ['man/ccplot.1'])],
include_package_data=True,
package_data=package_data,
ext_modules=[
Extension(
'ccplot.cctk',
['ccplot/cctk.c'],
include_dirs=numpy_include_dirs,
),
Extension(
'ccplot.hdf',
['ccplot/hdf.pyx'],
include_dirs=(hdf_include_dirs + numpy_include_dirs),
library_dirs=hdf_library_dirs,
libraries=hdf_libraries,
),
Extension(
'ccplot.hdfeos',
['ccplot/hdfeos.pyx'],
include_dirs=(hdf_include_dirs + hdfeos_include_dirs + numpy_include_dirs),
library_dirs=(hdf_library_dirs + hdfeos_library_dirs),
libraries=(hdfeos_libraries + hdf_libraries),
),
Extension(
'ccplot.algorithms',
['ccplot/algorithms.pyx'],
include_dirs=numpy_include_dirs,
),
],
)