pyquadp 2.0.0__tar.gz → 2.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. {pyquadp-2.0.0 → pyquadp-2.0.2}/.github/copilot-instructions.md +3 -2
  2. {pyquadp-2.0.0 → pyquadp-2.0.2}/.github/workflows/bandit.yml +4 -1
  3. {pyquadp-2.0.0 → pyquadp-2.0.2}/.github/workflows/black.yml +7 -0
  4. {pyquadp-2.0.0 → pyquadp-2.0.2}/.github/workflows/codeql.yml +2 -2
  5. {pyquadp-2.0.0 → pyquadp-2.0.2}/.github/workflows/coveralls.yml +5 -0
  6. {pyquadp-2.0.0 → pyquadp-2.0.2}/.github/workflows/isort.yml +4 -0
  7. pyquadp-2.0.2/.github/workflows/linux-arm.yml +79 -0
  8. {pyquadp-2.0.0 → pyquadp-2.0.2}/.github/workflows/linux.yml +4 -0
  9. {pyquadp-2.0.0 → pyquadp-2.0.2}/.github/workflows/macos.yml +6 -2
  10. {pyquadp-2.0.0 → pyquadp-2.0.2}/.github/workflows/old-numpy.yml +6 -1
  11. pyquadp-2.0.2/.github/workflows/pypi.yml +145 -0
  12. {pyquadp-2.0.0 → pyquadp-2.0.2}/.github/workflows/pypy.yml +4 -0
  13. pyquadp-2.0.2/.github/workflows/windows.yml +165 -0
  14. {pyquadp-2.0.0 → pyquadp-2.0.2}/.github/workflows/zizmor.yml +6 -2
  15. pyquadp-2.0.2/.pre-commit-config.yaml +27 -0
  16. {pyquadp-2.0.0 → pyquadp-2.0.2}/PKG-INFO +2 -2
  17. {pyquadp-2.0.0 → pyquadp-2.0.2}/build_and_test.sh +1 -0
  18. pyquadp-2.0.2/lint.sh +7 -0
  19. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyproject.toml +2 -2
  20. pyquadp-2.0.2/pyquadp/__init__.pyi +22 -0
  21. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp/constant.py +1 -1
  22. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp/qarray.pyi +21 -6
  23. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp/qcarray.c +288 -74
  24. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp/qcarray.pyi +21 -6
  25. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp/qcmplx.c +35 -7
  26. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp/qfloat.c +116 -11
  27. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp/qfloatarray.c +288 -74
  28. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp/qiarray.c +288 -74
  29. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp/qiarray.pyi +21 -6
  30. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp/qint.c +41 -9
  31. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp.egg-info/PKG-INFO +2 -2
  32. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp.egg-info/SOURCES.txt +1 -1
  33. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp.egg-info/requires.txt +1 -1
  34. {pyquadp-2.0.0 → pyquadp-2.0.2}/tests/qarray_test.py +110 -0
  35. {pyquadp-2.0.0 → pyquadp-2.0.2}/tests/qcarray_test.py +137 -0
  36. {pyquadp-2.0.0 → pyquadp-2.0.2}/tests/qfloat_test.py +8 -0
  37. {pyquadp-2.0.0 → pyquadp-2.0.2}/tests/qiarray_test.py +122 -0
  38. {pyquadp-2.0.0 → pyquadp-2.0.2}/tests/qint_test.py +2 -5
  39. pyquadp-2.0.0/.github/workflows/linux-arm.yml +0 -45
  40. pyquadp-2.0.0/.github/workflows/pypi.yml +0 -92
  41. pyquadp-2.0.0/.pre-commit-config.yaml +0 -15
  42. pyquadp-2.0.0/lint.sh +0 -3
  43. pyquadp-2.0.0/pyquadp/__init__.pyi +0 -17
  44. pyquadp-2.0.0/pyquadp/test.c +0 -7
  45. {pyquadp-2.0.0 → pyquadp-2.0.2}/.gitattributes +0 -0
  46. {pyquadp-2.0.0 → pyquadp-2.0.2}/.github/dependabot.yml +0 -0
  47. {pyquadp-2.0.0 → pyquadp-2.0.2}/.github/workflows/mypy.yml +0 -0
  48. {pyquadp-2.0.0 → pyquadp-2.0.2}/.github/zizmor.yml +0 -0
  49. {pyquadp-2.0.0 → pyquadp-2.0.2}/.gitignore +0 -0
  50. {pyquadp-2.0.0 → pyquadp-2.0.2}/COPYING.txt +0 -0
  51. {pyquadp-2.0.0 → pyquadp-2.0.2}/MANIFEST.in +0 -0
  52. {pyquadp-2.0.0 → pyquadp-2.0.2}/README.md +0 -0
  53. {pyquadp-2.0.0 → pyquadp-2.0.2}/build.sh +0 -0
  54. {pyquadp-2.0.0 → pyquadp-2.0.2}/coverage.sh +0 -0
  55. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp/__init__.py +0 -0
  56. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp/constant.pyi +0 -0
  57. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp/py.typed +0 -0
  58. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp/pyquadp.h +0 -0
  59. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp/qcarray.h +0 -0
  60. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp/qcmath.py +0 -0
  61. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp/qcmath.pyi +0 -0
  62. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp/qcmathc.c +0 -0
  63. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp/qcmathc.h +0 -0
  64. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp/qcmplx.h +0 -0
  65. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp/qfloat.h +0 -0
  66. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp/qfloatarray.h +0 -0
  67. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp/qiarray.h +0 -0
  68. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp/qint.h +0 -0
  69. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp/qmath.py +0 -0
  70. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp/qmath.pyi +0 -0
  71. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp/qmathc.c +0 -0
  72. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp/qmathc.h +0 -0
  73. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp/qmcmplx.pyi +0 -0
  74. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp/qmfloat.pyi +0 -0
  75. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp/qmint.pyi +0 -0
  76. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp.egg-info/dependency_links.txt +0 -0
  77. {pyquadp-2.0.0 → pyquadp-2.0.2}/pyquadp.egg-info/top_level.txt +0 -0
  78. {pyquadp-2.0.0 → pyquadp-2.0.2}/setup.cfg +0 -0
  79. {pyquadp-2.0.0 → pyquadp-2.0.2}/setup.py +0 -0
  80. {pyquadp-2.0.0 → pyquadp-2.0.2}/tests/Makefile +0 -0
  81. {pyquadp-2.0.0 → pyquadp-2.0.2}/tests/conftest.py +0 -0
  82. {pyquadp-2.0.0 → pyquadp-2.0.2}/tests/fortran_test.py +0 -0
  83. {pyquadp-2.0.0 → pyquadp-2.0.2}/tests/import_order_test.py +0 -0
  84. {pyquadp-2.0.0 → pyquadp-2.0.2}/tests/qcmath_test.py +0 -0
  85. {pyquadp-2.0.0 → pyquadp-2.0.2}/tests/qcmplx_test.py +0 -0
  86. {pyquadp-2.0.0 → pyquadp-2.0.2}/tests/qmath_test.py +0 -0
  87. {pyquadp-2.0.0 → pyquadp-2.0.2}/tests/quad.f90 +0 -0
  88. {pyquadp-2.0.0 → pyquadp-2.0.2}/tox.ini +0 -0
