setup.py 4.99 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
req = [
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
    'pandas',
    'psutil',
    'psycopg2',
    'pyinstrument',
    'pyorbital',
    'pyproj',
    'pyrsr>=0.3.1',
65
    'py_tools_ds>=0.16.3',
66
    'pytz',
67
    'redis',  # named redis on PyPI and redis-py on conda-forge
68 69 70 71 72
    'redis-semaphore',
    'retools',
    'scikit-learn',
    'scipy',
    'shapely',
73
    'sicor>=0.15.2',
74 75 76 77 78
    '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 83 84

req_setup = ['setuptools-git']  # needed for package_data version controlled by GIT

85
req_test = ['coverage', 'nose', 'nose2', 'nose-htmloutput', 'rednose', 'urlchecker']
86

87
req_doc = ['sphinx-autodoc-typehint', 'sphinx-argparse', 'sphinx_rtd_theme']
88 89 90 91

req_lint = ['flake8', 'pycodestyle', 'pydocstyle']

req_dev = req_setup + req_test + req_doc + req_lint
92 93 94 95 96

setup(
    author="Daniel Scheffler",
    author_email='daniel.scheffler@gfz-potsdam.de',
    classifiers=[
97
        'Development Status :: 5 - Production/Stable',
98
        'Intended Audience :: Developers',
99
        'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
100
        'Natural Language :: English',
101 102
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.6',
103 104
        'Programming Language :: Python :: 3.7',
        'Programming Language :: Python :: 3.8',
105
        'Programming Language :: Python :: 3.9',
106
    ],
107
    description="GeoMultiSens - Scalable Multi-Sensor Analysis of Remote Sensing Data",
108 109 110 111 112 113
    extras_require={
        "doc": req_doc,
        "test": req_test,
        "lint": req_lint,
        "dev": req_dev
    },
114 115
    keywords='gms_preprocessing',
    include_package_data=True,
116
    install_requires=req,
117
    license="GPL-3.0-or-later",
118
    long_description=readme,
119
    name='gms_preprocessing',
120 121
    package_data={"gms_preprocessing": ["database/**/**/*",
                                        "options/options_default.json"]},
122
    package_dir={'gms_preprocessing': 'gms_preprocessing'},
123
    packages=find_packages(exclude=['.github', 'benchmarks', 'docs', 'examples', 'tests*']),
124
    scripts=["bin/run_gms.py", "bin/run_gms.sh"],
125
    test_suite='tests',
126
    tests_require=req_test,
127
    url='https://git.gfz-potsdam.de/geomultisens/gms_preprocessing',
128 129
    version=version['__version__'],
    zip_safe=False
130
)
131 132 133


# check for pyhdf
134
if not util.find_spec('pyhdf'):
135 136
    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.'
137
                  'It is not automatically installed.')
138 139

# check for fmask
140
if not util.find_spec('fmask'):
141 142
    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').")