setup.py 4.72 KB
Newer Older
1
2
3
#!/usr/bin/env python
# -*- coding: utf-8 -*-

4
5
# gms_preprocessing, spatial and spectral homogenization of satellite remote sensing data
#
6
# Copyright (C) 2020  Daniel Scheffler (GFZ Potsdam, daniel.scheffler@gfz-potsdam.de)
7
8
9
10
11
12
#
# This software was developed within the context of the GeoMultiSens project funded
# by the German Federal Ministry of Education and Research
# (project grant code: 01 IS 14 010 A-C).
#
# This program is free software: you can redistribute it and/or modify it under
13
# the terms of the GNU General Public License as published by the Free Software
14
15
# Foundation, either version 3 of the License, or (at your option) any later version.
# Please note the following exception: `gms_preprocessing` depends on tqdm, which
16
17
18
# is distributed under the Mozilla Public Licence (MPL) v2.0 except for the files
# "tqdm/_tqdm.py", "setup.py", "README.rst", "MANIFEST.in" and ".gitignore".
# Details can be found here: https://github.com/tqdm/tqdm/blob/master/LICENCE.
19
20
21
22
23
24
25
26
27
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU Lesser General Public License along
# with this program.  If not, see <http://www.gnu.org/licenses/>.

28
from setuptools import setup, find_packages
29
import warnings
30
from importlib import util
31
32
33
34
35
36
37

with open('README.rst') as readme_file:
    readme = readme_file.read()

with open('HISTORY.rst') as history_file:
    history = history_file.read()

38
version = {}
39
with open("gms_preprocessing/version.py", encoding='utf-8') as version_file:
40
41
    exec(version_file.read(), version)

42
requirements = [
43
44
45
46
47
48
49
50
51
52
53
54
55
56
    'arosics>=1.0.0',
    'cerberus',
    'dill',
    'ephem',
    'gdal',
    'geoalchemy2',
    'geoarray>=0.9.0',
    'geopandas',
    'iso8601',
    'jsmin',
    'matplotlib',
    'natsort',
    'nested_dict',
    'numpy',
57
    'openpyxl',  # implicitly needed by pandas to write GMS job summaries as excel files
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
    'pandas',
    'psutil',
    'psycopg2',
    'pyinstrument',
    'pyorbital',
    'pyproj',
    'pyrsr>=0.3.1',
    'py_tools_ds>=0.12.4',
    'pytz',
    'redis',
    'redis-semaphore',
    'retools',
    'scikit-learn',
    'scipy',
    'shapely',
    'sicor',
    'spechomo',
    'spectral>=0.16',  # spectral<0.16  has some problems with writing signed integer 8bit data
    'sqlalchemy',
    'timeout_decorator',
    'tqdm',
79
    # fmask # conda install -c conda-forge python-fmask
80
    # 'pyhdf', # conda install --yes -c conda-forge pyhdf
81
]
82
setup_requirements = []  # TODO(danschef): put setup requirements (distutils extensions, etc.) here
83
test_requirements = requirements + ['coverage', 'nose', 'nose2', 'nose-htmloutput', 'rednose']
84
85
86
87
88

setup(
    author="Daniel Scheffler",
    author_email='daniel.scheffler@gfz-potsdam.de',
    classifiers=[
89
        'Development Status :: 5 - Production/Stable',
90
        'Intended Audience :: Developers',
91
        'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
92
        'Natural Language :: English',
93
94
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.6',
95
96
        'Programming Language :: Python :: 3.7',
        'Programming Language :: Python :: 3.8',
97
        'Programming Language :: Python :: 3.9',
98
    ],
99
100
101
102
103
104
105
106
107
108
109
110
    description="GeoMultiSens - Scalable Multi-Sensor Analysis of Remote Sensing Data",
    keywords='gms_preprocessing',
    include_package_data=True,
    install_requires=requirements,
    license="GPL-3.0-or-later",
    long_description=readme + '\n\n' + history,
    name='gms_preprocessing',
    # package_data={"gms_preprocessing": ["database/**/**/**/*"]},
    package_data={"database": ["gms_preprocessing/database/*"]},
    package_dir={'gms_preprocessing': 'gms_preprocessing'},
    packages=find_packages(exclude=['tests*']),  # searches for packages with an __init__.py and returns a list
    scripts=["bin/run_gms.py", "bin/run_gms.sh"],
111
    test_suite='tests',
112
113
114
115
    tests_require=test_requirements,
    url='https://gitext.gfz-potsdam.de/geomultisens/gms_preprocessing',
    version=version['__version__'],
    zip_safe=False
116
)
117
118
119


# check for pyhdf
120
if not util.find_spec('pyhdf'):
121
122
    warnings.warn('If you have not compiled GDAL with HDF4 support you need to install pyhdf manually '
                  '(see http://pysclint.sourceforge.net/pyhdf/install.html) for processing Terra ASTER data.'
123
                  'It is not automatically installed.')
124
125

# check for fmask
126
if not util.find_spec('fmask'):
127
128
    warnings.warn("FMask library is missing. If you want to compute cloud masks via FMask, you have to install it "
                  "manually (e.g., by running 'conda install -c conda-forge python-fmask').")