Configurer l’environnement de développement¶
Prérequis système¶
Python >= 3.10
GDAL >= 3.4
Accès réseau sur :
l’instance GitLab : https://gitlab.gpf-tech.ign.fr
le dépôt officiel de paquets Python : https://pypi.org/
un jeton d’accès personnel (Personal Access Token (PAT)) avec le scope
read_api
ou a minimaread_registry
. Voir la page Authentification.
Installation de GDAL¶
Définir la version à utiliser :
export GDAL_VERSION=3.*
# ou plus strictement : export GDAL_VERSION=3.4.1
Installer GDAL :
sudo apt install gdal-bin=$GDAL_VERSION libgdal-dev=$GDAL_VERSION
Ajouter les chemins utiles pour builder en variables d’environnement :
export CPLUS_INCLUDE_PATH=/usr/include/gdal
export C_INCLUDE_PATH=/usr/include/gdal
Installation en environnement virtuel¶
# environnement virtuel
python3 -m venv .venv
source .venv/bin/activate
# mise à jour de pip dans l'environnement virtuel
python3 -m pip install -U pip setuptools wheel
# installation des dépendances de base
python3 -m pip install -r requirements.txt
# installation du projet en mode développement avec la version de GDAL du système
python3 -m pip install -e .[gdal]
# pre-commit
pip install pre-commit pre-commit-hooks
pre-commit install