Development environment

Requirements

  • Python >= 3.11

  • GDAL >= 3.5, with its Python bindings matching the version of the library

  • Git

  • network access to the Python Package Index

System requirements

Tested on Ubuntu 22.04 and 24.04.

The GDAL Python bindings are built against the system library: libgdal-dev is required. The GDAL of the distribution may be old, two PPA to get a newer one. Some packages are needed to add them:

sudo apt install ca-certificates gnupg lsb-release software-properties-common

With QGIS installed, use the same GDAL version through the QGIS PPA:

sudo mkdir -p /etc/apt/keyrings
sudo wget -O /etc/apt/keyrings/qgis-archive-keyring.gpg https://download.qgis.org/downloads/qgis-archive-keyring.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/qgis-archive-keyring.gpg] https://qgis.org/ubuntu-ltr \
$(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/qgis.list > /dev/null
sudo apt update

Or UbuntuGIS, for the latest GDAL versions:

sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt update

Then:

sudo apt install gdal-bin libgdal-dev git python3-dev python3-venv
gdal-config --version

A specific version can be pinned: sudo apt install gdal-bin=3.8.4* libgdal-dev=3.8.4*.

If the build of the bindings doesn’t find the GDAL headers:

export CPLUS_INCLUDE_PATH=/usr/include/gdal
export C_INCLUDE_PATH=/usr/include/gdal

Tested on Windows 10 and 11.

  • Python installed with the installer of python.org: the one of the Microsoft Store doesn’t work

  • Git

The GDAL Python bindings come as prebuilt wheels, GDAL included.

To activate a virtual environment, PowerShell must allow local scripts. Once, in a PowerShell prompt:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

conda or mamba ship GDAL as a prebuilt package, on every OS. requirements/conda-env-dev.yml describes an environment with GDAL and PyInstaller.

Install

Clone the repository:

git clone https://github.com/Guts/DicoGIS.git
cd DicoGIS

Create the virtual environment, add GDAL to it, then install the project in editable mode with the development, GUI and test dependencies:

python3 -m venv .venv
source .venv/bin/activate
python -m pip install -U pip setuptools wheel
python -m pip install -U gdal=="$(gdal-config --version).*"
python -m pip install -U -e .[gdal,dev,gui,test]
py -3.12 -m venv .venv
.\.venv\Scripts\activate
python -m pip install -U pip setuptools wheel
python -m pip install --index-url https://gisidx.github.io/gwi gdal
python -m pip install -U -e .[gdal,dev,gui,test]

The GDAL wheel comes from Geospatial Wheels Index, a third-party index serving the cgohlke/geospatial-wheels builds, not an official PyPI channel. A wheel downloaded from there can be installed instead: python -m pip install .\GDAL-3.11.4-cp312-cp312-win_amd64.whl.

In the Anaconda prompt:

conda env create -f requirements/conda-env-dev.yml
conda activate dicogis-dev
python -m pip install -U -e .[dev,gui,test]

The version of the project comes from the git tags, see the release workflow: re-install it to refresh it after new commits or tags.

Install the git hooks:

pre-commit install

Try it

dicogis-cli --help
dicogis-gui

The interface stays in English until the translations are compiled, see translations.