11#! /bin/bash
22
3- INSTALL_DIR=" $HOME /bin"
4- mkdir -p " $INSTALL_DIR "
5-
6- if which python & > /dev/null; then
7- PY_PLATFORM=$( python -c " import sysconfig; print(sysconfig.get_platform(), end='')" )
8- elif [ -z " $MINGW_PACKAGE_PREFIX " ]; then
9- PY_PLATFORM=" mingw"
10- else
11- PY_PLATFORM=" "
12- fi
13-
14- IS_CONDA=$( [ -n " $CONDA_EXE " ] && echo " 1" )
15- IS_MINGW=$( [[ $PY_PLATFORM == mingw* ]] && echo " 1" )
16- IS_WINDOWS=$( [[ $PY_PLATFORM == win* ]] && echo " 1" )
17-
183# Usage
194if [ -n " $1 " ] && [ " $1 " == " --help" ]; then
205 echo " Usage:"
@@ -25,6 +10,26 @@ if [ -n "$1" ] && [ "$1" == "--help" ]; then
2510 exit 1
2611fi
2712
13+ # Detect environment
14+ IS_CONDA=" 0"
15+ IS_MINGW=" 0"
16+ IS_WINDOWS=" 0"
17+ if [ -n " $CONDA_EXE " ]; then
18+ IS_CONDA=" 1"
19+ elif [ -n " $MINGW_PACKAGE_PREFIX " ]; then
20+ IS_MINGW=" 1"
21+ elif which python & > /dev/null; then
22+ PY_PLATFORM=$( python -c " import sysconfig; print(sysconfig.get_platform(), end='')" )
23+ IS_WINDOWS=$( [[ $PY_PLATFORM == win* ]] && echo " 1" )
24+ else
25+ echo " error: Python is required."
26+ exit 1
27+ fi
28+
29+ # Install/update dev tools (including uv if required)
30+ INSTALL_DIR=" $HOME /bin"
31+ mkdir -p " $INSTALL_DIR "
32+
2833INSTALL_DEV=" "
2934INSTALL_TESTS=" "
3035while [ -n " $1 " ]; do
@@ -39,28 +44,28 @@ while [ -n "$1" ]; do
3944done
4045
4146echo " ::group::Install dependencies and build tools"
42- # Install/update uv and dev tools
4347if [ " $IS_CONDA " == " 1" ]; then
44- # Conda Python 3.14: python-msilib is not available yet
45- PY_VERSION=$( python -c " import sysconfig; print(sysconfig.get_python_version(), end='')" )
46- SYS_PLATFORM=$( python -c " import sys; print(sys.platform, end='')" )
47- # Packages to install
48- pkgs=(" uv" " python-build" )
48+ # Install libmamba-solver and use it to speed up packages installation
49+ echo " Update conda to use libmamba-solver"
50+ $CONDA_EXE clean --index-cache --logfiles --quiet --yes
51+ $CONDA_EXE update -n base conda --quiet --yes
52+ $CONDA_EXE install -n base conda-libmamba-solver --quiet --yes
53+ $CONDA_EXE config --set solver libmamba
4954 if ! which python & > /dev/null; then
50- pkgs+=( " python=3.13 " )
55+ $CONDA_EXE install -c conda-forge python -S -q -y
5156 fi
57+ # Packages to install
58+ pkgs=(" python-build" )
5259
5360 # Dependencies of the project
5461 if [ -f requirements.txt ]; then
62+ SYS_PLATFORM=$( python -c " import sys; print(sys.platform, end='')" )
5563 while read -r line; do
5664 if [[ $line != * sys_platform* ]] || \
5765 [[ $line == * sys_platform* == * ${SYS_PLATFORM} * ]]; then
5866 name=$( echo " $line " | awk -F ' [><=]+' ' { print $1 }' )
5967 if [ " $name " == " cx-logging" ]; then name=" cx_logging" ; fi
6068 if [ " $name " == " lief" ]; then name=" py-lief" ; fi
61- if [ " $name " == " python-msilib" ] && [ " $PY_VERSION " == " 3.14" ]; then
62- continue
63- fi
6469 if ! printf ' %s\0' " ${pkgs[@]} " | grep -Fxqz -- " $name " ; then
6570 pkgs+=(" $name " )
6671 fi
@@ -76,18 +81,12 @@ if [ "$IS_CONDA" == "1" ]; then
7681 done < tests/requirements.txt
7782 fi
7883
79- # Install libmamba-solver and use it to speed up packages installation
80- echo " Update conda to use libmamba-solver"
81- $CONDA_EXE clean --index-cache --logfiles --quiet --yes
82- $CONDA_EXE update -n base conda --quiet --yes
83- $CONDA_EXE install -n base conda-libmamba-solver --quiet --yes
84- $CONDA_EXE config --set solver libmamba
8584 echo " Install packages"
8685 echo " ${pkgs[@]} "
8786 $CONDA_EXE install -c conda-forge " ${pkgs[@]} " -S -q -y
8887elif [ " $IS_MINGW " == " 1" ]; then
8988 # Packages to install
90- pkgs=(" $MINGW_PACKAGE_PREFIX -uv " " $MINGW_PACKAGE_PREFIX - python-build" )
89+ pkgs=(" $MINGW_PACKAGE_PREFIX -python-build" )
9190 if ! which python & > /dev/null; then
9291 pkgs+=(" $MINGW_PACKAGE_PREFIX -python" )
9392 fi
0 commit comments