Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
- [ ] `PYTHONPATH=. pytest -q`

## Merge checklist
- [ ] All required checks are **green** (tests + parser-reference-guard).
- [ ] All required checks are **green** (static analysis, tests, compiler smoke, BLAS/LAPACK, and parser reference).
- [ ] If parser Fortran data or goldens changed, the PR explains why.
- [ ] If using `ignore-parser-reference-guard`, the PR explains why it is safe.
66 changes: 66 additions & 0 deletions .github/workflows/blas-lapack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: BLAS + LAPACK

on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
push:
branches:
- main
- release/*
workflow_call:

env:
X2PY_GFORTRAN_BINARY: gfortran-13
X2PY_GFORTRAN_PACKAGE: gfortran-13

jobs:
real-library-wrappers:
name: Python 3.12
if: >-
${{
github.event_name != 'pull_request' ||
!contains(github.event.pull_request.labels.*.name, 'ignore-real-library-wrappers')
}}
runs-on: ubuntu-24.04
timeout-minutes: 120
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[qa]"
- name: Install pinned GFortran
shell: bash
run: |
if ! command -v "$X2PY_GFORTRAN_BINARY" >/dev/null 2>&1; then
sudo apt-get update
sudo apt-get install --yes "$X2PY_GFORTRAN_PACKAGE"
fi
compiler_dir="$RUNNER_TEMP/x2py-gfortran"
mkdir -p "$compiler_dir"
ln -sf "$(command -v "$X2PY_GFORTRAN_BINARY")" "$compiler_dir/gfortran"
echo "$compiler_dir" >> "$GITHUB_PATH"
"$compiler_dir/gfortran" --version
- name: Restore compiled native library cache
uses: actions/cache@v4
with:
path: ${{ runner.temp }}/x2py-real-library-native
key: real-libraries-${{ runner.os }}-gfortran13-${{ hashFiles('tests/fortran/building_shared_library/end_to_end/real_libraries/blas/native/**', 'tests/fortran/building_shared_library/end_to_end/real_libraries/lapack/native/**') }}
- name: Run full BLAS and LAPACK wrapper tests
env:
PYTHONPATH: .
HYPOTHESIS_PROFILE: ci
X2PY_REAL_LIBRARY_NATIVE_CACHE_DIR: ${{ runner.temp }}/x2py-real-library-native
run: |
python -m pytest -q --randomly-seed=1 \
"tests/fortran/building_shared_library/end_to_end/real_libraries/test_full_libraries.py::test_full_library_wrapper_imports_every_root_procedure_from_cached_shared_library[blas]" \
"tests/fortran/building_shared_library/end_to_end/real_libraries/test_full_libraries.py::test_full_library_wrapper_imports_every_root_procedure_from_cached_shared_library[lapack]"
1 change: 1 addition & 0 deletions .github/workflows/claude.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:

jobs:
claude:
name: Respond
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
Expand Down
96 changes: 96 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Coverage

on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
workflow_dispatch:
workflow_call:

env:
X2PY_GFORTRAN_BINARY: gfortran-13
X2PY_GFORTRAN_PACKAGE: gfortran-13

jobs:
coverage:
name: Python 3.12
if: >-
${{
github.event_name != 'pull_request' ||
contains(github.event.pull_request.labels.*.name, 'run-coverage')
}}
runs-on: ubuntu-24.04
permissions:
contents: read
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install coverage dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[qa]"
- name: Install pinned GFortran
shell: bash
run: |
if ! command -v "$X2PY_GFORTRAN_BINARY" >/dev/null 2>&1; then
sudo apt-get update
sudo apt-get install --yes "$X2PY_GFORTRAN_PACKAGE"
fi
compiler_dir="$RUNNER_TEMP/x2py-gfortran"
mkdir -p "$compiler_dir"
ln -sf "$(command -v "$X2PY_GFORTRAN_BINARY")" "$compiler_dir/gfortran"
echo "$compiler_dir" >> "$GITHUB_PATH"
"$compiler_dir/gfortran" --version
- name: Run tests with coverage
shell: bash
env:
PYTHONPATH: .
HYPOTHESIS_PROFILE: ci
COVERAGE_PROCESS_START: ${{ github.workspace }}/pyproject.toml
run: |
python -m coverage run -m pytest -q --randomly-seed=1 \
-o junit_family=legacy \
--junitxml="$RUNNER_TEMP/pytest-smoke-results.xml" \
tests/fortran \
-m toolchain_smoke \
--require-toolchain-smoke \
--x2py-fortran-compiler=gfortran
python -m coverage run -m pytest -q --randomly-seed=1 \
-o junit_family=legacy \
--junitxml="$RUNNER_TEMP/pytest-suite-results.xml" \
-m "not real_library and not toolchain_smoke" \
tests/architecture \
tests/c \
tests/fortran \
tests/shared
- name: Summarize failed pytest nodes
if: failure()
shell: bash
run: |
shopt -s nullglob
reports=("$RUNNER_TEMP"/pytest-*-results.xml)
for report in "${reports[@]}"; do
python tools/print_pytest_failures.py "$report"
done
- name: Combine coverage data
run: python -m coverage combine
- name: Report coverage
run: python -m coverage report
- name: Emit coverage XML
run: python -m coverage xml -o coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v6
with:
files: ./coverage.xml
flags: py312
use_oidc: true
fail_ci_if_error: true
8 changes: 5 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- "docs_theme/**"
- "mkdocs.yml"
- "pyproject.toml"
- "tests/docs/**"
- "tests/shared/docs/**"
- "tools/mkdocs_publication.py"
pull_request:
paths:
Expand All @@ -20,7 +20,7 @@ on:
- "docs_theme/**"
- "mkdocs.yml"
- "pyproject.toml"
- "tests/docs/**"
- "tests/shared/docs/**"
- "tools/mkdocs_publication.py"
workflow_dispatch:

Expand All @@ -33,6 +33,7 @@ concurrency:

jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -52,7 +53,7 @@ jobs:
run: python -m pip install -e ".[docs,qa]"

- name: Run documentation tests
run: python -m pytest -q tests/docs
run: python -m pytest -q tests/shared/docs

- name: Build reviewed documentation
run: python -m mkdocs build --strict
Expand All @@ -68,6 +69,7 @@ jobs:
path: site

deploy:
name: Deploy
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
environment:
name: github-pages
Expand Down
Loading
Loading