diff --git a/.github/workflows/test_redhat.yml b/.github/workflows/test_redhat.yml index e861e52..d67cc5c 100644 --- a/.github/workflows/test_redhat.yml +++ b/.github/workflows/test_redhat.yml @@ -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/install-dolfinx@v0.3 @@ -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: |