-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
55 lines (50 loc) · 1.85 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
import os
import sys
import logging
import subprocess
from setuptools import setup, find_packages
logging.basicConfig(stream=sys.stderr, level=logging.INFO)
log = logging.getLogger()
# get install requirements
with open('requirements.txt') as fh:
install_requires = fh.read().splitlines()
# run cmd from the command line
def check_output(cmd):
return subprocess.check_output(cmd).decode('utf')
# check if GDAL is installed
gdal_output = [None] * 4
try:
for i, flag in enumerate(("--cflags", "--libs", "--datadir", "--version")):
gdal_output[i] = check_output(['gdal-config', flag]).strip()
except:
log.warning('Failed to get options via gdal-config')
else:
log.info("GDAL version from via gdal-config: {0}".format(gdal_output[3]))
# if setting GDAL version from via gdal-config
if gdal_output[3]:
# add version information to gdal in install_requires
gdal_index = install_requires.index('gdal')
install_requires[gdal_index] = 'gdal=={0}'.format(gdal_output[3])
setup(
name='subsetting_tools',
version='0.0.0.2',
description='Program for using the LP.DAAC GEDI subsetter api for retrieving NASA GEDI data',
url='https://github.com/tsutterley/lpdaac-gedi-subsetter',
author='Tyler Sutterley',
author_email='tsutterl@uw.edu',
license='MIT',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering :: Physics',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
],
keywords='LP.DAAC GEDI laser altimetry subsetting',
packages=find_packages(),
scripts=['lpdaac_subset_gedi.py'],
install_requires=install_requires,
)