@@ -4,7 +4,7 @@ This repository contains CPython C extensions and Python wrappers. Follow these
4
4
 
5
5
  ## C Extension Safety Rules
6
6
 
7
- - Prefer Python's limited API (`Py_LIMITED_API` / abi3-compatible APIs) for new C-extension code when feasible; use non-limited CPython internals only when required and document why.
7
+ - Require Python's limited API (`Py_LIMITED_API` / abi3-compatible APIs).
8
8
  - Never call `PyErr_Print()` in library/runtime code paths. Propagate existing exceptions instead.
9
9
  - Do not use unguarded `PyErr_Clear()` in parse fallbacks. Clear only expected exceptions via `PyErr_ExceptionMatches(...)`.
10
10
  - For functions returning `bool`, return `false`, not `NULL`.
@@ -21,6 +21,7 @@ This repository contains CPython C extensions and Python wrappers. Follow these
21
21
  - If using `"O"`, decref temporary explicitly after build
22
22
  - Avoid inline temporary key creation inside dict lookups (creates leaks and hides NULL checks). Create key object, check it, use it, decref it.
23
23
  - Do not pass temporaries directly into `PyObject_Hash(...)` when they are new references. Store, hash, decref.
24
+ - Prefer to implement new code via NumPy's ufunc machinery instead of custom C loops for better performance and maintainability.
24
25
 
25
26
  ## Module Init Ownership Rules
26
27
 
@@ -36,7 +37,7 @@ This repository contains CPython C extensions and Python wrappers. Follow these
36
37
 
37
38
  ## Required Validation For Relevant Changes
38
39
 
