Skip to content

Commit

Permalink
Add flags for python version
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgensd committed May 13, 2024
1 parent cea9182 commit 4c77e1b
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/test_redhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,21 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Get pip flags based on version
id: python-version
shell: bash -el {0}
run: |
MODERN_PIP=$(python3 -c "import sys; t = sys.version_info >= (3, 11, 0); sys.stdout.write(str(t))")
if [ ${MODERN_PIP} == "True" ]; then
FLAGS="--break-system-packages --check-build-dependencies"
else
FLAGS=""
python3 -m pip install --upgrade pip
fi
echo "PYTHON_FLAGS=${FLAGS}" >> "$GITHUB_OUTPUT"
- name: Update pip
run: python3 -m pip install --break-system-packages --upgrade pip setuptools
run: python3 -m pip install ${{ steps.python-version.outputs.PYTHON_FLAGS}} --upgrade pip setuptools

- name: Install DOLFINx
uses: jorgensd/actions/[email protected]
Expand All @@ -72,7 +85,7 @@ jobs:
path: ./legacy_checkpoint

- name: Install package
run: python3 -m pip install --break-system-packages .[test]
run: python3 -m pip install ${{ steps.python-version.outputs.PYTHON_FLAGS}} .[test]

- name: Run tests
run: |
Expand Down

0 comments on commit 4c77e1b

Please sign in to comment.