Skip to content

Commit 6f1dc94

Browse files
committed
Update RC labels of Conda packages according to version number
If alpha or RC, then deduce the label RC. Otherwise, use the default (main) label. Note: in meta.yaml the RC label is hard-coded for the current alpha release, as there is no documented way of parameterizing the label without dynamically modifying the file.
1 parent a95d259 commit 6f1dc94

File tree

4 files changed

+26
-4
lines changed

4 files changed

+26
-4
lines changed

.github/workflows/conda.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,13 @@ jobs:
103103
echo "KHIOPS_CORE_VERSION=$KHIOPS_CORE_VERSION" >> "$GITHUB_ENV"
104104
- name: Install the Khiops Conda package
105105
run: |
106-
conda install khiops-core=$KHIOPS_CORE_VERSION
106+
# Add the Conda `rc` label for alpha or RC pre-releases
107+
if [[ $(echo ${KHIOPS_CORE_VERSION} | grep -E ".*(a|rc)\.[0-9]+") ]]; then
108+
RC_LABEL="conda-forge/label/rc::"
109+
else
110+
RC_LABEL=""
111+
fi
112+
conda install ${RC_LABEL}khiops-core=$KHIOPS_CORE_VERSION
107113
conda install --channel ./khiops-conda/ khiops
108114
- name: Test Khiops Installation Status
109115
run: kh-status

packaging/conda/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ requirements:
2626
- python
2727
run:
2828
- python
29-
- khiops-core =11.0.0a.0
29+
- conda-forge/label/rc::khiops-core =11.0.0a.0
3030
- pandas >=0.25.3
3131
- scikit-learn >=0.22.2
3232
run_constrained:

packaging/docker/khiopspydev/Dockerfile.rocky

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,24 @@ RUN true \
6969
# set up all the supported Python environments under conda (for the unit tests)
7070
# relying on a variable containing all the versions
7171
ARG PYTHON_VERSIONS
72+
73+
# Install Conda packages
74+
# Use `rc` label for alpha or RC khiops-core pre-releases
7275
RUN true \
7376
&& export CONDA="/root/miniforge3/bin/conda" \
77+
&& if [[ $(echo ${KHIOPS_REVISION} | grep -E ".*-(a|rc)\.[0-9]+") ]]; then \
78+
export RC_LABEL="conda-forge/label/rc::"; \
79+
else \
80+
export RC_LABEL=""; \
81+
fi \
7482
&& /bin/bash -c 'for version in ${PYTHON_VERSIONS}; \
7583
do \
7684
CONDA_ENVS="py${version} py${version}_conda"; \
7785
for CONDA_ENV in $CONDA_ENVS; \
7886
do \
7987
$CONDA create -y -n $CONDA_ENV python=${version}; \
8088
done; \
81-
$CONDA install -y -n py${version}_conda khiops-core=$(echo ${KHIOPS_REVISION} | tr -d "-") ; \
89+
$CONDA install -y -n py${version}_conda ${RC_LABEL}khiops-core=$(echo ${KHIOPS_REVISION} | tr -d "-") ; \
8290
done' \
8391
&& true
8492

packaging/docker/khiopspydev/Dockerfile.ubuntu

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,16 @@ RUN true \
4242
ARG PYTHON_VERSIONS
4343
ARG KHIOPS_GCS_DRIVER_REVISION
4444
ARG KHIOPS_S3_DRIVER_REVISION
45+
46+
# Install Conda packages
47+
# Use `rc` label for alpha or RC khiops-core pre-releases
4548
RUN true \
4649
&& export CONDA="/root/miniforge3/bin/conda" \
50+
&& if [[ $(echo ${KHIOPS_REVISION} | grep -E ".*-(a|rc)\.[0-9]+") ]]; then \
51+
export RC_LABEL="conda-forge/label/rc::"; \
52+
else \
53+
export RC_LABEL=""; \
54+
fi \
4755
&& /bin/bash -c 'for version in ${PYTHON_VERSIONS}; \
4856
do \
4957
CONDA_ENVS="py${version} py${version}_conda"; \
@@ -52,7 +60,7 @@ RUN true \
5260
$CONDA create -y -n $CONDA_ENV python=${version}; \
5361
done; \
5462
# khiops core \
55-
$CONDA install -y -n py${version}_conda khiops-core=$(echo ${KHIOPS_REVISION} | tr -d "-") ; \
63+
$CONDA install -y -n py${version}_conda ${RC_LABEL}khiops-core=$(echo ${KHIOPS_REVISION} | tr -d "-") ; \
5664
# remote files drivers installed in the conda environment \
5765
$CONDA install -y -n py${version}_conda -c khiops \
5866
khiops-driver-s3=${KHIOPS_S3_DRIVER_REVISION} \

0 commit comments

Comments
 (0)