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.
Cloner le dépôt¶
Exemple pour Oslandia avec l’utilisateur geojulien
:
git clone --config 'credential.helper=store' https://geojulien@gitlab.gpf-tech.ign.fr/geoplateforme/scripts-verification/check-raster.git
Derrière le proxy¶
L’Usine Logicielle étant en accès restreint derrière un filtre IP, les personnes ne disposant pas d’IP fixe passent par un proxy qui pointe sur un serveur de rebond dont l’IP fixe est autorisée.
Exemple avec un proxy de type socks :
git clone --config http.proxy='socks5://127.0.0.1:8645' --config 'credential.helper=store' https://geojulien@gitlab.gpf-tech.ign.fr/geoplateforme/scripts-verification/check-raster
Démarrage rapide¶
Exemple sur une distribution Linux de type Ubuntu LTS.
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
Environnement virtuel¶
Installer dans un environnement virtuel :
# environnement virtuel
python3 -m venv .venv
source .venv/bin/activate
# mise à jour de pip dans l'environnement virtuel
python -m pip install -U pip setuptools wheel
# installation de GDAL
python3 -m pip install gdal=="`gdal-config --version`.*"
# installation des dépendances de base
python -m pip install -r requirements.txt
# pre-commit
pip install pre-commit pre-commit-hooks
pre-commit install