Skip to content

Commit a4dffc6

Browse files
author
Thierry RAMORASOAVINA
committed
Add temporary hacks for debian13 and python < 3.10 when testing
- a special flag is required to install pip packages under debian13 - conda : python 3.8 must be pinned to avoid installation conflicts - conda : the alternative khiops-dev channel must be given for python 3.9 otherwise the installation of khiops-python dependencies fails
1 parent 334acd5 commit a4dffc6

File tree

2 files changed

+29
-6
lines changed

2 files changed

+29
-6
lines changed

.github/workflows/pip.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,21 @@ 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
97-
pip install --upgrade pip
98-
pip install $(ls khiops*.tar.gz)
98+
99+
# Hack for pip under debian, the alternatives are using venv or pipx
100+
if [[ "${{ matrix.container }}" == "debian13" ]]; then
101+
BREAK_SYSTEM_PACKAGES_FLAG="--break-system-packages"
102+
else
103+
# Under debian, the uninstallation of the previous version will fail
104+
pip install --upgrade pip
105+
fi
106+
pip install ${BREAK_SYSTEM_PACKAGES_FLAG} $(ls khiops*.tar.gz)
99107
- name: Run tests
100108
env:
101109
KHIOPS_SAMPLES_DIR: ${{ github.workspace }}/khiops-samples

.github/workflows/tests.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ jobs:
9292
done
9393
- name: Install khiops-python dependencies
9494
if: success() || failure()
95+
shell: bash
9596
run: |
9697
# The following git command is required,
9798
# as the Git repository is in a directory the current user does not own,
@@ -109,7 +110,15 @@ jobs:
109110
# Add homogeneous TOML support (Python >= 3.12 has standard tomllib)
110111
$CONDA install -y -n "$CONDA_ENV" tomli
111112
$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`
113+
if [[ "${{ matrix.python-version }}" == "3.8" ]]; then
114+
# for python3.8 a pinned version of python is required to avoid installation conflicts
115+
$CONDA install -y -n "$CONDA_ENV" `cat requires.txt` python=${{ matrix.python-version }} python_abi=${{ matrix.python-version }}
116+
elif [[ "${{ matrix.python-version }}" == "3.9" ]]; then
117+
# for python3.9 only, conda "forgets" the specific dev channel used for khiops-core
118+
$CONDA install -c https://anaconda.org/khiops-dev -y -n "$CONDA_ENV" `cat requires.txt`
119+
else
120+
$CONDA install -y -n "$CONDA_ENV" `cat requires.txt`
121+
fi
113122
rm -f requires.txt
114123
done
115124
- name: Configure Expensive Tests Setting
@@ -356,20 +365,26 @@ jobs:
356365
ref: ${{ env.SAMPLES_REVISION }}
357366
token: ${{ secrets.GITHUB_TOKEN }}
358367
path: khiops-samples
368+
- name: Hack for pip under debian13
369+
if: matrix.container == 'debian13'
370+
run: |
371+
# Hack for pip under debian, the alternatives are using venv or pipx
372+
BREAK_SYSTEM_PACKAGES_FLAG="--break-system-packages"
373+
echo "BREAK_SYSTEM_PACKAGES_FLAG=${BREAK_SYSTEM_PACKAGES_FLAG}" >> $GITHUB_ENV
359374
- name: Install khiops-python dev dependencies
360375
run: |
361376
# The following git command is required,
362377
# as the Git repository is in a directory the current user does not own,
363378
# Python versioneer fails to compute the current version correctly otherwise
364379
git config --global --add safe.directory $(realpath .)
365380
# Install tomli for Python < 3.11
366-
pip install --user tomli
381+
pip install ${BREAK_SYSTEM_PACKAGES_FLAG} tomli
367382
python scripts/extract_dependencies_from_pyproject_toml.py -f "pyproject.toml" > requires.txt
368-
pip install --user `cat requires.txt`
383+
pip install ${BREAK_SYSTEM_PACKAGES_FLAG} `cat requires.txt`
369384
rm -f requires.txt
370385
- name: Setup and Install Test Requirements
371386
run: |
372-
pip install -r test-requirements.txt
387+
pip install ${BREAK_SYSTEM_PACKAGES_FLAG} -r test-requirements.txt
373388
- name: Test Khiops Integration
374389
env:
375390
# Force > 2 CPU cores to launch mpiexec

0 commit comments

Comments
 (0)