Skip to content

Commit 6e5ac9e

Browse files
author
Thierry RAMORASOAVINA
committed
Create a python virtual-env under debian13 for testing purpose
1 parent ca7300c commit 6e5ac9e

2 files changed

Lines changed: 36 additions & 4 deletions

File tree

.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
@@ -107,12 +114,18 @@ jobs:
107114
OMPI_MCA_rmaps_base_oversubscribe: true
108115
# Oversubscribe for MPI >= 5
109116
PRTE_MCA_rmaps_default_mapping_policy: :oversubscribe
117+
shell: bash
110118
run: |-
111119
# Make sure MPI support is not loaded through env modules
112120
# Note: As the Docker container's shell is non-interactive, environment
113121
# modules are currently not initializing the shell anyway
114122
if [ -n "$MODULESHOME" ]; then module unload mpi; fi
115123
124+
# A virtual env is mandatory under debian
125+
if [[ "${{ matrix.container }}" == "debian13" ]]; then
126+
source khiops-debian-venv/bin/activate
127+
fi
128+
116129
# Print khiops installation status
117130
kh-status
118131

.github/workflows/tests.yml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ jobs:
109109
# Add homogeneous TOML support (Python >= 3.12 has standard tomllib)
110110
$CONDA install -y -n "$CONDA_ENV" tomli
111111
$CONDA run --no-capture-output -n "$CONDA_ENV" python scripts/extract_dependencies_from_pyproject_toml.py -f "pyproject.toml" > requires.txt
112-
$CONDA install -y -n "$CONDA_ENV" `cat requires.txt`
112+
$CONDA install -y -n "$CONDA_ENV" `cat requires.txt`
113113
rm -f requires.txt
114114
done
115115
- name: Configure Expensive Tests Setting
@@ -357,18 +357,31 @@ jobs:
357357
token: ${{ secrets.GITHUB_TOKEN }}
358358
path: khiops-samples
359359
- name: Install khiops-python dev dependencies
360+
shell: bash
360361
run: |
361362
# The following git command is required,
362363
# as the Git repository is in a directory the current user does not own,
363364
# Python versioneer fails to compute the current version correctly otherwise
364365
git config --global --add safe.directory $(realpath .)
366+
367+
# A virtual env is mandatory under debian
368+
if [[ "${{ matrix.container }}" == "debian13" ]]; then
369+
python -m venv khiops-debian-venv
370+
source khiops-debian-venv/bin/activate
371+
fi
372+
365373
# Install tomli for Python < 3.11
366-
pip install --user tomli
374+
pip install tomli
367375
python scripts/extract_dependencies_from_pyproject_toml.py -f "pyproject.toml" > requires.txt
368-
pip install --user `cat requires.txt`
376+
pip install `cat requires.txt`
369377
rm -f requires.txt
370378
- name: Setup and Install Test Requirements
371-
run: |
379+
shell: bash
380+
run: |-
381+
# A virtual env is mandatory under debian
382+
if [[ "${{ matrix.container }}" == "debian13" ]]; then
383+
source khiops-debian-venv/bin/activate
384+
fi
372385
pip install -r test-requirements.txt
373386
- name: Test Khiops Integration
374387
env:
@@ -381,6 +394,7 @@ jobs:
381394
OMPI_MCA_rmaps_base_oversubscribe: true
382395
# Oversubscribe for MPI >= 5
383396
PRTE_MCA_rmaps_default_mapping_policy: :oversubscribe
397+
shell: bash
384398
run: |-
385399
# Reset the default 'exit-on-error' mode of the bash shell in Github actions
386400
# so that the return code can be evaluated if needed
@@ -391,6 +405,11 @@ jobs:
391405
# modules are currently not initializing the shell anyway
392406
if [ -n "$MODULESHOME" ]; then module unload mpi; fi
393407
408+
# A virtual env is mandatory under debian
409+
if [[ "${{ matrix.container }}" == "debian13" ]]; then
410+
source khiops-debian-venv/bin/activate
411+
fi
412+
394413
# Print status
395414
python -c \
396415
"import sys; import khiops.core as kh; return_code = kh.get_runner().print_status(); sys.exit(return_code)"

0 commit comments

Comments
 (0)