39
- - Run affected tests when touching wrappers or C-extension conversion/pickling/hash paths.
40
+ - Run all tests in the test module(s) that cover the changed wrapper or C-extension path. At minimum, the test categories listed below must pass.
40
41
  - Add or update tests for:
41
42
  - wrapper arity/name mismatches
42
43
  - pickle round-trip (`__getstate__`/`__setstate__`)
@@ -2,6 +2,9 @@ name: Bandit
2
2
  on: [push, pull_request]
3
3
  permissions: {}
4
4
 
5
+ concurrency:
6
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
7
+ cancel-in-progress: true
5
8
 
6
9
  jobs:
7
10
  analyze:
@@ -25,6 +28,6 @@ jobs:
25
28
  bandit -c pyproject.toml -r . -f sarif -o results.sarif || true
26
29
 
27
30
  - name: Upload SARIF file
28
- uses: github/codeql-action/upload-sarif@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
31
+ uses: github/codeql-action/upload-sarif@e46ed2cbd01164d986452f91f178727624ae40d7 # v4.35.3
29
32
  with:
30
33
  sarif_file: results.sarif
@@ -2,6 +2,10 @@ name: Lint
2
2
  on: [push, pull_request]
3
3
  permissions: {}
4
4
 
5
+ concurrency:
6
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
7
+ cancel-in-progress: true
8
+
5
9
  jobs:
6
10
  lint:
7
11
  runs-on: ubuntu-latest
@@ -9,6 +13,9 @@ jobs:
9
13
  - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
10
14
  with:
11
15
  persist-credentials: false
16
+ - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
17
+ with:
18
+ python-version: "3.14"
12
19
  - uses: psf/black@c6755bb741b6481d6b3d3bb563c83fa060db96c9 # 26.3.1
13
20
  with:
14
21
  options: "--check --verbose"
@@ -52,7 +52,7 @@ jobs:
52
52
 
53
53
  # Initializes the CodeQL tools for scanning.
54
54
  - name: Initialize CodeQL
55
- uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
55
+ uses: github/codeql-action/init@e46ed2cbd01164d986452f91f178727624ae40d7 # v4.35.3
56
56
  with:
57
57
  languages: ${{ matrix.language }}
58
58
  # If you wish to specify custom queries, you can do so here or in a config file.
@@ -82,6 +82,6 @@ jobs:
82
82
  python -m pip install dist/pyquadp*.whl
83
83
 
84
84
  - name: Perform CodeQL Analysis
85
- uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
85
+ uses: github/codeql-action/analyze@e46ed2cbd01164d986452f91f178727624ae40d7 # v4.35.3
86
86
  with:
87
87
  category: "/language:${{matrix.language}}"
@@ -2,6 +2,11 @@ on: ["push", "pull_request"]
2
2
  name: Coveralls
3
3
  permissions: {}
4
4
 
5
+ concurrency:
6
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
7
+ cancel-in-progress: true
8
+
9
+
5
10
  jobs:
6
11
  coveralls:
7
12
  runs-on: ubuntu-latest
@@ -2,6 +2,10 @@ name: Run isort
2
2
  on: [push, pull_request]
3
3
  permissions: {}
4
4
 
5
+ concurrency:
6
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
7
+ cancel-in-progress: true
8
+
5
9
  jobs:
6
10
  build:
7
11
  runs-on: ubuntu-latest
