Skip to content

Commit 7acccc5

Browse files
author
Thierry RAMORASOAVINA
committed
Create a python virtual-env under debian13 for testing purpose
1 parent 051e9de commit 7acccc5

File tree

2 files changed

+50
-3
lines changed

2 files changed

+50
-3
lines changed

.github/workflows/pip.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,23 @@ 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)
106+
if [[ "${{ matrix.container }}" == "debian13" ]]; then
107+
deactivate
108+
fi
99109
- name: Run tests
100110
env:
101111
KHIOPS_SAMPLES_DIR: ${{ github.workspace }}/khiops-samples
@@ -106,12 +116,18 @@ jobs:
106116
OMPI_MCA_rmaps_base_oversubscribe: true
107117
# Oversubscribe for Open MPI >= 5
108118
PRTE_MCA_rmaps_default_mapping_policy: :oversubscribe
119+
shell: bash
109120
run: |-
110121
# Make sure MPI support is not loaded through env modules
111122
# Note: As the Docker container's shell is non-interactive, environment
112123
# modules are currently not initializing the shell anyway
113124
if [ -n "$MODULESHOME" ]; then module unload mpi; fi
114125
126+
# A virtual env is mandatory under debian
127+
if [[ "${{ matrix.container }}" == "debian13" ]]; then
128+
source khiops-debian-venv/bin/activate
129+
fi
130+
115131
# Print khiops installation status
116132
kh-status
117133
@@ -125,6 +141,9 @@ jobs:
125141
# The MPI command is not always named mpiexec, but can be orterun etc
126142
# (as given by khiops_env)
127143
kh-status | grep "MPI command" | grep -vwq "<empty>"
144+
if [[ "${{ matrix.container }}" == "debian13" ]]; then
145+
deactivate
146+
fi
128147
- name: Test package / Git tag version coherence
129148
shell: bash
130149
if: github.ref_type == 'tag'

.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)