Skip to content

Commit 8b2c8c7

Browse files
committed
Ensure sympy is successfully installed on macOS CI
- Simplify installation approach: use --break-system-packages flag - Ensure pip is available and up to date before installing sympy - Remove error handling that made installation optional - This ensures sympy is actually installed for tests to use
1 parent 29e73e1 commit 8b2c8c7

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

.github/actions/install-dependencies/action.yml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,10 @@ runs:
2424
## gmp and python are already installed in the latest macOS
2525
# brew install gmp
2626
# brew install python
27-
## Try to install sympy, but don't fail if it doesn't work (it's optional)
28-
## sympy is optional - tests will work without it
29-
## Use --break-system-packages with --user as recommended by PEP 668
30-
set +e # Don't exit on error
31-
if command -v pip3 &> /dev/null; then
32-
pip3 install --user --break-system-packages sympy || echo "Warning: Failed to install sympy with pip3, continuing anyway"
33-
elif python3 -m pip --version &> /dev/null; then
34-
python3 -m pip install --user --break-system-packages sympy || echo "Warning: Failed to install sympy with python3 -m pip, continuing anyway"
35-
else
36-
python3 -m ensurepip --upgrade || python3 -m ensurepip || true
37-
python3 -m pip install --user --break-system-packages sympy || echo "Warning: Failed to install sympy, continuing anyway"
38-
fi
39-
set -e # Re-enable exit on error
27+
## Install sympy - use --break-system-packages for CI environment
28+
## First ensure pip is available and up to date
29+
python3 -m ensurepip --upgrade || python3 -m ensurepip || true
30+
python3 -m pip install --upgrade pip || true
31+
## Install sympy with --break-system-packages flag (required for PEP 668)
32+
python3 -m pip install --break-system-packages sympy
4033
echo "Install Mac dependencies [DONE]"

0 commit comments

Comments
 (0)