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 9faa8b5 commit 45c8d30
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 100 deletions.
51 changes: 1 addition & 50 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=30
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 @@ -413,25 +383,7 @@ jobs:
# 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
timeout 30 conda install -q -y $PKG || echo "WARNING: $PKG not available or did not install correctly"
done
fi
# Re-try Pyomo (optional) dependencies with pip
Expand Down Expand Up @@ -460,7 +412,6 @@ jobs:
echo "Final conda environment:"
conda list | sed 's/^/ /'
- name: Setup TPL package directories
run: |
TPL_DIR="${GITHUB_WORKSPACE}/cache/tpl"
Expand Down
51 changes: 1 addition & 50 deletions .github/workflows/test_pr_and_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -338,36 +338,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=30
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 @@ -450,25 +420,7 @@ jobs:
# 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
timeout 30 conda install -q -y $PKG || echo "WARNING: $PKG not available or did not install correctly"
done
fi
# Re-try Pyomo (optional) dependencies with pip
Expand Down Expand Up @@ -497,7 +449,6 @@ jobs:
echo "Final conda environment:"
conda list | sed 's/^/ /'
- name: Setup TPL package directories
run: |
TPL_DIR="${GITHUB_WORKSPACE}/cache/tpl"
Expand Down

0 comments on commit 45c8d30

Please sign in to comment.