setup.py 4.77 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 = {}
Daniel Scheffler's avatar
Fix.    
Daniel Scheffler committed
39
with open("gms_preprocessing/version.py") as version_file:
40
41
    exec(version_file.read(), version)

42
requirements = [
43
44
    'matplotlib', 'numpy', 'scikit-learn', 'scipy', 'gdal', 'pyproj', 'shapely', 'ephem', 'pyorbital', 'dill', 'pytz',
    'pandas', 'numba', 'spectral>=0.16', 'geopandas', 'iso8601', 'pyinstrument', 'geoalchemy2', 'sqlalchemy',
45
    'psycopg2', 'py_tools_ds>=0.12.4', 'geoarray>=0.8.0', 'arosics>=0.8.7', 'six', 'tqdm', 'jsmin', 'cerberus',
46
    'nested_dict', 'openpyxl', 'timeout_decorator', 'redis', 'retools', 'redis-semaphore', 'psutil', 'pyrsr>=0.3.1',
47
    'spechomo @ git+https://gitext.gfz-potsdam.de/geomultisens/spechomo#egg=spechomo'
Daniel Scheffler's avatar
Daniel Scheffler committed
48
    # spectral<0.16  has some problems with writing signed integer 8bit data
49
    # fmask # conda install -c conda-forge python-fmask
50
    # 'pyhdf', # conda install --yes -c conda-forge pyhdf
51
    # 'sicor', # pip install git+https://gitext.gfz-potsdam.de/EnMAP/sicor.git
52
]
53
setup_requirements = []  # TODO(danschef): put setup requirements (distutils extensions, etc.) here
54
test_requirements = requirements + ['coverage', 'nose', 'nose2', 'nose-htmloutput', 'rednose']
55
56

setup(
57
    name='gms_preprocessing',
58
    version=version['__version__'],
59
60
61
62
    description="GeoMultiSens - Scalable Multi-Sensor Analysis of Remote Sensing Data",
    long_description=readme + '\n\n' + history,
    author="Daniel Scheffler",
    author_email='daniel.scheffler@gfz-potsdam.de',
63
    url='https://gitext.gfz-potsdam.de/geomultisens/gms_preprocessing',
64
65
    packages=find_packages(),  # searches for packages with an __init__.py and returns them as properly formatted list
    package_dir={'gms_preprocessing': 'gms_preprocessing'},
66
    package_data={"database": ["gms_preprocessing/database/*"]},
67
68
    include_package_data=True,
    install_requires=requirements,
Daniel Scheffler's avatar
Daniel Scheffler committed
69
    scripts=["bin/run_gms.py", "bin/run_gms.sh"],
70
71
    license="GNU General Public License v3",
    zip_safe=False,
72
    keywords='gms_preprocessing',
73
    classifiers=[
Daniel Scheffler's avatar
Daniel Scheffler committed
74
        'Development Status :: 4 - Beta',
75
76
77
        'Intended Audience :: Developers',
        'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
        'Natural Language :: English',
78
        "Programming Language :: Python :: 2",
79
        'Programming Language :: Python :: 2.7',
80
81
82
83
84
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
85
86
        'Programming Language :: Python :: 3.7',
        'Programming Language :: Python :: 3.8',
87
88
89
90
    ],
    test_suite='tests',
    tests_require=test_requirements
)
91
92
93


# check for pyhdf
94
if not util.find_spec('pyhdf'):
95
96
    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.'
97
                  'It is not automatically installed.')
98
99

# check for fmask
100
if not util.find_spec('fmask'):
101
102
    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').")