Skip to content

Commit 97d72a3

Browse files
author
Thierry RAMORASOAVINA
committed
Create a python virtual-env under debian13 for testing purpose
1 parent 8d495b5 commit 97d72a3

File tree

2 files changed

+44
-3
lines changed

2 files changed

+44
-3
lines changed

.github/workflows/pip.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,18 @@ jobs:
8989
with:
9090
name: pip-package
9191
- name: Install package
92+
shell: bash
9293
run: |
9394
# Allow Pip to write to its cache
9495
mkdir -p /github/home/.cache/pip
9596
chown -R $(whoami) /github/home/.cache/pip
9697
# Install the Khiops Python library
98+
99+
# A virtual env is mandatory under debian
100+
if [[ "${{ matrix.container }}" == "debian13" ]]; then
101+
python -m venv khiops-debian-venv
102+
source khiops-debian-venv/bin/activate
103+
fi
97104
pip install --upgrade pip
98105
pip install $(ls khiops*.tar.gz)
99106
- name: Run tests
@@ -106,12 +113,18 @@ jobs:
106113
OMPI_MCA_rmaps_base_oversubscribe: true
107114
# Oversubscribe for Open MPI >= 5
108115
PRTE_MCA_rmaps_default_mapping_policy: :oversubscribe
116+
shell: bash
109117
run: |-
110118
# Make sure MPI support is not loaded through env modules
111119
# Note: As the Docker container's shell is non-interactive, environment
112120
# modules are currently not initializing the shell anyway
113121
if [ -n "$MODULESHOME" ]; then module unload mpi; fi
114122
123+
# A virtual env is mandatory under debian
124+
if [[ "${{ matrix.container }}" == "debian13" ]]; then
125+
source khiops-debian-venv/bin/activate
126+
fi
127+
115128
# Print khiops installation status
116129
kh-status
117130

.github/workflows/tests.yml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,19 +358,38 @@ jobs:
358358
token: ${{ secrets.GITHUB_TOKEN }}
359359
path: khiops-samples
360360
- name: Install khiops-python dev dependencies
361+
shell: bash
361362
run: |
362363
# The following git command is required,
363364
# as the Git repository is in a directory the current user does not own,
364365
# Python versioneer fails to compute the current version correctly otherwise
365366
git config --global --add safe.directory $(realpath .)
367+
368+
# A virtual env is mandatory under debian
369+
if [[ "${{ matrix.container }}" == "debian13" ]]; then
370+
python -m venv khiops-debian-venv
371+
source khiops-debian-venv/bin/activate
372+
fi
373+
366374
# Install tomli for Python < 3.11
367-
pip install --user tomli
375+
pip install tomli
368376
python scripts/extract_dependencies_from_pyproject_toml.py -f "pyproject.toml" > requires.txt
369-
pip install --user `cat requires.txt`
377+
pip install `cat requires.txt`
370378
rm -f requires.txt
379+
if [[ "${{ matrix.container }}" == "debian13" ]]; then
380+
deactivate
381+
fi
371382
- name: Setup and Install Test Requirements
372-
run: |
383+
shell: bash
384+
run: |-
385+
# A virtual env is mandatory under debian
386+
if [[ "${{ matrix.container }}" == "debian13" ]]; then
387+
source khiops-debian-venv/bin/activate
388+
fi
373389
pip install -r test-requirements.txt
390+
if [[ "${{ matrix.container }}" == "debian13" ]]; then
391+
deactivate
392+
fi
374393
- name: Test Khiops Integration
375394
env:
376395
# Force > 2 CPU cores to launch mpiexec
@@ -381,6 +400,7 @@ jobs:
381400
OMPI_MCA_rmaps_base_oversubscribe: true
382401
# Oversubscribe for Open MPI >= 5
383402
PRTE_MCA_rmaps_default_mapping_policy: :oversubscribe
403+
shell: bash
384404
run: |-
385405
# Reset the default 'exit-on-error' mode of the bash shell in Github actions
386406
# so that the return code can be evaluated if needed
@@ -391,6 +411,11 @@ jobs:
391411
# modules are currently not initializing the shell anyway
392412
if [ -n "$MODULESHOME" ]; then module unload mpi; fi
393413
414+
# A virtual env is mandatory under debian
415+
if [[ "${{ matrix.container }}" == "debian13" ]]; then
416+
source khiops-debian-venv/bin/activate
417+
fi
418+
394419
# Print status
395420
python -c \
396421
"import sys; import khiops.core as kh; return_code = kh.get_runner().print_status(); sys.exit(return_code)"
@@ -406,3 +431,6 @@ jobs:
406431
407432
# Execute Khiops sample (train and deploy model), which uses MPI
408433
python -m khiops.samples.samples -i deploy_model -e
434+
if [[ "${{ matrix.container }}" == "debian13" ]]; then
435+
deactivate
436+
fi

0 commit comments

Comments
 (0)