Skip to content

Commit b3dbe9d

Browse files
authored
Merge pull request #50 from PyNumLab/adoption
add MIT licence. add LLVM and Intel compilers smoke tests add macos tests
2 parents 640eb73 + 6032c40 commit b3dbe9d

6,164 files changed

Lines changed: 44133 additions & 2152094 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
- [ ] `PYTHONPATH=. pytest -q`
66

77
## Merge checklist
8-
- [ ] All required checks are **green** (tests + parser-reference-guard).
8+
- [ ] All required checks are **green** (static analysis, tests, compiler smoke, BLAS/LAPACK, and parser reference).
99
- [ ] If parser Fortran data or goldens changed, the PR explains why.
1010
- [ ] If using `ignore-parser-reference-guard`, the PR explains why it is safe.

.github/workflows/blas-lapack.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: BLAS + LAPACK
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, labeled, unlabeled]
6+
push:
7+
branches:
8+
- main
9+
- release/*
10+
workflow_call:
11+
12+
env:
13+
X2PY_GFORTRAN_BINARY: gfortran-13
14+
X2PY_GFORTRAN_PACKAGE: gfortran-13
15+
16+
jobs:
17+
real-library-wrappers:
18+
name: Python 3.12
19+
if: >-
20+
${{
21+
github.event_name != 'pull_request' ||
22+
!contains(github.event.pull_request.labels.*.name, 'ignore-real-library-wrappers')
23+
}}
24+
runs-on: ubuntu-24.04
25+
timeout-minutes: 120
26+
permissions:
27+
contents: read
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 2
33+
- name: Set up Python
34+
uses: actions/setup-python@v5
35+
with:
36+
python-version: "3.12"
37+
- name: Install test dependencies
38+
run: |
39+
python -m pip install --upgrade pip
40+
python -m pip install -e ".[qa]"
41+
- name: Install pinned GFortran
42+
shell: bash
43+
run: |
44+
if ! command -v "$X2PY_GFORTRAN_BINARY" >/dev/null 2>&1; then
45+
sudo apt-get update
46+
sudo apt-get install --yes "$X2PY_GFORTRAN_PACKAGE"
47+
fi
48+
compiler_dir="$RUNNER_TEMP/x2py-gfortran"
49+
mkdir -p "$compiler_dir"
50+
ln -sf "$(command -v "$X2PY_GFORTRAN_BINARY")" "$compiler_dir/gfortran"
51+
echo "$compiler_dir" >> "$GITHUB_PATH"
52+
"$compiler_dir/gfortran" --version
53+
- name: Restore compiled native library cache
54+
uses: actions/cache@v4
55+
with:
56+
path: ${{ runner.temp }}/x2py-real-library-native
57+
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/**') }}
58+
- name: Run full BLAS and LAPACK wrapper tests
59+
env:
60+
PYTHONPATH: .
61+
HYPOTHESIS_PROFILE: ci
62+
X2PY_REAL_LIBRARY_NATIVE_CACHE_DIR: ${{ runner.temp }}/x2py-real-library-native
63+
run: |
64+
python -m pytest -q --randomly-seed=1 \
65+
"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]" \
66+
"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]"

.github/workflows/claude.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212

1313
jobs:
1414
claude:
15+
name: Respond
1516
if: |
1617
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
1718
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||

.github/workflows/coverage.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Coverage
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [opened, synchronize, reopened, labeled, unlabeled]
9+
workflow_dispatch:
10+
workflow_call:
11+
12+
env:
13+
X2PY_GFORTRAN_BINARY: gfortran-13
14+
X2PY_GFORTRAN_PACKAGE: gfortran-13
15+
16+
jobs:
17+
coverage:
18+
name: Python 3.12
19+
if: >-
20+
${{
21+
github.event_name != 'pull_request' ||
22+
contains(github.event.pull_request.labels.*.name, 'run-coverage')
23+
}}
24+
runs-on: ubuntu-24.04
25+
permissions:
26+
contents: read
27+
id-token: write
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 2
33+
- name: Set up Python
34+
uses: actions/setup-python@v5
35+
with:
36+
python-version: "3.12"
37+
- name: Install coverage dependencies
38+
run: |
39+
python -m pip install --upgrade pip
40+
python -m pip install -e ".[qa]"
41+
- name: Install pinned GFortran
42+
shell: bash
43+
run: |
44+
if ! command -v "$X2PY_GFORTRAN_BINARY" >/dev/null 2>&1; then
45+
sudo apt-get update
46+
sudo apt-get install --yes "$X2PY_GFORTRAN_PACKAGE"
47+
fi
48+
compiler_dir="$RUNNER_TEMP/x2py-gfortran"
49+
mkdir -p "$compiler_dir"
50+
ln -sf "$(command -v "$X2PY_GFORTRAN_BINARY")" "$compiler_dir/gfortran"
51+
echo "$compiler_dir" >> "$GITHUB_PATH"
52+
"$compiler_dir/gfortran" --version
53+
- name: Run tests with coverage
54+
shell: bash
55+
env:
56+
PYTHONPATH: .
57+
HYPOTHESIS_PROFILE: ci
58+
COVERAGE_PROCESS_START: ${{ github.workspace }}/pyproject.toml
59+
run: |
60+
python -m coverage run -m pytest -q --randomly-seed=1 \
61+
-o junit_family=legacy \
62+
--junitxml="$RUNNER_TEMP/pytest-smoke-results.xml" \
63+
tests/fortran \
64+
-m toolchain_smoke \
65+
--require-toolchain-smoke \
66+
--x2py-fortran-compiler=gfortran
67+
python -m coverage run -m pytest -q --randomly-seed=1 \
68+
-o junit_family=legacy \
69+
--junitxml="$RUNNER_TEMP/pytest-suite-results.xml" \
70+
-m "not real_library and not toolchain_smoke" \
71+
tests/architecture \
72+
tests/c \
73+
tests/fortran \
74+
tests/shared
75+
- name: Summarize failed pytest nodes
76+
if: failure()
77+
shell: bash
78+
run: |
79+
shopt -s nullglob
80+
reports=("$RUNNER_TEMP"/pytest-*-results.xml)
81+
for report in "${reports[@]}"; do
82+
python tools/print_pytest_failures.py "$report"
83+
done
84+
- name: Combine coverage data
85+
run: python -m coverage combine
86+
- name: Report coverage
87+
run: python -m coverage report
88+
- name: Emit coverage XML
89+
run: python -m coverage xml -o coverage.xml
90+
- name: Upload coverage to Codecov
91+
uses: codecov/codecov-action@v6
92+
with:
93+
files: ./coverage.xml
94+
flags: py312
95+
use_oidc: true
96+
fail_ci_if_error: true

.github/workflows/docs.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
- "docs_theme/**"
1111
- "mkdocs.yml"
1212
- "pyproject.toml"
13-
- "tests/docs/**"
13+
- "tests/shared/docs/**"
1414
- "tools/mkdocs_publication.py"
1515
pull_request:
1616
paths:
@@ -20,7 +20,7 @@ on:
2020
- "docs_theme/**"
2121
- "mkdocs.yml"
2222
- "pyproject.toml"
23-
- "tests/docs/**"
23+
- "tests/shared/docs/**"
2424
- "tools/mkdocs_publication.py"
2525
workflow_dispatch:
2626

@@ -33,6 +33,7 @@ concurrency:
3333

3434
jobs:
3535
build:
36+
name: Build
3637
runs-on: ubuntu-latest
3738
permissions:
3839
contents: read
@@ -52,7 +53,7 @@ jobs:
5253
run: python -m pip install -e ".[docs,qa]"
5354

5455
- name: Run documentation tests
55-
run: python -m pytest -q tests/docs
56+
run: python -m pytest -q tests/shared/docs
5657

5758
- name: Build reviewed documentation
5859
run: python -m mkdocs build --strict
@@ -68,6 +69,7 @@ jobs:
6869
path: site
6970

7071
deploy:
72+
name: Deploy
7173
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
7274
environment:
7375
name: github-pages

0 commit comments

Comments
 (0)