Setting up Development Environment#
Getting started with DataLab development is easy.
Here is what you will need:
An integrated development environment (IDE) for Python. We recommend Spyder or Visual Studio Code, but any IDE will do.
A Python distribution. We recommend WinPython, on Windows, or Anaconda, on Linux or Mac. But, again, any Python distribution will do.
A clean project structure (see below).
Test data (see below).
Environment variables (see below).
Third-party software (see below).
Development Environment#
If you are using Spyder, thank you for supporting the scientific open-source Python community!
If you are using Visual Studio Code, that’s also an excellent choice (for other reasons). We recommend installing the following extensions:
Extension |
Description |
|---|---|
Gettext syntax highlighting |
|
Python language server |
|
Python extension |
|
reStructuredText syntax highlighting |
|
Extremely fast Python linter and code formatter |
|
Todo tree |
|
Insert GUID |
|
XML Tools |
Python Environment#
DataLab requires the following :
Python (e.g. WinPython)
Additional Python packages
Installing all required packages :
pip install --upgrade -r requirements.txt
ℹ️ See Installation for more details on reference Python and Qt versions.
⚠️ DataLab relies on its sibling repositories Sigima (processing features), SigimaX (application framework) and DataLab-Capsule (workspace capsules). If your contribution needs unreleased changes of these repositories (e.g. a processing feature, implemented in Sigima), you will need to work on them too. Either install them in editable mode:
pip install -e ../Sigima -e ../SigimaX -e ../DataLab-Capsule # Adjust the paths to your local repositories
or add them to the PYTHONPATH variable of the .env file (see below), e.g. PYTHONPATH=.;../Sigima;../SigimaX;../DataLab-Capsule/src.
If you are using WinPython, thank you for supporting the scientific open-source Python community!
The following table lists the currently officially used Python distributions:
Python version |
Status |
WinPython version |
|---|---|---|
3.10 |
OK |
3.10.11.1 |
3.11 |
OK |
3.11.5.0 |
3.12 |
OK |
3.12.3.0 |
3.13 |
OK |
3.13.2.0 |
3.14 |
OK |
3.14.5.0 |
⚠ We strongly recommend using the .dot versions of WinPython which are lightweight
and can be customized to your needs (using pip install -r requirements.txt).
✅ We also recommend using a dedicated WinPython instance for DataLab.
Test data#
DataLab test data are located in different folders, depending on their nature or origin.
Required data for unit tests are located in “datalab\data\tests” (public data).
A second folder %DATALAB_DATA% (optional) may be defined for additional tests which are still under development (or for confidential data).
Specific environment variables#
Enable the “debug” mode (no stdin/stdout redirection towards internal console):
@REM Mode DEBUG
set DATALAB_DEBUG=1
Building PDF documentation requires LaTeX. On Windows, the following environment:
@REM LaTeX executable must be in Windows PATH, for mathematical equations rendering
@REM Example with MiKTeX :
set PATH=C:\\Apps\\miktex-portable\\texmfs\\install\\miktex\\bin\\x64;%PATH%
Visual Studio Code configuration used in launch.json and/or tasks.json
(examples) :
@REM Folder containing additional working test data
set DATALAB_DATA=C:\Dev\Projets\DATALAB_data
Visual Studio Code .env file:
This file is used to set environment variables for the application.
It is used to set the
PYTHONPATHenvironment variable to the root of the project.This is required to be able to import the project modules from within VS Code.
To create this file, copy the
.env.templatefile to.env(and eventually add your own paths).
Windows installer#
The official Windows executable and MSI installer are built by the GitHub CI release pipeline. The Python version embedded in the standalone application shipped to end users is defined by the python-version input default of the reusable build workflow (.github/workflows/_build.yml), consumed by its build-msi job; the release workflows do not override it. That workflow is the single source of truth — refer to it for the exact version currently in use.
The Windows installer is built using WiX Toolset V4 (the CI release pipeline installs the latest 4.x version, with the WiX UI extension V4.0.5). Using the WiX Toolset requires .NET SDK V6.0 minimum.
You may install .NET SDK using winget:
winget install Microsoft.DotNet.SDK.8
Once .NET SDK is installed, the WiX Toolset can be installed and configured using the following commands:
dotnet tool install --global wix --version 4.*
wix extension add -g WixToolset.UI.wixext/4.0.5
First, you need to generate the installer script from a generic template (replace X.Y.Z by the version of DataLab, e.g. 1.4.0):
python wix/makewxs.py DataLab X.Y.Z
Building the installer is done using the following command:
wix build wix\DataLab-X.Y.Z.wxs -ext WixToolset.UI.wixext
Alternatively, scripts\build_installer.bat (Visual Studio Code task “📦 Create installer”) runs both commands for the current version of DataLab.
Release smoke test#
Before uploading the MSI installer, the build-msi job of the reusable build workflow smoke-tests it with scripts/frozen_smoke_test.py: it installs the MSI in a disposable folder, compares the installed files with the PyInstaller folder, starts the installed DataLab.exe in unattended mode with screenshots, runs DataLab.exe --smoke-test (installation check implemented in datalab/utils/smoketest.py), uninstalls the MSI and checks that the release artifacts were not modified. Any failure fails the job, so nothing is published. The screenshots, reports and logs are uploaded as the msi-smoke-test artifact.
To run it locally, after building the executable and the installer (the script refuses to run if DataLab of the same major version is installed on the computer, as it uninstalls the MSI at the end):
python scripts/frozen_smoke_test.py all --msi wix/DataLab-1.4.0.msi --dist dist/DataLab --workdir build/msi-smoke-test
The gui and probe commands of this script only start an executable (e.g. dist/DataLab/DataLab.exe) with screenshots, or run its installation check.
When DataLab requires versions of Sigima, SigimaX or DataLab-Capsule which are not published yet, run the “Release (dry-run)” workflow with the dependencies input set to development: these packages are then built from their branch named like the dispatched branch, or from develop.
Third-party Software#
The following software may be required for maintaining the project: