-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup.py
70 lines (54 loc) · 2.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
import os
import re
from setuptools import setup
def _get_version():
"""Returns the RTC-S1 science application software version from the
file `src/rtc/version.py`
Returns
-------
version : str
RTC-S1 science application software version
"""
version_file = os.path.join('src', 'rtc', 'version.py')
with open(version_file, 'r') as f:
text = f.read()
# Get first match of the version number contained in the version file
# This regex should match a pattern like: VERSION = '3.2.5', but it
# allows for varying spaces, number of major/minor versions,
# and quotation mark styles.
p = re.search("VERSION[ ]*=[ ]*['\"]\d+([.]\d+)*['\"]", text)
# Check that the version file contains properly formatted text string
if p is None:
raise ValueError(
f'Version file {version_file} not properly formatted.'
" It should contain text matching e.g. VERSION = '2.3.4'")
# Extract just the numeric version number from the string
p = re.search("\d+([.]\d+)*", p.group(0))
return p.group(0)
__version__ = version = VERSION = _get_version()
print(f'RTC-S1 SAS version {version}')
long_description = ''
package_data_dict = {}
package_data_dict['rtc'] = [
os.path.join('defaults', 'rtc_s1.yaml'),
os.path.join('defaults', 'rtc_s1_static.yaml'),
os.path.join('schemas', 'rtc_s1.yaml')]
setup(
name='rtc',
version=version,
description=('OPERA Radiometric Terrain-Corrected (RTC) SAR backscatter'
' from Sentinel-1 Science Application Software (SAS)'),
package_dir={'rtc': 'src/rtc'},
include_package_data=True,
package_data=package_data_dict,
classifiers=['Programming Language :: Python'],
scripts=['app/rtc_s1.py', 'app/rtc_s1_single_job.py',
'app/rtc_compare.py'],
install_requires=['argparse', 'numpy', 'yamale',
'scipy', 'pytest', 'requests',
'pyproj', 'shapely', 'matplotlib'],
url='https://github.com/opera-adt/RTC',
license=('Copyright by the California Institute of Technology.'
' ALL RIGHTS RESERVED.'),
long_description=long_description,
)