forked from cedadev/S3-netcdf-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
144 lines (138 loc) · 5.17 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
__copyright__ = "(C) 2019-2021 Science and Technology Facilities Council"
__license__ = "BSD - see LICENSE file in top-level directory"
__authors__ = "Neil Massey"
import os
from setuptools import Extension, setup
from Cython.Build import cythonize
s3nc_define_macros = [(
"NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION"
)]
import numpy
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
s3nc_extra_compile_args = ['-fno-strict-aliasing', '-O3']
extensions = [
Extension(
name="S3netCDF4.Backends._s3aioFileObject",
sources=["S3netCDF4/Backends/_s3aioFileObject.pyx"],
define_macros=s3nc_define_macros,
extra_compile_args=s3nc_extra_compile_args,
include_dirs=[numpy.get_include()],
inplace=True
),
Extension(
name="S3netCDF4.Backends._s3FileObject",
sources=["S3netCDF4/Backends/_s3FileObject.pyx"],
define_macros=s3nc_define_macros,
extra_compile_args=s3nc_extra_compile_args,
include_dirs=[numpy.get_include()],
),
Extension(
name="S3netCDF4.CFA._CFAClasses",
sources=["S3netCDF4/CFA/_CFAClasses.pyx"],
define_macros=s3nc_define_macros,
extra_compile_args=s3nc_extra_compile_args,
include_dirs=[numpy.get_include()],
),
Extension(
name="S3netCDF4.CFA._CFAExceptions",
sources=["S3netCDF4/CFA/_CFAExceptions.pyx"],
define_macros=s3nc_define_macros,
extra_compile_args=s3nc_extra_compile_args,
include_dirs=[numpy.get_include()],
),
Extension(
name="S3netCDF4.CFA._CFASplitter",
sources=["S3netCDF4/CFA/_CFASplitter.pyx"],
define_macros=s3nc_define_macros,
extra_compile_args=s3nc_extra_compile_args,
include_dirs=[numpy.get_include()],
),
Extension(
name="S3netCDF4.CFA.Parsers._CFAnetCDFParser",
sources=["S3netCDF4/CFA/Parsers/_CFAnetCDFParser.pyx"],
define_macros=s3nc_define_macros,
extra_compile_args=s3nc_extra_compile_args,
include_dirs=[numpy.get_include()],
),
Extension(
name="S3netCDF4.CFA.Parsers._CFAParser",
sources=["S3netCDF4/CFA/Parsers/_CFAParser.pyx"],
define_macros=s3nc_define_macros,
extra_compile_args=s3nc_extra_compile_args,
include_dirs=[numpy.get_include()],
),
Extension(
name="S3netCDF4.Managers._ConfigManager",
sources=["S3netCDF4/Managers/_ConfigManager.pyx"],
define_macros=s3nc_define_macros,
extra_compile_args=s3nc_extra_compile_args,
include_dirs=[numpy.get_include()],
),
Extension(
name="S3netCDF4.Managers._ConnectionPool",
sources=["S3netCDF4/Managers/_ConnectionPool.pyx"],
define_macros=s3nc_define_macros,
extra_compile_args=s3nc_extra_compile_args,
include_dirs=[numpy.get_include()],
),
Extension(
name="S3netCDF4.Managers._FileManager",
sources=["S3netCDF4/Managers/_FileManager.pyx"],
define_macros=s3nc_define_macros,
extra_compile_args=s3nc_extra_compile_args,
include_dirs=[numpy.get_include()],
),
Extension(
name="S3netCDF4._Exceptions",
sources=["S3netCDF4/_Exceptions.pyx"],
define_macros=s3nc_define_macros,
extra_compile_args=s3nc_extra_compile_args,
include_dirs=[numpy.get_include()],
),
Extension(
name="S3netCDF4._s3netCDF4",
sources=["S3netCDF4/_s3netCDF4.pyx"],
define_macros=s3nc_define_macros,
extra_compile_args=s3nc_extra_compile_args,
include_dirs=[numpy.get_include()],
),
]
setup(
name='S3netCDF4',
version='2.1-rc1',
packages=['S3netCDF4'],
install_requires=[
'numpy>=1.19.0',
'cython',
'netcdf4',
'botocore',
'aiobotocore',
'psutil',
],
ext_modules=cythonize(extensions),
zip_safe=False,
include_package_data=True,
license='my License', # example license
description='A library to facilitate the storage of netCDF files on ObjectStores in an efficient manner.',
long_description=README,
long_description_content_type="text/markdown",
url='http://www.ceda.ac.uk/',
author='Neil Massey',
author_email='[email protected]',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License', # example license
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System :: Archiving :: Compression',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
]
)