Skip to content

Commit

Permalink
Let's reset here
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmundt committed Mar 4, 2025
1 parent 4efef42 commit a77b317
Showing 1 changed file with 1 addition and 56 deletions.
57 changes: 1 addition & 56 deletions .github/workflows/test_branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -301,36 +301,6 @@ jobs:
- name: Install Python packages (conda)
if: matrix.PYENV == 'conda'
run: |
# Function to install a package with a timeout
install_with_timeout() {
local pkg=$1
local timeout_duration=300 # Set a timeout duration (in seconds)
echo "... INSTALLING $pkg"
(conda install -q -y "$pkg") &
conda_pid=$!
# Set a trap to kill the conda process if the script exits
trap "kill $conda_pid 2>/dev/null" EXIT
(sleep "$timeout_duration" && kill -INT "$conda_pid" 2>/dev/null) &
timeout_pid=$!
wait "$conda_pid"
exit_status=$?
# Clean up the timeout process
kill "$timeout_pid" 2>/dev/null
# Check if the installation was successful
if [ $exit_status -ne 0 ]; then
echo "ERROR: Installation of $pkg failed (exit status: $exit_status)"
return 1
fi
echo "Successfully installed $pkg"
return 0
}
# Set up environment
conda config --set always_yes yes
conda config --set auto_update_conda false
Expand Down Expand Up @@ -407,32 +377,7 @@ jobs:
else
XPRESS='xpress'
fi
PYVER=$(echo "py${{matrix.python}}" | sed 's/\.//g')
echo "Installing for $PYVER"
PACKAGES='cplex>=12.10 docplex gurobi xpress cyipopt pymumps scip'
# Main installation loop
for PKG in $PACKAGES; do
echo ""
echo "*** Install $PKG ***"
_PKGLIST=$(conda search -f "$PKG") || echo "Package $PKG not found"
echo "$_PKGLIST"
_BASE=$(echo "$PKG" | sed 's/[=<>].*//')
_BUILDS=$(echo "$_PKGLIST" | grep "^$_BASE " | sed -r 's/\s+/ /g' | cut -d\ -f3) || echo ""
if test -n "$_BUILDS"; then
_ISPY=$(echo "$_BUILDS" | grep "^py") || echo "INFO: No python build detected."
_PYOK=$(echo "$_BUILDS" | grep -E "^($PYVER|pyh)") || echo "INFO: No python build matching $PYVER detected."
if test -z "$_ISPY" -o -n "$_PYOK"; then
install_with_timeout "$PKG" || {
echo "WARNING: $PKG installation failed. Continuing with the next package."
}
fi
else
echo "WARNING: $PKG is not available"
fi
done
conda install -q -y 'cplex>=12.10' docplex gurobi "$XPRESS" cyipopt pymumps scip
fi
# Re-try Pyomo (optional) dependencies with pip
echo ""
Expand Down

0 comments on commit a77b317

Please sign in to comment.