Skip to content

Commit 76d67b9

Browse files
author
Thierry RAMORASOAVINA
committed
Remove the setup and usage of all the Conda environments py3.XX_conda
- Remove the environments creation in the docker files - Remove the installation of the Conda packages - Remove the usage of these environments in the tests (unit and integration tests)
1 parent b205eb8 commit 76d67b9

5 files changed

Lines changed: 40 additions & 93 deletions

File tree

.github/workflows/dev-docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ on:
2828
set-latest:
2929
type: boolean
3030
default: false
31-
description: Set as 'latest'
31+
description: Set as 'latest' (if the current branch is 'main')
3232
python-versions:
3333
type: string
3434
default: 3.10 3.11 3.12 3.13 3.14

.github/workflows/tests.yml

Lines changed: 21 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,14 @@ jobs:
7878
run: |
7979
CONDA="/root/miniforge3/bin/conda"
8080
81-
# Native Khiops-based Conda environment, and
81+
# Native Khiops-based Conda environment (to test in a specific python version)
8282
# `khiops-core`-based Conda environment
83-
CONDA_ENVS="py${{ matrix.python-version }} py${{ matrix.python-version }}_conda"
84-
for CONDA_ENV in $CONDA_ENVS
85-
do
86-
mkdir -p -m u+rwx reports/"$CONDA_ENV"
83+
CONDA_ENV=py${{ matrix.python-version }}
84+
mkdir -p -m u+rwx reports/"$CONDA_ENV"
8785
88-
# install within the conda environments without activating them
89-
$CONDA install -y -n "$CONDA_ENV" unittest-xml-reporting
90-
$CONDA install -y -n "$CONDA_ENV" --file test-requirements.txt
91-
done
86+
# install within the conda environments without activating them
87+
$CONDA install -y -n "$CONDA_ENV" unittest-xml-reporting
88+
$CONDA install -y -n "$CONDA_ENV" --file test-requirements.txt
9289
- name: Install khiops-python dependencies
9390
if: success() || failure()
9491
run: |
@@ -97,20 +94,16 @@ jobs:
9794
# Python versioneer fails to compute the current version correctly otherwise
9895
git config --global --add safe.directory $(realpath .)
9996
CONDA="/root/miniforge3/bin/conda"
100-
# Native Khiops-based Conda environment, and
101-
# `khiops-core`-based Conda environment
102-
CONDA_ENVS="py${{ matrix.python-version }} py${{ matrix.python-version }}_conda"
103-
for CONDA_ENV in $CONDA_ENVS
104-
do
105-
# Since Python 3.13, setuptools is not installed automatically anymore
106-
$CONDA install -y -n "$CONDA_ENV" setuptools
97+
# Native Khiops-based Conda environment (to test in a specific python version)
98+
CONDA_ENV=py${{ matrix.python-version }}
99+
# Since Python 3.13, setuptools is not installed automatically anymore
100+
$CONDA install -y -n "$CONDA_ENV" setuptools
107101
108-
# Add homogeneous TOML support (Python >= 3.12 has standard tomllib)
109-
$CONDA install -y -n "$CONDA_ENV" tomli
110-
$CONDA run --no-capture-output -n "$CONDA_ENV" python scripts/extract_dependencies_from_pyproject_toml.py -f "pyproject.toml" > requires.txt
111-
$CONDA install -y -n "$CONDA_ENV" `cat requires.txt`
112-
rm -f requires.txt
113-
done
102+
# Add homogeneous TOML support (Python >= 3.12 has standard tomllib)
103+
$CONDA install -y -n "$CONDA_ENV" tomli
104+
$CONDA run --no-capture-output -n "$CONDA_ENV" python scripts/extract_dependencies_from_pyproject_toml.py -f "pyproject.toml" > requires.txt
105+
$CONDA install -y -n "$CONDA_ENV" `cat requires.txt`
106+
rm -f requires.txt
114107
- name: Configure Expensive Tests Setting
115108
# Skip expensive tests by default, unless on the `main-v10` or `main` branches
116109
if: github.ref != 'main-v10' && github.ref != 'main' && ! inputs.run-expensive-tests
@@ -197,23 +190,18 @@ jobs:
197190
# version is retrieved
198191
git config --global --add safe.directory $(realpath .)
199192
CONDA="/root/miniforge3/bin/conda"
200-
# Native Khiops-based Conda environment, and
201-
# `khiops-core`-based Conda environment
202-
CONDA_ENVS="py${{ matrix.python-version }} py${{ matrix.python-version }}_conda"
203-
for CONDA_ENV in $CONDA_ENVS
204-
do
205-
$CONDA run --no-capture-output -n "$CONDA_ENV" coverage run -m xmlrunner -o "reports/$CONDA_ENV" -v
206-
$CONDA run --no-capture-output -n "$CONDA_ENV" coverage report -m
207-
$CONDA run --no-capture-output -n "$CONDA_ENV" coverage xml -o "reports/$CONDA_ENV/py-coverage.xml"
208-
done
193+
# Native Khiops-based Conda environment (to test in a specific python version)
194+
CONDA_ENV=py${{ matrix.python-version }}
195+
$CONDA run --no-capture-output -n "$CONDA_ENV" coverage run -m xmlrunner -o "reports/$CONDA_ENV" -v
196+
$CONDA run --no-capture-output -n "$CONDA_ENV" coverage report -m
197+
$CONDA run --no-capture-output -n "$CONDA_ENV" coverage xml -o "reports/$CONDA_ENV/py-coverage.xml"
209198
- name: Display Test Reports
210199
if: success() || failure()
211200
uses: dorny/test-reporter@v1
212201
with:
213202
name: Run Tests ${{ matrix.python-version }}
214203
path: >-
215-
reports/py${{ matrix.python-version }}/TEST-tests.*.*.xml,
216-
reports/py${{ matrix.python-version }}_conda/TEST-tests.*.*.xml
204+
reports/py${{ matrix.python-version }}/TEST-tests.*.*.xml
217205
reporter: java-junit
218206
path-replace-backslashes: 'true' # Necessary for windows paths
219207
fail-on-error: 'false'
@@ -225,8 +213,6 @@ jobs:
225213
path: |-
226214
reports/py${{ matrix.python-version }}/TEST-tests.*.*.xml
227215
reports/py${{ matrix.python-version }}/py-coverage.xml
228-
reports/py${{ matrix.python-version }}_conda/TEST-tests.*.*.xml
229-
reports/py${{ matrix.python-version }}_conda/py-coverage.xml
230216
tests/resources/scenario_generation/*/ref/*._kh
231217
tests/resources/scenario_generation/*/output/*._kh
232218
tests/resources/*/output_reports/*.txt

packaging/docker/khiopspydev/Dockerfile.debian

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -44,41 +44,25 @@ RUN true \
4444
&& rm -rf ./khiops \
4545
&& true
4646

47-
# set up all the supported Python environments under conda (for the unit tests)
47+
# set up all the supported Python environments under Conda (for the unit tests)
4848
# relying on a variable containing all the versions
4949
ARG PYTHON_VERSIONS
5050
ARG KHIOPS_GCS_DRIVER_REVISION
5151
ARG KHIOPS_S3_DRIVER_REVISION
5252
ARG KHIOPS_AZURE_DRIVER_REVISION
5353

54-
# Install Conda packages
55-
# Use `rc` label for alpha or RC khiops-core pre-releases
54+
# Initialize all the Conda environments
5655
RUN true \
5756
&& export CONDA="/root/miniforge3/bin/conda" \
58-
&& /bin/bash -c 'if [[ $(echo ${KHIOPS_REVISION} | grep -E ".*-(a|rc)\.[0-9]+") ]]; then \
59-
export RC_LABEL="conda-forge/label/rc::"; \
60-
else \
61-
export RC_LABEL=""; \
62-
fi; \
57+
&& /bin/bash -c ' \
6358
# Update conda to the latest version \
6459
$CONDA update -n base conda; \
6560
for version in ${PYTHON_VERSIONS}; \
6661
do \
67-
CONDA_ENVS="py${version} py${version}_conda"; \
68-
for CONDA_ENV in $CONDA_ENVS; \
69-
do \
70-
$CONDA create -y -n $CONDA_ENV python=${version}; \
71-
done; \
72-
# khiops core \
73-
$CONDA install -y -n py${version}_conda "${RC_LABEL}"khiops-core==$(echo ${KHIOPS_REVISION} | tr -d "-") ; \
74-
# remote files drivers installed in the conda environment \
75-
$CONDA install -y -n py${version}_conda \
76-
khiops-driver-s3==${KHIOPS_S3_DRIVER_REVISION} \
77-
khiops-driver-gcs==${KHIOPS_GCS_DRIVER_REVISION} \
78-
# XXX hardcoded version because the latest version is not released on conda-forge \
79-
khiops-driver-azure==0.0.5; \
62+
$CONDA create -y -n $CONDA_ENV python=py${version}; \
8063
done; \
8164
# Install Khiops from a different major version in a dedicated conda environment \
65+
# for a specific test regarding compatibility test \
8266
# The python interpreter version of the base environment is used as no specific version is given \
8367
$CONDA create -y -n py3_khiops10_conda; \
8468
$CONDA install -y -n py3_khiops10_conda khiops::khiops-core==10.3.1; \

packaging/docker/khiopspydev/Dockerfile.rocky

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,29 +61,22 @@ RUN true \
6161
&& rm -rf ./khiops \
6262
&& true
6363

64-
# set up all the supported Python environments under conda (for the unit tests)
64+
# set up all the supported Python environments under Conda (for the unit tests)
6565
# relying on a variable containing all the versions
6666
ARG PYTHON_VERSIONS
6767

68-
# Install Conda packages
69-
# Use `rc` label for alpha or RC khiops-core pre-releases
68+
# Initialize all the Conda environments
7069
RUN true \
7170
&& export CONDA="/root/miniforge3/bin/conda" \
72-
&& if [[ $(echo ${KHIOPS_REVISION} | grep -E ".*-(a|rc)\.[0-9]+") ]]; then \
73-
export RC_LABEL="conda-forge/label/rc::"; \
74-
else \
75-
export RC_LABEL=""; \
76-
fi \
77-
&& /bin/bash -c 'for version in ${PYTHON_VERSIONS}; \
71+
&& /bin/bash -c ' \
72+
# Update conda to the latest version \
73+
$CONDA update -n base conda; \
74+
for version in ${PYTHON_VERSIONS}; \
7875
do \
79-
CONDA_ENVS="py${version} py${version}_conda"; \
80-
for CONDA_ENV in $CONDA_ENVS; \
81-
do \
82-
$CONDA create -y -n $CONDA_ENV python=${version}; \
83-
done; \
84-
$CONDA install -y -n py${version}_conda ${RC_LABEL}khiops-core==$(echo ${KHIOPS_REVISION} | tr -d "-") ; \
76+
$CONDA create -y -n $CONDA_ENV python=py${version}; \
8577
done; \
8678
# Install Khiops from a different major version in a dedicated conda environment \
79+
# for a specific test regarding compatibility test \
8780
# The python interpreter version of the base environment is used as no specific version is given \
8881
$CONDA create -y -n py3_khiops10_conda; \
8982
$CONDA install -y -n py3_khiops10_conda khiops::khiops-core==10.3.1; \

packaging/docker/khiopspydev/Dockerfile.ubuntu

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -42,41 +42,25 @@ RUN true \
4242
&& rm -rf ./khiops \
4343
&& true
4444

45-
# set up all the supported Python environments under conda (for the unit tests)
45+
# set up all the supported Python environments under Conda (for the unit tests)
4646
# relying on a variable containing all the versions
4747
ARG PYTHON_VERSIONS
4848
ARG KHIOPS_GCS_DRIVER_REVISION
4949
ARG KHIOPS_S3_DRIVER_REVISION
5050
ARG KHIOPS_AZURE_DRIVER_REVISION
5151

52-
# Install Conda packages
53-
# Use `rc` label for alpha or RC khiops-core pre-releases
52+
# Initialize all the Conda environments
5453
RUN true \
5554
&& export CONDA="/root/miniforge3/bin/conda" \
56-
&& /bin/bash -c 'if [[ $(echo ${KHIOPS_REVISION} | grep -E ".*-(a|rc)\.[0-9]+") ]]; then \
57-
export RC_LABEL="conda-forge/label/rc::"; \
58-
else \
59-
export RC_LABEL=""; \
60-
fi; \
55+
&& /bin/bash -c ' \
6156
# Update conda to the latest version \
6257
$CONDA update -n base conda; \
6358
for version in ${PYTHON_VERSIONS}; \
6459
do \
65-
CONDA_ENVS="py${version} py${version}_conda"; \
66-
for CONDA_ENV in $CONDA_ENVS; \
67-
do \
68-
$CONDA create -y -n $CONDA_ENV python=${version}; \
69-
done; \
70-
# khiops core \
71-
$CONDA install -y -n py${version}_conda "${RC_LABEL}"khiops-core==$(echo ${KHIOPS_REVISION} | tr -d "-") ; \
72-
# remote files drivers installed in the conda environment \
73-
$CONDA install -y -n py${version}_conda \
74-
khiops-driver-s3==${KHIOPS_S3_DRIVER_REVISION} \
75-
khiops-driver-gcs==${KHIOPS_GCS_DRIVER_REVISION} \
76-
# XXX hardcoded version because the latest version is not released on conda-forge \
77-
khiops-driver-azure==0.0.5; \
60+
$CONDA create -y -n $CONDA_ENV python=py${version}; \
7861
done; \
7962
# Install Khiops from a different major version in a dedicated conda environment \
63+
# for a specific test regarding compatibility test \
8064
# The python interpreter version of the base environment is used as no specific version is given \
8165
$CONDA create -y -n py3_khiops10_conda; \
8266
$CONDA install -y -n py3_khiops10_conda khiops::khiops-core==10.3.1; \

0 commit comments

Comments
 (0)