-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
30 lines (22 loc) · 870 Bytes
/
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
import subprocess
from distutils.core import setup
from pip.req import parse_requirements
class GDALNotFoundException(Exception):
pass
def get_gdal_version():
cmd = subprocess.Popen(['gdal-config', '--version'], stdout=subprocess.PIPE)
cmd_out, cmd_err = cmd.communicate()
if cmd.returncode != 0:
raise GDALNotFoundException('Could not find GDAL')
return cmd_out
install_reqs = parse_requirements('requirements.txt', session=False)
reqs = [str(ir.req) for ir in install_reqs]
gdal_version = get_gdal_version()
reqs.append('GDAL~={}'.format(gdal_version))
setup(name='girder_ktile',
version='0.0.1',
description='A Girder Plugin to server geospatial tiles',
author='Doruk Ozturk',
author_email='[email protected]',
url='https://github.com/OpenGeoscience/girder_ktile',
install_requires=reqs)