3737 fetch-depth : 0
3838 - name : Build Pip package
3939 run : |
40- # This is needed so that the Git tag is parsed and the version is retrieved
40+ # This is needed so that the Git tag is parsed and the version is
41+ # retrieved
4142 git config --global --add safe.directory $(realpath .)
4243
4344 # Upgrade Pip
8788 apt-get install -y python3 python3-pip python3-venv
8889 elif command -v dnf; then
8990 dnf install -y python3 python3-pip
91+
9092 # Install findutils on Rocky Linux when xargs cannot be found
9193 if ! command -v xargs; then
9294 dnf install -y findutils
@@ -103,12 +105,14 @@ jobs:
103105 VENV_ACTIVATE_SCRIPT="khiops-venv/bin/activate"
104106 fi
105107 echo "VENV_ACTIVATE_SCRIPT=$VENV_ACTIVATE_SCRIPT" >> "$GITHUB_ENV"
108+
106109 # Setup Python (be portable wrt. python vs python3 in runners and
107110 # containers; either python3 or python is present as per the Python
108111 # installation step in the Docker container contexts)
109112 PYTHON=$(basename $(command -v python3 || command -v python))
110113 echo "PYTHON=$PYTHON" >> "$GITHUB_ENV"
111- - name : Checkout sources # Checkout the sources to be able to extract the dependencies list
114+ # Checkout the sources to be able to extract the dependencies list
115+ - name : Checkout sources
112116 uses : actions/checkout@v4
113117 with :
114118 # Get Git tags
@@ -134,30 +138,36 @@ jobs:
134138 chown -R $(whoami) /github/home/.cache/pip
135139 fi
136140
137- # Install the Khiops Python library
138-
139141 # Use a virtualenv if required
140142 if [[ "${{ matrix.env.use-virtualenv }}" == "true" ]]; then
141143 $PYTHON -m venv khiops-venv
142144 source "$VENV_ACTIVATE_SCRIPT"
143145 fi
144146 $PYTHON -m pip install --upgrade pip
147+
145148 # Add homogeneous TOML support (Python >= 3.12 has standard tomllib)
146149 $PYTHON -c "import tomllib" 2>/dev/null || $PYTHON -m pip install tomli
147- # First, install all dependencies except khiops-core and khiops-drivers-*
150+
151+ # Install all dependencies except khiops-*
148152 $PYTHON scripts/extract_dependencies_from_pyproject_toml.py -f "pyproject.toml" --exclude-khiops-family > requires-no-khiops.txt
149153 [ ! -s requires-no-khiops.txt ] || xargs $PYTHON -m pip install < requires-no-khiops.txt
154+
150155 # On Windows, the `impi-rt` MPI dependency must be installed
151156 # separately, from PyPI, because it is not present on TestPyPI
152157 if [[ $RUNNER_OS == 'Windows' ]]; then
153158 $PYTHON -m pip install impi-rt
154159 fi
155- # khiops-core and khiops-drivers-* must always be installed from TestPyPI in order to avoid distorting usage statistics
160+
161+ # khiops-core and khiops-drivers-* must always be installed from
162+ # TestPyPI in order to avoid distorting usage statistics
156163 $PYTHON scripts/extract_dependencies_from_pyproject_toml.py -f "pyproject.toml" --khiops-family-only > requires-khiops.txt
157164 [ ! -s requires-khiops.txt ] || xargs $PYTHON -m pip install --index-url https://test.pypi.org/simple < requires-khiops.txt
158165 rm -f requires-khiops.txt requires-no-khiops.txt
159- # Lastly, install khiops-python
166+
167+ # Install the khiops package
160168 $PYTHON -m pip install khiops*.tar.gz
169+
170+ # Deactivate virtualenv if used
161171 if [[ "${{ matrix.env.use-virtualenv }}" == "true" ]]; then
162172 deactivate
163173 fi
@@ -217,6 +227,7 @@ jobs:
217227 run : |
218228 # Don't exit on first error: print relevant error message
219229 set +e
230+
220231 # Convert pre-release version specification in the Git tag to the Pip
221232 # format and check that it matches the Pip package version
222233 echo "${{ github.ref_name }}" | tr -d '-' | rev | sed -E 's/\.([^0-9].*)/\1/' | rev | \
0 commit comments