@@ -0,0 +1,79 @@
1
+ name: Linux ARM
2
+ on: [push, pull_request]
3
+ permissions: {}
4
+
5
+ concurrency:
6
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
7
+ cancel-in-progress: true
8
+
9
+ jobs:
10
+ linux_arm:
11
+ runs-on: ${{ matrix.os }}
12
+ strategy:
13
+ fail-fast: true
14
+ matrix:
15
+ os: [ ubuntu-24.04-arm]
16
+ python-version: [ '3.10', '3.11', '3.12', '3.13', '3.14']
17
+ toolchain:
18
+ - {compiler: gcc, version: 13}
19
+ - {compiler: gcc, version: 14}
20
+ - {compiler: gcc, version: 15}
21
+
22
+ steps:
23
+ - uses: fortran-lang/setup-fortran@2a1b9c55897d827a9dfeb114408f3615e53b2b72 # v1
24
+ id: setup-fortran
25
+ with:
26
+ compiler: ${{ matrix.toolchain.compiler }}
27
+ version: ${{ matrix.toolchain.version }}
28
+
29
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
30
+ with:
31
+ persist-credentials: false
32
+
33
+ - name: Set up Python ${{ matrix.python-version }}
34
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
35
+ with:
36
+ python-version: ${{ matrix.python-version }}
37
+ cache: 'pip'
38
+
39
+ - name: Install dependencies
40
+ run: |
41
+ python -m pip install --upgrade pip==25.2
42
+ python -m pip install build wheel pip-tools
43
+ pip-compile -o requirements.txt --extra test --strip-extras
44
+ python -m pip install -r requirements.txt
45
+ sudo apt-get update
46
+ sudo apt install --reinstall libquadmath0-amd64-cross
47
+
48
+
49
+ - name: Export toolchain paths
50
+ shell: pwsh
51
+ run: |
52
+ $gcc = "$env:STEPS_SETUP_FORTRAN_OUTPUTS_CC"
53
+ "CC=$gcc" >> $env:GITHUB_ENV
54
+ "CXX=$env:STEPS_SETUP_FORTRAN_OUTPUTS_CXX" >> $env:GITHUB_ENV
55
+ "FC=$env:STEPS_SETUP_FORTRAN_OUTPUTS_FC" >> $env:GITHUB_ENV
56
+
57
+ $inc = & $gcc -print-file-name=include
58
+ $libquadmath = & $gcc -print-file-name=libquadmath.so
59
+ $libdir = Split-Path $libquadmath -Parent
60
+
61
+ "CPPFLAGS=-I$inc" >> $env:GITHUB_ENV
62
+ "LDFLAGS=-L$libdir" >> $env:GITHUB_ENV
63
+ env:
64
+ STEPS_SETUP_FORTRAN_OUTPUTS_CC: ${{ steps.setup-fortran.outputs.cc }}
65
+ STEPS_SETUP_FORTRAN_OUTPUTS_CXX: ${{ steps.setup-fortran.outputs.cxx }}
66
+ STEPS_SETUP_FORTRAN_OUTPUTS_FC: ${{ steps.setup-fortran.outputs.fc }}
67
+
68
+ - name: Build
69
+ run: |
70
+ python -m build
71
+ python -m pip install dist/pyquadp*.whl
72
+
73
+
74
+ - name: Test
75
+ # Don't use python -m pytest as that screws up the module loading
76
+ run: |
77
+ pytest -v
78
+
79
+
@@ -2,6 +2,10 @@ name: Linux CI
2
2
  on: [push, pull_request]
3
3
  permissions: {}
4
4
 
5
+ concurrency:
6
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
7
+ cancel-in-progress: true
8
+
5
9
  jobs:
6
10
  linux_ci:
7
11
  runs-on: ${{ matrix.os }}
@@ -2,18 +2,22 @@ name: MacOS CI
2
2
  on: [push, pull_request]
3
3
  permissions: {}
4
4
 
5
+ concurrency:
6
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
7
+ cancel-in-progress: true
8
+
5
9
  jobs:
6
10
  macos_ci:
7
11
  runs-on: ${{ matrix.os }}
8
12
  strategy:
9
13
  fail-fast: true
10
14
  matrix:
11
- os: [macos-latest]
15
+ os: [macos-14, macos-15, macos-15-intel]
12
16
  python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
13
17
  toolchain:
14
- - {compiler: gcc, version: 12}
15
18
  - {compiler: gcc, version: 13}
16
19
  - {compiler: gcc, version: 14}
20
+ - {compiler: gcc, version: 15}
17
21
 
18
22
 
19
23
  steps:
@@ -2,6 +2,10 @@ name: Test on oldest Numpy
2
2
  on: [push, pull_request]
3
3
  permissions: {}
4
4
 
5
+ concurrency:
6
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
7
+ cancel-in-progress: true
8
+
5
9
  jobs:
6
10
  linux_ci:
7
11
  runs-on: ${{ matrix.os }}
@@ -29,7 +33,7 @@ jobs:
29
33
  python -m pip install build wheel pip-tools
30
34
  pip-compile -o requirements.txt --extra test --strip-extras
31
35
  python -m pip install -r requirements.txt
32
- python -m pip install numpy==2.0.0
36
+ python -m pip install numpy==2.1.0
33
37
 
34
38
  - uses: fortran-lang/setup-fortran@2a1b9c55897d827a9dfeb114408f3615e53b2b72 # v1
35
39
  id: setup-fortran
@@ -41,6 +45,7 @@ jobs:
41
45
  run: |
42
46
  python -m build
43
47
  python -m pip install dist/pyquadp*.whl
