Skip to content

Commit e18eaef

Browse files
authored
Merge pull request #244 from a5dur/patch-1
Update GDAL installation and dependency setup
2 parents 27cc1d6 + 1c51b69 commit e18eaef

File tree

1 file changed

+65
-14
lines changed

1 file changed

+65
-14
lines changed

.github/workflows/main.yml

Lines changed: 65 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -89,27 +89,78 @@ jobs:
8989
- name: Install requirements, ckanapi and datapusher-plus
9090
run: |
9191
set -eu
92-
# Use pip from the container (image usually has Python/pip)
93-
python3 -m pip install --upgrade pip setuptools wheel
92+
93+
# Install system dependencies first (including GDAL and geospatial libraries)
94+
apt-get update
95+
apt-get install -y \
96+
python3-virtualenv \
97+
python3-dev \
98+
python3-pip \
99+
python3-wheel \
100+
build-essential \
101+
libxslt1-dev \
102+
libxml2-dev \
103+
libffi-dev \
104+
libpq-dev \
105+
zlib1g-dev \
106+
git \
107+
uchardet \
108+
unzip \
109+
gdal-bin \
110+
libgdal-dev \
111+
libspatialindex-dev \
112+
libgeos-dev \
113+
libproj-dev
114+
115+
# Get GDAL version for Python bindings
116+
export GDAL_VERSION=$(gdal-config --version)
117+
echo "GDAL version: $GDAL_VERSION"
118+
119+
# Set GDAL environment variables
120+
export CPLUS_INCLUDE_PATH=/usr/include/gdal
121+
export C_INCLUDE_PATH=/usr/include/gdal
122+
123+
# Upgrade pip and build tools
124+
python3 -m pip install --upgrade pip setuptools wheel
125+
126+
# Install GDAL Python bindings matching system GDAL version
127+
pip install "GDAL==$GDAL_VERSION"
128+
129+
# Install project requirements if they exist
94130
if [ -f requirements.txt ]; then
95-
pip install -r requirements.txt
131+
pip install -r requirements.txt
96132
fi
133+
97134
if [ -f requirements-dev.txt ]; then
98-
pip install -r requirements-dev.txt
135+
pip install -r requirements-dev.txt
99136
fi
100-
# install current repo editable if present
137+
138+
# Install current repo in editable mode if setup files exist
101139
if [ -f setup.py ] || [ -f pyproject.toml ]; then
102-
pip install -e .
140+
pip install -e .
103141
fi
104-
# Ensure ckanapi and datapusher-plus are available
142+
143+
# Install core dependencies
105144
pip install --upgrade ckanapi
106-
pip install datasize
107-
apt install -y python3-virtualenv python3-dev python3-pip python3-wheel build-essential libxslt1-dev libxml2-dev zlib1g-dev git libffi-dev libpq-dev uchardet unzip
108-
# Install datapusher-plus package (the pip package name is typically datapusher-plus)
109-
echo "Installing datapusher-plus from branch: $DATAPUSHER_BRANCH"
110-
pip install -e "git+https://github.com/dathere/datapusher-plus.git@$DATAPUSHER_BRANCH#egg=datapusher-plus"
111-
pip install -e 'git+https://github.com/ckan/ckanext-scheming.git#egg=ckanext-scheming'
112-
echo "Installed ckanapi and datapusher-plus (best-effort)"
145+
146+
# Clone datapusher-plus and install its requirements first
147+
echo "Cloning datapusher-plus from branch: $DATAPUSHER_BRANCH"
148+
git clone --depth 1 --branch "$DATAPUSHER_BRANCH" https://github.com/dathere/datapusher-plus.git /tmp/datapusher-plus
149+
150+
# Install datapusher-plus requirements
151+
cd /tmp/datapusher-plus
152+
if [ -f requirements.txt ]; then
153+
pip install -r requirements.txt
154+
fi
155+
156+
# Install datapusher-plus itself
157+
pip install -e .
158+
cd -
159+
160+
# Install ckanext-scheming
161+
pip install -e 'git+https://github.com/ckan/ckanext-scheming.git#egg=ckanext-scheming'
162+
163+
echo "Installation complete: GDAL, ckanapi, datapusher-plus, and ckanext-scheming"
113164
- name: Install qsv (musl static)
114165
run: |
115166
set -eu

0 commit comments

Comments
 (0)