-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
45 lines (40 loc) · 1.62 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
from skbuild import setup
import subprocess
from packaging.version import LegacyVersion
from skbuild.exceptions import SKBuildError
from skbuild.cmaker import get_cmake_version
def get_installed_gdal_version():
try:
version = subprocess.run(["gdal-config","--version"], stdout=subprocess.PIPE).stdout.decode()
version = version.replace('\n', '')
version = "=="+version+".*"
return version
except FileNotFoundError as e:
raise(""" ERROR: Could not find the system install of GDAL.
Please install it via your package manage of choice.
"""
)
# Add CMake as a build requirement if cmake is not installed or is too low a version
# https://scikit-build.readthedocs.io/en/latest/usage.html#adding-cmake-as-building-requirement-only-if-not-installed-or-too-low-a-version
setup_requires = []
try:
if LegacyVersion(get_cmake_version()) < LegacyVersion("3.16"):
setup_requires.append('cmake')
except SKBuildError:
setup_requires.append('cmake')
setup(name='windmapper',
version='1.0.0',
description='Windfield library generation',
long_description="""
Generates windfields
""",
author='Chris Marsh',
author_email='[email protected]',
url="https://github.com/Chrismarsh/Windmapper",
include_package_data=True,
cmake_args=['-DCMAKE_BUILD_TYPE=Release'],
scripts=["windmapper.py","cli_massSolver.cfg"],
install_requires=['pygdal'+get_installed_gdal_version(),'numpy','scipy','elevation','pyproj','tqdm'],
setup_requires=setup_requires,
python_requires='>=3.6'
)