48
+
44
49
 
45
50
 
46
51
  - name: Test
@@ -0,0 +1,145 @@
1
+ name: Publish to pypi
2
+ on: [push, pull_request]
3
+
4
+ permissions: {}
5
+
6
+ concurrency:
7
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
8
+ cancel-in-progress: true
9
+
10
+ jobs:
11
+ build_wheels:
12
+ name: Build wheels for ${{ matrix.os }}
13
+ runs-on: ${{ matrix.os }}
14
+ strategy:
15
+ fail-fast: false
16
+ matrix:
17
+ include:
18
+ - os: ubuntu-latest
19
+ deployment-target: ""
20
+ - os: macos-15-intel
21
+ deployment-target: "15"
22
+ - os: macos-14
23
+ deployment-target: "14"
24
+ - os: macos-15
25
+ deployment-target: "15"
26
+
27
+ steps:
28
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
29
+ with:
30
+ persist-credentials: false
31
+
32
+ - uses: fortran-lang/setup-fortran@2a1b9c55897d827a9dfeb114408f3615e53b2b72 # v1
33
+ id: setup-fortran
34
+ with:
35
+ compiler: gcc
36
+ version: 13
37
+
38
+ # Used to host cibuildwheel
39
+ - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
40
+
41
+ - name: Install dependencies
42
+ run: |
43
+ python -m pip install --upgrade pip==25.2
44
+ python -m pip install build wheel pip-tools auditwheel pipx
45
+ pip-compile -o requirements.txt --extra test --strip-extras
46
+ python -m pip install -r requirements.txt
47
+ python -m pip install numpy==2.1.0
48
+
49
+ - if: runner.os == 'Windows'
50
+ name: Install Windows wheel repair tool
51
+ run: python -m pip install delvewheel
52
+
53
+
54
+ - if: runner.os == 'Windows'
55
+ name: Export toolchain paths
56
+ shell: pwsh
57
+ run: |
58
+ $gcc = "$env:STEPS_SETUP_FORTRAN_OUTPUTS_CC"
59
+ if (-not $gcc) {
60
+ $gcc = "gcc"
61
+ }
62
+ $gccPath = (Get-Command $gcc -ErrorAction Stop).Source
63
+ "CC=$gccPath" >> $env:GITHUB_ENV
64
+ "CXX=$env:STEPS_SETUP_FORTRAN_OUTPUTS_CXX" >> $env:GITHUB_ENV
65
+ "FC=$env:STEPS_SETUP_FORTRAN_OUTPUTS_FC" >> $env:GITHUB_ENV
66
+ $gccdir = Split-Path $gccPath -Parent
67
+ "GCC_BIN_DIR=$gccdir" >> $env:GITHUB_ENV
68
+
69
+ $inc = & $gccPath -print-file-name=include
70
+ $libquadmathImport = & $gccPath -print-file-name=libquadmath.dll.a
71
+ $libdir = ""
72
+ if ($libquadmathImport -and $libquadmathImport -ne "libquadmath.dll.a") {
73
+ $libdir = Split-Path $libquadmathImport -Parent
74
+ }
75
+
76
+ "CPPFLAGS=-I$inc" >> $env:GITHUB_ENV
77
+ if ($libdir) {
78
+ "LDFLAGS=-L$libdir" >> $env:GITHUB_ENV
79
+ $libdir | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
80
+ }
81
+ $gccdir | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
82
+ env:
83
+ STEPS_SETUP_FORTRAN_OUTPUTS_CC: ${{ steps.setup-fortran.outputs.cc }}
84
+ STEPS_SETUP_FORTRAN_OUTPUTS_CXX: ${{ steps.setup-fortran.outputs.cxx }}
85
+ STEPS_SETUP_FORTRAN_OUTPUTS_FC: ${{ steps.setup-fortran.outputs.fc }}
86
+
87
+ - name: Build wheels
88
+ uses: pypa/cibuildwheel@8d2b08b68458a16aeb24b64e68a09ab1c8e82084 # v3.4.1
89
+ env:
90
+ # Py_LIMITED_API / abi3 wheels are not supported on free-threaded CPython yet.
91
+ CIBW_SKIP: "cp3??t-*"
92
+ MACOSX_DEPLOYMENT_TARGET: ${{ matrix.deployment-target || '10.9' }}
93
+ CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: python -m delvewheel repair -w {dest_dir} {wheel}
94
+
95
+
96
+
97
+ - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
98
+ with:
99
+ name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
100
+ path: ./wheelhouse/*.whl
101
+
102
+ build_sdist:
103
+ name: Build source distribution
104
+ runs-on: ubuntu-latest
105
+ steps:
106
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
107
+ with:
108
+ persist-credentials: false
109
+
110
+ - name: Install dependencies
111
+ run: |
112
+ python -m pip install --upgrade pip==25.2
113
+ python -m pip install build wheel pip-tools auditwheel pipx
114
+ pip-compile -o requirements.txt --extra test --strip-extras
115
+ python -m pip install -r requirements.txt
116
+ python -m pip install numpy==2.1.0
117
+
118
+ - name: Build sdist
119
+ run: python3 -m build --sdist
120
+
121
+ - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
122
+ with:
123
+ name: cibw-sdist
124
+ path: dist/*.tar.gz
125
+
126
+ upload_pypi:
127
+ needs: [build_wheels, build_sdist]
128
+ runs-on: ubuntu-latest
129
+ environment:
130
+ name: pypi
131
+ url: https://pypi.org/project/pyQuadP
132
+ permissions:
133
+ id-token: write
134
+ # or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
135
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
136
+ steps:
137
+ - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
138
+ with:
139
+ # unpacks all CIBW artifacts into dist/
140
+ pattern: cibw-*
141
+ path: dist
142
+ merge-multiple: true
143
+
144
+ - uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
145
+
@@ -2,6 +2,10 @@ name: PyPy
2
2
  on: [push, pull_request]
3
3
  permissions: {}
4
4
 
5
+ concurrency:
6
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
7
+ cancel-in-progress: true
8
+
5
9
  jobs:
6
10
  pypy:
7
11
  runs-on: ubuntu-latest
@@ -0,0 +1,165 @@
1
+ name: Windows CI
2
+ on: [push, pull_request]
3
+ permissions: {}
4
+
5
+ concurrency:
6
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
7
+ cancel-in-progress: true
8
+
9
+ jobs:
10
+ windows_ci:
11
+ runs-on: ${{ matrix.os }}
12
+ strategy:
13
+ fail-fast: true
14
+ matrix:
15
+ os: [windows-latest]
16
+ python-version: [ '3.10', '3.11', '3.12', '3.13', '3.14']
17
+
18
+
19
+ steps:
20
+ - uses: fortran-lang/setup-fortran@2a1b9c55897d827a9dfeb114408f3615e53b2b72 # v1
21
+ id: setup-fortran
22
+ with:
23
+ compiler: gcc
24
+
25
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
26
+ with:
27
+ persist-credentials: false
28
+ - name: Set up Python ${{ matrix.python-version }}
29
+ uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
30
+ with:
31
+ python-version: ${{ matrix.python-version }}
32
+ cache: 'pip'
33
+
34
+ - name: Install dependencies
35
+ run: |
36
+ python -m pip install --upgrade pip==25.2
37
+ python -m pip install build wheel pip-tools delvewheel
38
+ pip-compile -o requirements.txt --extra test --strip-extras
39
+ python -m pip install -r requirements.txt
40
+
41
+ - name: Export toolchain paths
42
+ shell: pwsh
43
+ run: |
44
+ $gcc = "$env:STEPS_SETUP_FORTRAN_OUTPUTS_CC"
45
+ if (-not $gcc) {
46
+ $gcc = "gcc"
47
+ }
48
+ $gccPath = (Get-Command $gcc -ErrorAction Stop).Source
49
+
50
+ $cxx = "$env:STEPS_SETUP_FORTRAN_OUTPUTS_CXX"
51
+ if (-not $cxx) {
52
+ $cxx = "g++"
53
+ }
54
+ $cxxPath = (Get-Command $cxx -ErrorAction Stop).Source
55
+
56
+ $fc = "$env:STEPS_SETUP_FORTRAN_OUTPUTS_FC"
57
+ if (-not $fc) {
58
+ $fc = "gfortran"
59
+ }
60
+ $fcPath = (Get-Command $fc -ErrorAction Stop).Source
61
+
62
+ "CC=$gccPath" >> $env:GITHUB_ENV
63
+ "CXX=$cxxPath" >> $env:GITHUB_ENV
64
+ "FC=$fcPath" >> $env:GITHUB_ENV
65
+ $gccdir = Split-Path $gccPath -Parent
66
+
67
+ $inc = & $gccPath -print-file-name=include
68
+ $libquadmathImport = & $gccPath -print-file-name=libquadmath.dll.a
69
+ $libdir = ""
70
+ if ($libquadmathImport -and $libquadmathImport -ne "libquadmath.dll.a") {
71
+ $libdir = Split-Path $libquadmathImport -Parent
72
+ }
73
+
74
+ "CPPFLAGS=-I$inc" >> $env:GITHUB_ENV
75
+ if ($libdir) {
76
+ "LDFLAGS=-L$libdir" >> $env:GITHUB_ENV
77
+ }
78
+ $gccdir | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
79
+ if ($libdir) {
80
+ $libdir | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
81
+ }
82
+ env:
83
+ STEPS_SETUP_FORTRAN_OUTPUTS_CC: ${{ steps.setup-fortran.outputs.cc }}
84
+ STEPS_SETUP_FORTRAN_OUTPUTS_CXX: ${{ steps.setup-fortran.outputs.cxx }}
85
+ STEPS_SETUP_FORTRAN_OUTPUTS_FC: ${{ steps.setup-fortran.outputs.fc }}
86
+
87
+
88
+ - name: Toolchain diagnostics
89
+ shell: pwsh
90
+ run: |
91
+ Write-Host "CC=$env:CC"
92
+ Write-Host "CXX=$env:CXX"
93
+ Write-Host "FC=$env:FC"
94
+ Write-Host "CPPFLAGS=$env:CPPFLAGS"
95
+ Write-Host "LDFLAGS=$env:LDFLAGS"
96
+
97
+ foreach ($tool in @($env:CC, $env:CXX, $env:FC, "gcc", "g++", "gfortran")) {
98
+ if ($tool) {
99
+ try {
100
+ $resolved = (Get-Command $tool -ErrorAction Stop).Source
101
+ $exists = Test-Path $resolved
102
+ Write-Host "RESOLVE $tool -> $resolved (exists=$exists)"
103
+ }
104
+ catch {
105
+ Write-Host "RESOLVE $tool -> NOT FOUND"
106
+ }
107
+ }
108
+ }
109
+
110
+ python -c "import os, shutil, sys; print('python=', sys.executable); [print(f'{k}={os.environ.get(k)}') for k in ('CC','CXX','FC','CPPFLAGS','LDFLAGS')]; [print(f'which {t} -> {shutil.which(t)}') for t in ('gcc','g++','gfortran')]"
111
+
112
+ - name: Build
113
+ shell: pwsh
114
+ run: |
115
+ python -m build -vvv
116
+
117
+ Write-Host "Contents of dist folder:"
118
+ Get-ChildItem -Path dist -Recurse | Format-Table -AutoSize
119
+
120
+ $wheel = Get-ChildItem -Path dist -Filter "pyquadp*.whl" |
121
+ Sort-Object LastWriteTime -Descending |
122
+ Select-Object -First 1 -ExpandProperty FullName
123
+ if (-not $wheel) {
124
+ throw "No wheel matching pyquadp*.whl found in dist"
125
+ }
126
+
127
+ $gccPath = (Get-Command $env:CC -ErrorAction Stop).Source
128
+ $gccdir = Split-Path $gccPath -Parent
129
+ $repairedDir = Join-Path $env:RUNNER_TEMP "repaired-wheel"
130
+ if (Test-Path $repairedDir) {
131
+ Remove-Item -Recurse -Force $repairedDir
132
+ }
133
+ New-Item -ItemType Directory -Path $repairedDir | Out-Null
134
+
135
+ # Bundle MinGW runtime DLLs into the wheel so Python can load extensions.
136
+ python -m delvewheel repair --add-path "$gccdir" -w "$repairedDir" "$wheel"
137
+
138
+ $repairedWheel = Get-ChildItem -Path $repairedDir -Filter "pyquadp*.whl" |
139
+ Sort-Object LastWriteTime -Descending |
140
+ Select-Object -First 1 -ExpandProperty FullName
141
+ if (-not $repairedWheel) {
142
+ throw "delvewheel did not produce a repaired wheel"
143
+ }
144
+
145
+ python -m pip install "$repairedWheel"
146
+
147
+ - name: Sanity check import
148
+ shell: pwsh
149
+ run: |
150
+ Set-Location $env:RUNNER_TEMP
151
+ python -c "import pyquadp; print('pyquadp import OK')"
152
+
153
+
154
+ - name: Test
155
+ # Don't use python -m pytest as that screws up the module loading
156
+ shell: pwsh
157
+ run: |
158
+ $tmpTests = Join-Path $env:RUNNER_TEMP "pyquadp-tests"
159
+ if (Test-Path $tmpTests) {
160
+ Remove-Item -Recurse -Force $tmpTests
161
+ }
162
+ Copy-Item -Recurse tests $tmpTests
163
+ Set-Location $env:RUNNER_TEMP
164
+ pytest -v $tmpTests
165
+
@@ -6,6 +6,10 @@ on:
6
6
  pull_request:
7
7
  branches: ["**"]
8
8
 
9
+ concurrency:
10
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11
+ cancel-in-progress: true
12
+
9
13
  jobs:
10
14
  zizmor:
11
15
  name: zizmor latest via PyPI
@@ -22,7 +26,7 @@ jobs:
22
26
  persist-credentials: false
23
27
 
24
28
  - name: Install the latest version of uv
25
- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
29
+ uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
26
30
 
27
31
  - name: Run zizmor 🌈
28
32
  run: uvx zizmor --format sarif . > results.sarif
@@ -30,7 +34,7 @@ jobs:
30
34
  GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31
35
 
32
36
  - name: Upload SARIF file
33
- uses: github/codeql-action/upload-sarif@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
37
+ uses: github/codeql-action/upload-sarif@e46ed2cbd01164d986452f91f178727624ae40d7 # v4.35.3
34
38
  with:
35
39
  sarif_file: results.sarif
36
40
  category: zizmor
@@ -0,0 +1,27 @@
1
+ fail_fast: true
2
+ repos:
3
+ - repo: https://github.com/psf/black-pre-commit-mirror
4
+ rev: 26.5.1
5
+ hooks:
6
+ - id: black
7
+ language_version: python3 # Should be a command that runs python3.6+
8
+ - repo: https://github.com/woodruffw/zizmor-pre-commit
9
+ rev: v1.25.2
10
+ hooks:
11
+ - id: zizmor
12
+ - repo: https://github.com/rhysd/actionlint
13
+ rev: v1.7.12
14
+ hooks:
15
+ - id: actionlint
16
+ - repo: https://github.com/pre-commit/mirrors-mypy
17
+ rev: v2.1.0
18
+ hooks:
19
+ - id: mypy
20
+ args: ["-p", "pyquadp"]
21
+ pass_filenames: false
22
+ additional_dependencies: ["numpy>=2.1.0","types-setuptools"]
23
+ - repo: https://github.com/pycqa/isort
24
+ rev: 9.0.0a3
25
+ hooks:
26
+ - id: isort
27
+ args: ["--profile", "black", "--filter-files"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyquadp
3
- Version: 2.0.0
3
+ Version: 2.0.2
4
4
  Summary: Python's bindings for gcc's libquadmath
5
5
  Author-email: Robert Farmer <robert.j.farmer37@gmail.com>
6
6
  License-Expression: GPL-2.0-or-later
@@ -16,7 +16,7 @@ Classifier: Topic :: Software Development :: Code Generators
16
16
  Requires-Python: >=3.10
17
17
  Description-Content-Type: text/markdown
18
18
  License-File: COPYING.txt
19
- Requires-Dist: numpy>=2.0
19
+ Requires-Dist: numpy>=2.1.0
20
20
  Provides-Extra: test
21
21
  Requires-Dist: pytest; extra == "test"
22
22
  Requires-Dist: pytest-xdist[psutil]; extra == "test"
@@ -1,4 +1,5 @@
1
1
  #!/bin/bash
2
+ set -euo pipefail
2
3
 
3
4
  export CC=gcc
4
5
  export CXX=g++
pyquadp-2.0.2/lint.sh ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+
4
+ python -m black pyquadp/ tests/
5
+ isort .
6
+ mypy -p pyquadp
7
+ zizmor --fix=all --gh-token $(gh auth token) .github/**/*.yml
@@ -1,5 +1,5 @@
1
1
  [build-system]
2
- requires = ["setuptools>=74.1.0", "wheel", "setuptools_scm[toml]>=8.0", "numpy>=2.0"]
2
+ requires = ["setuptools>=80.1.0", "wheel", "setuptools_scm[toml]>=8.0", "numpy>=2.1.0"]
3
3
  build-backend = "setuptools.build_meta"
4
4
 
5
5
  [tool.setuptools_scm]
@@ -13,7 +13,7 @@ authors = [
13
13
  ]
14
14
 
15
15
  dependencies =[
16
- "numpy >=2.0",
16
+ "numpy >=2.1.0",
17
17
  ]
18
18
 
19
19
  readme = "README.md"