Skip to content

Commit

Permalink
coercing gdal version in setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jankovicgd committed Jan 25, 2023
1 parent b12a5da commit 14c94ca
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
# -----------------------------------------------------------------------------

import os
import subprocess
from setuptools import setup

# get version number
Expand Down Expand Up @@ -79,6 +80,11 @@ def fullsplit(path, result=None):
if on_rtd:
ext_modules = []

try:
gdal_version = subprocess.check_output(['gdal-config','--version']).decode('utf-8').strip()
except FileNotFoundError:
gdal_version = subprocess.check_output(['gdalinfo','--version']).decode('utf-8').split(' ')[1].strip(',')

setup(
name='EOxServer',
version=version.replace(' ', '-'),
Expand Down Expand Up @@ -107,7 +113,7 @@ def fullsplit(path, result=None):
"python-swiftclient<5.0.0",
"jsonfield",
"gunicorn",
"gdal",
f"gdal=={gdal_version}",
"mapscript"
],
extras_require={
Expand Down

0 comments on commit 14c94ca

Please sign in to comment.