forked from perrygeo/python-rasterstats
-
Notifications
You must be signed in to change notification settings - Fork 5
/
setup.py
68 lines (60 loc) · 2.13 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
import os
import sys
import re
from setuptools import setup
from setuptools.command.test import test as TestCommand
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
def get_version():
vfile = os.path.join(
os.path.dirname(__file__), "src", "rasterstats", "_version.py")
with open(vfile, "r") as vfh:
vline = vfh.read()
vregex = r"^__version__ = ['\"]([^'\"]*)['\"]"
match = re.search(vregex, vline, re.M)
if match:
return match.group(1)
else:
raise RuntimeError("Unable to find version string in {}.".format(vfile))
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)
setup(
name="rasterstats",
version=get_version(),
author="Matthew Perry",
author_email="[email protected]",
description="Summarize geospatial raster datasets based on vector geometries",
license="BSD",
keywords="gis geospatial geographic raster vector zonal statistics",
url="https://github.com/perrygeo/python-raster-stats",
package_dir={'': 'src'},
packages=['rasterstats'],
long_description=read('README.rst'),
install_requires=read('requirements.txt').splitlines(),
tests_require=['pytest', 'pytest-cov>=2.2.0', 'pyshp>=1.1.4',
'coverage', 'simplejson'],
cmdclass={'test': PyTest},
classifiers=[
"Development Status :: 4 - Beta",
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
"License :: OSI Approved :: BSD License",
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
"Topic :: Utilities",
'Topic :: Scientific/Engineering :: GIS',
],
entry_points="""
[rasterio.rio_plugins]
zonalstats=rasterstats.cli:zonalstats
pointquery=rasterstats.cli:pointquery
""")