1"""GIDDY: GeospatIal Distribution DYnamics
2
3Giddy is an open-source python library for the analysis of dynamics of
4longitudinal spatial data. Originating from the spatial dynamics module
5in PySAL (Python Spatial Analysis Library), it is under active development
6for the inclusion of many newly proposed analytics that consider the
7role of space in the evolution of distributions over time and has
8several new features including inter- and intra-regional decomposition
9of mobility association and local measures of exchange mobility in
10addition to space-time LISA and spatial markov methods. Give
11giddy a try if you are interested in space-time analysis!
12
13"""
14
15DOCLINES = __doc__.split("\n")
16
17with open('README.md', 'r', encoding='utf8') as file:
18    long_description = file.read()
19
20
21from setuptools import setup, find_packages
22from distutils.command.build_py import build_py
23import os
24
25# Get __version__ from giddy/__init__.py without importing the package
26# __version__ has to be defined in the first line
27with open('giddy/__init__.py', 'r') as f:
28    exec(f.readline())
29
30# BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
31# update it when the contents of directories change.
32if os.path.exists('MANIFEST'):
33    os.remove('MANIFEST')
34
35def _get_requirements_from_files(groups_files):
36    groups_reqlist = {}
37
38    for k,v in groups_files.items():
39        with open(v, 'r') as f:
40            pkg_list = f.read().splitlines()
41        groups_reqlist[k] = pkg_list
42
43    return groups_reqlist
44
45def setup_package():
46    _groups_files = {
47        'base': 'requirements.txt',
48        'tests': 'requirements_tests.txt',
49        'docs': 'requirements_docs.txt'
50    }
51
52    reqs = _get_requirements_from_files(_groups_files)
53    install_reqs = reqs.pop('base')
54    extras_reqs = reqs
55
56    setup(name='giddy',  # name of package
57          version=__version__,
58          description=DOCLINES[0],
59          #long_description="\n".join(DOCLINES[2:]),
60          long_description = long_description,
61          long_description_content_type = 'text/markdown',
62          url='https://github.com/pysal/giddy',
63          maintainer='Wei Kang',
64          maintainer_email='weikang9009@gmail.com',
65          py_modules=['giddy'],
66          python_requires='>3.5',
67          # setup_requires=["pytest-runner"],
68          # tests_require=["pytest"],
69          keywords='spatial statistics, spatiotemporal analysis',
70          classifiers=[
71            'Development Status :: 5 - Production/Stable',
72            'Intended Audience :: Science/Research',
73            'Intended Audience :: Developers',
74            'Intended Audience :: Education',
75            'Topic :: Scientific/Engineering',
76            'Topic :: Scientific/Engineering :: GIS',
77            'License :: OSI Approved :: BSD License',
78            'Programming Language :: Python',
79            'Programming Language :: Python :: 3.6',
80            'Programming Language :: Python :: 3.7',
81            'Programming Language :: Python :: 3.8'
82            ],
83          license='3-Clause BSD',
84          packages=find_packages(),
85          install_requires=install_reqs,
86          extras_require=extras_reqs,
87          zip_safe=False,
88          cmdclass={'build.py': build_py})
89
90if __name__ == '__main__':
91    setup_package()
92