-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup.py
executable file
·110 lines (85 loc) · 2.69 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
# -*- coding: utf-8 -*-
"""
.. module:: setup.py
:license: GPL / CeCILL
:platform: Unix
:synopsis: cdf2cim setup.
.. moduleauthor:: ES-DOC <[email protected]>
"""
import os
import re
from codecs import open
from setuptools import setup
from setuptools import find_packages
from setuptools.dist import Distribution
# List of 3rd party python dependencies.
_REQUIRES = [
'cf-python>=3.4.0',
'nose',
'numpy>=1.7',
'netCDF4>=1.5.3',
'cftime==1.1.1',
'cfdm==1.8.3',
'requests==2.20.0',
'psutil>=0.6.0'
]
class _BinaryDistribution(Distribution):
"""Distribution sub-class to override defaults.
"""
def is_pure(self):
"""Gets flag indicating whether build is pure python or not.
"""
return False
def _read(fname):
"""Returns content of a file.
"""
fpath = os.path.dirname(__file__)
fpath = os.path.join(fpath, fname)
with open(fpath, 'r', 'utf-8') as file_:
return file_.read()
def _get_version():
"""Returns library version by inspecting __init__.py file.
"""
return re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
_read("cdf2cim/__init__.py"),
re.MULTILINE).group(1)
# Libary version.
_VERSION = _get_version()
# Library packages.
_PACKAGES = find_packages()
# User readme.
_README = _read('README.rst')
setup(
name='cdf2cim',
version=_VERSION,
description='cdf2cim is a python library for publishing earth system documentation from NetCDF files.',
long_description=_README,
author='David Hassell, Mark A. Greenslade',
author_email='[email protected], [email protected]',
url='https://github.com/ES-DOC/esdoc-cdf2cim',
packages=_PACKAGES,
include_package_data=True,
install_requires=_REQUIRES,
license='GPL/CeCILL-2.1',
zip_safe=False,
distclass=_BinaryDistribution,
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'Natural Language :: English',
'License :: OSI Approved :: GNU General Public License (GPL)',
'License :: OSI Approved :: CEA CNRS Inria Logiciel Libre License, version 2.1 (CeCILL-2.1)',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Topic :: Software Development :: Libraries :: Python Modules',
],
entry_points={
'console_scripts': [
'cdf2cim-publish = cdf2cim.cli:publish',
'cdf2cim-scan = cdf2cim.cli:scan',
'cdf2cim-verify-credentials = cdf2cim.cli:verify_credentials'
]
}
)