canibuild 0.3.0__tar.gz → 0.5.0__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 (55) hide show
  1. {canibuild-0.3.0 → canibuild-0.5.0}/.github/workflows/integrations.yml +67 -0
  2. {canibuild-0.3.0 → canibuild-0.5.0}/.github/workflows/tests.yml +6 -0
  3. {canibuild-0.3.0 → canibuild-0.5.0}/CHANGELOG.md +29 -0
  4. {canibuild-0.3.0 → canibuild-0.5.0}/PKG-INFO +54 -7
  5. {canibuild-0.3.0 → canibuild-0.5.0}/README.md +53 -6
  6. {canibuild-0.3.0 → canibuild-0.5.0}/action.yml +1 -1
  7. {canibuild-0.3.0 → canibuild-0.5.0}/docs/validation.md +59 -0
  8. canibuild-0.5.0/examples/new-python/requirements.txt +5 -0
  9. {canibuild-0.3.0 → canibuild-0.5.0}/src/canibuild/__init__.py +1 -1
  10. canibuild-0.5.0/src/canibuild/capi.py +471 -0
  11. {canibuild-0.3.0 → canibuild-0.5.0}/src/canibuild/check.py +57 -3
  12. {canibuild-0.3.0 → canibuild-0.5.0}/src/canibuild/cli.py +5 -1
  13. {canibuild-0.3.0 → canibuild-0.5.0}/src/canibuild/fixes.py +27 -0
  14. {canibuild-0.3.0 → canibuild-0.5.0}/src/canibuild/model.py +3 -1
  15. canibuild-0.5.0/src/canibuild/reach.py +432 -0
  16. {canibuild-0.3.0 → canibuild-0.5.0}/src/canibuild/report.py +10 -0
  17. {canibuild-0.3.0 → canibuild-0.5.0}/src/canibuild/rules.py +58 -3
  18. {canibuild-0.3.0 → canibuild-0.5.0}/src/canibuild/sdist.py +27 -2
  19. {canibuild-0.3.0 → canibuild-0.5.0}/src/canibuild/target.py +47 -7
  20. {canibuild-0.3.0 → canibuild-0.5.0}/src/canibuild/verify.py +34 -3
  21. canibuild-0.5.0/tests/test_capi.py +307 -0
  22. {canibuild-0.3.0 → canibuild-0.5.0}/tests/test_check.py +130 -3
  23. {canibuild-0.3.0 → canibuild-0.5.0}/tests/test_fixes.py +35 -0
  24. canibuild-0.5.0/tests/test_reach.py +204 -0
  25. {canibuild-0.3.0 → canibuild-0.5.0}/tests/test_report.py +22 -0
  26. {canibuild-0.3.0 → canibuild-0.5.0}/tests/test_rules.py +81 -0
  27. {canibuild-0.3.0 → canibuild-0.5.0}/tests/test_sdist.py +37 -0
  28. {canibuild-0.3.0 → canibuild-0.5.0}/tests/test_target.py +34 -0
  29. {canibuild-0.3.0 → canibuild-0.5.0}/tests/test_verify.py +80 -0
  30. {canibuild-0.3.0 → canibuild-0.5.0}/.gitignore +0 -0
  31. {canibuild-0.3.0 → canibuild-0.5.0}/.pre-commit-hooks.yaml +0 -0
  32. {canibuild-0.3.0 → canibuild-0.5.0}/LICENSE +0 -0
  33. {canibuild-0.3.0 → canibuild-0.5.0}/action/run.sh +0 -0
  34. {canibuild-0.3.0 → canibuild-0.5.0}/examples/broken/requirements.txt +0 -0
  35. {canibuild-0.3.0 → canibuild-0.5.0}/examples/clean/pyproject.toml +0 -0
  36. {canibuild-0.3.0 → canibuild-0.5.0}/examples/clean/uv.lock +0 -0
  37. {canibuild-0.3.0 → canibuild-0.5.0}/examples/git/requirements.txt +0 -0
  38. {canibuild-0.3.0 → canibuild-0.5.0}/pyproject.toml +0 -0
  39. {canibuild-0.3.0 → canibuild-0.5.0}/src/canibuild/__main__.py +0 -0
  40. {canibuild-0.3.0 → canibuild-0.5.0}/src/canibuild/lockfiles.py +0 -0
  41. {canibuild-0.3.0 → canibuild-0.5.0}/src/canibuild/py.typed +0 -0
  42. {canibuild-0.3.0 → canibuild-0.5.0}/src/canibuild/pypi.py +0 -0
  43. {canibuild-0.3.0 → canibuild-0.5.0}/src/canibuild/sources.py +0 -0
  44. {canibuild-0.3.0 → canibuild-0.5.0}/tests/conftest.py +0 -0
  45. {canibuild-0.3.0 → canibuild-0.5.0}/tests/fixtures/base.txt +0 -0
  46. {canibuild-0.3.0 → canibuild-0.5.0}/tests/fixtures/pylock.toml +0 -0
  47. {canibuild-0.3.0 → canibuild-0.5.0}/tests/fixtures/requirements.txt +0 -0
  48. {canibuild-0.3.0 → canibuild-0.5.0}/tests/fixtures/uv-direct-sources.pyproject.toml +0 -0
  49. {canibuild-0.3.0 → canibuild-0.5.0}/tests/fixtures/uv-direct-sources.uv.lock +0 -0
  50. {canibuild-0.3.0 → canibuild-0.5.0}/tests/fixtures/uv.lock +0 -0
  51. {canibuild-0.3.0 → canibuild-0.5.0}/tests/test_cli.py +0 -0
  52. {canibuild-0.3.0 → canibuild-0.5.0}/tests/test_lockfiles.py +0 -0
  53. {canibuild-0.3.0 → canibuild-0.5.0}/tests/test_model.py +0 -0
  54. {canibuild-0.3.0 → canibuild-0.5.0}/tests/test_pypi.py +0 -0
  55. {canibuild-0.3.0 → canibuild-0.5.0}/tests/test_sources.py +0 -0
@@ -102,6 +102,73 @@ jobs:
102
102
  with:
103
103
  working-directory: examples/clean
104
104
 
105
+ new-python:
106
+ # uv downloads the 3.14t and 3.15 interpreters (about 30 MB each) when --verify
107
+ # creates its environments, so no special runner image is needed.
108
+ runs-on: ubuntu-latest
109
+ steps:
110
+ - uses: actions/checkout@v4
111
+
112
+ - name: Free-threaded 3.14t
113
+ id: ft
114
+ continue-on-error: true
115
+ uses: ./
116
+ with:
117
+ lockfiles: examples/new-python/requirements.txt
118
+ python: "3.14t"
119
+ verify: "true"
120
+
121
+ - name: Check the limited-API build was confirmed and msgpack's build failed
122
+ shell: bash
123
+ env:
124
+ OUTCOME: ${{ steps.ft.outcome }}
125
+ REPORT: ${{ steps.ft.outputs.report }}
126
+ run: |
127
+ test "$OUTCOME" = failure
128
+ python3 - "$REPORT" <<'PY'
129
+ import json, sys
130
+ found = {
131
+ f["package"]: f
132
+ for r in json.load(open(sys.argv[1]))
133
+ for f in r["findings"]
134
+ if f["severity"] != "info"
135
+ }
136
+ crypto, msgpack = found["pycryptodome"], found["msgpack"]
137
+ assert crypto["rule"] == "free-threading-limited-api", crypto
138
+ assert crypto["verification"]["status"] == "confirmed", crypto
139
+ assert msgpack["rule"] == "no-wheel-for-python", msgpack
140
+ # Its Cython 3.0 C code doesn't compile on free-threaded 3.14.
141
+ assert msgpack["verification"]["status"] == "fails", msgpack
142
+ assert msgpack["severity"] == "error", msgpack
143
+ PY
144
+
145
+ - name: Python 3.15
146
+ id: py315
147
+ uses: ./
148
+ with:
149
+ lockfiles: examples/new-python/requirements.txt
150
+ python: "3.15"
151
+ verify: "true"
152
+ fail-on: never
153
+
154
+ - name: Check msgpack 1.1.0 builds on 3.15 without a wheel
155
+ shell: bash
156
+ env:
157
+ REPORT: ${{ steps.py315.outputs.report }}
158
+ run: |
159
+ python3 - "$REPORT" <<'PY'
160
+ import json, sys
161
+ found = {
162
+ f["package"]: f
163
+ for r in json.load(open(sys.argv[1]))
164
+ for f in r["findings"]
165
+ if f["severity"] != "info"
166
+ }
167
+ msgpack = found["msgpack"]
168
+ assert msgpack["rule"] == "no-wheel-for-python", msgpack
169
+ assert msgpack["verification"]["status"] == "builds", msgpack
170
+ PY
171
+
105
172
  pre-commit:
106
173
  runs-on: ubuntu-latest
107
174
  steps:
@@ -23,6 +23,12 @@ jobs:
23
23
  matrix:
24
24
  os: [ubuntu-latest, macos-latest, windows-latest]
25
25
  python-version: ["3.10", "3.13", "3.14"]
26
+ include:
27
+ # canibuild running on a free-threaded and on the newest interpreter.
28
+ - os: ubuntu-latest
29
+ python-version: "3.14t"
30
+ - os: ubuntu-latest
31
+ python-version: "3.15"
26
32
  steps:
27
33
  - uses: actions/checkout@v4
28
34
  - uses: actions/setup-python@v5
@@ -1,5 +1,34 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.0 (2026-12-05)
4
+
5
+ - `--verify` builds packages with a `no-wheel-for-python` warning on the target Python
6
+ and reports `builds`, or `fails` with the first error the build printed; a failing
7
+ build becomes an error. The summary line says how many of these builds worked.
8
+ - setup.py imports in branches a pip/uv build never takes are no longer reported: tests
9
+ on `sys.argv` for commands other than the build backend's, helpers such as pygame's
10
+ `consume_arg`, and checks for files missing from the sdist. This removes the false
11
+ Cython and msilib findings for pygame 2.6.1.
12
+ - CI runs the tests on Python 3.14t and 3.15, and builds an example on both with
13
+ `--verify`.
14
+
15
+ ## 0.4.0 (2026-12-05)
16
+
17
+ - Free-threaded targets: `--python 3.14t` (or `cp314t`, or the running free-threaded
18
+ interpreter) matches `cp314t` wheels and no longer counts `abi3` wheels, which don't
19
+ install there; on 3.15t `abi3t` wheels (PEP 803) count. `--verify` builds with the
20
+ free-threaded interpreter.
21
+ - New `no-wheel-for-python` warning: the release has compiled wheels, but none for the
22
+ target (for example wheels up to `cp313` when checking 3.15 or 3.14t), so pip/uv will
23
+ build it from the sdist. When the build also has a real problem, the other wheels are
24
+ noted on that finding. Upgrades suggested for it must have a matching wheel.
25
+ - New `c-api-removed` rule for Python 3.15+: unguarded calls in C/C++ sources to the
26
+ functions What's New in Python 3.15 lists as removed (`PyWeakref_GetObject`,
27
+ `PyImport_ImportModuleNoBlock`, `Py_GetPrefix` and others).
28
+ - New `free-threading-limited-api` rule for 3.13t and 3.14t: builds that enable the
29
+ limited C API, which those interpreters reject.
30
+ - `--verify` recognises the compiler and setuptools errors for both new rules.
31
+
3
32
  ## 0.3.0 (2026-12-05)
4
33
 
5
34
  - Git, path and URL dependencies are now checked instead of listed as not checked.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: canibuild
3
- Version: 0.3.0
3
+ Version: 0.5.0
4
4
  Summary: Check a lockfile for dependencies that will fail to build from source, before you install.
5
5
  Project-URL: Homepage, https://github.com/driftwright/canibuild
6
6
  Project-URL: Issues, https://github.com/driftwright/canibuild/issues
@@ -115,11 +115,48 @@ imports, and parses them with `ast`. It never runs code from a package.
115
115
  | `distutils` | `setup.py` imports `distutils` on Python 3.12+ and setuptools isn't in the build |
116
116
  | `missing-build-requires` | `setup.py` imports a module at top level (such as `torch` or `numpy`) that the sdist doesn't declare in `build-system.requires`, so the isolated build can't import it |
117
117
  | `no-installable-file` | there is no wheel for the target and no sdist |
118
+ | `c-api-removed` | Python 3.15+: a C or C++ source calls a function that [Python 3.15 removed](https://docs.python.org/3.15/whatsnew/3.15.html#removed-c-apis), such as `PyWeakref_GetObject` or `Py_GetPrefix`, outside any version check |
119
+ | `free-threading-limited-api` | free-threaded 3.13t or 3.14t: the build enables the limited C API (`py_limited_api` in `setup.cfg` or `setup.py`, or `Py_LIMITED_API` defined in a source file or `define_macros`), which [these builds reject](https://github.com/python/cpython/issues/111506) |
118
120
 
119
121
  An import inside a `try: ... except ImportError` is ignored. An import inside a function
120
- is reported as a warning, since it fails only if that code runs during the build.
122
+ is reported as a warning, since it fails only if that code runs during the build. An
123
+ import in a branch that a pip/uv build never takes is ignored too: a test on `sys.argv`
124
+ for a command other than the ones setuptools' build backend runs (`egg_info`,
125
+ `dist_info`, `bdist_wheel`, `sdist`, `editable_wheel`), directly or through a helper
126
+ like pygame's `consume_arg("cython")`, or a check for a file the sdist doesn't contain
127
+ (`os.path.exists`, `glob.glob`), followed through simple flag variables. pygame 2.6.1,
128
+ for example, only imports Cython when its generated C files are missing, and msilib for
129
+ `bdist_msi`. When a condition can't be worked out, the import is reported as before.
121
130
  Packages that build from source with no known problem are listed as such, with a note
122
- when they compile native code.
131
+ when they compile native code. When such a package has compiled wheels, just none for
132
+ the target (say, wheels up to `cp313` but not `cp315` or `cp314t`), it is reported as a
133
+ `no-wheel-for-python` warning, since the build is probably unexpected and needs a
134
+ compiler; the fix names the first newer release with a matching wheel.
135
+
136
+ ### New Python versions and free-threaded builds
137
+
138
+ Pass `--python 3.15` to check a new Python before its wheels are out, and
139
+ `--python 3.14t` (or `cp314t`) for the free-threaded build. Wheel matching follows the
140
+ interpreter: `abi3` wheels don't install on free-threaded 3.13t and 3.14t, and on 3.15t
141
+ only `abi3t` wheels ([PEP 803](https://peps.python.org/pep-0803/)) do.
142
+
143
+ Two checks read the C sources of packages that would be built:
144
+
145
+ - `c-api-removed` looks for calls to the functions listed under "Removed C APIs" in
146
+ What's New in Python 3.15. With GCC 14+ or Clang 16+ the build fails with an implicit
147
+ declaration error; older compilers build a module that fails on import. Calls are
148
+ skipped when they sit inside an `#if` on `PY_VERSION_HEX`, `PY_MINOR_VERSION`,
149
+ `Py_LIMITED_API`, `PYPY_VERSION` or a Cython switch (or a macro defined from one of
150
+ those), when the package defines the name itself (a compat header), and under
151
+ `tests/`, `docs/` and `examples/`. Comments and strings are ignored.
152
+ - `free-threading-limited-api` flags builds that turn on the limited API for 3.13t or
153
+ 3.14t. CPython 3.13 and 3.14 stop the compile with `#error "The limited API is not
154
+ currently supported in the free-threaded build"`, and setuptools refuses
155
+ `py_limited_api` there. Settings behind a `Py_GIL_DISABLED` check are not reported.
156
+
157
+ For example, `pygame==2.6.1` on 3.15 (it calls `PyWeakref_GetObject` in
158
+ `src_c/surface.c`) and `pycryptodome==3.19.0` on 3.14t (`py-limited-api = cp35` in
159
+ `setup.cfg`); `--verify` confirms both.
123
160
 
124
161
  ### Git, path and URL dependencies
125
162
 
@@ -229,6 +266,13 @@ Each finding gets one of these results:
229
266
  | `refuted` | The build succeeded. The finding no longer counts toward `--fail-on`. |
230
267
  | `timeout` | No result within `--verify-timeout` seconds (default 900). |
231
268
  | `skipped` | uv isn't installed, the target platform isn't this machine (the detail names both), or uv couldn't create an environment for the target Python. |
269
+ | `builds` | For `no-wheel-for-python`: the sdist built on the target Python. It stays a warning, since the install still needs a compiler. |
270
+ | `fails` | For `no-wheel-for-python`: the source build failed; the first error it printed is shown, and the finding becomes an error. |
271
+
272
+ For example, msgpack 1.1.0 and numpy 1.26.4 build from source on 3.15 but fail on
273
+ free-threaded 3.14t (`unknown type name '__pyx_vectorcallfunc'` and `'PyObject' has no
274
+ member named 'ob_refcnt'`). "Builds" only means the build finished: a package with an
275
+ optional extension, such as PyYAML 6.0.1, may quietly install without it.
232
276
 
233
277
  Builds run one at a time, so `--verify` takes as long as the flagged builds do; large
234
278
  native packages can take minutes. uv may download the target Python if it isn't installed.
@@ -271,7 +315,8 @@ canibuild [check] LOCKFILE... [--python X.Y] [--platform P] [--format text|json]
271
315
  - `LOCKFILE`: one or more of `uv.lock`, `pylock.toml` (or `pylock.NAME.toml`), or a requirements file.
272
316
  Requirements files may include other files with `-r`. Unpinned requirements are checked
273
317
  at the newest release that matches and supports the target Python.
274
- - `--python`: the target Python, such as `3.12`. Defaults to the running interpreter, or
318
+ - `--python`: the target Python, such as `3.12`, `3.15`, or `3.14t` for a free-threaded
319
+ build. Defaults to the running interpreter, or
275
320
  to the oldest version a `uv.lock` or `pylock.toml` allows when the running one is outside
276
321
  its `requires-python`.
277
322
  - `--platform`: `linux-x86_64`, `linux-aarch64`, `musllinux-x86_64`, `musllinux-aarch64`,
@@ -294,7 +339,7 @@ or `$CANIBUILD_CACHE_DIR`).
294
339
 
295
340
  ```yaml
296
341
  - uses: actions/checkout@v4
297
- - uses: driftwright/canibuild@v0.3.0
342
+ - uses: driftwright/canibuild@v0.5.0
298
343
  with:
299
344
  lockfiles: uv.lock # default: every uv.lock, pylock*.toml, requirements*.txt
300
345
  python: "3.12" # default: as for --python below
@@ -317,7 +362,7 @@ when `platform` is the runner's own.
317
362
  ```yaml
318
363
  repos:
319
364
  - repo: https://github.com/driftwright/canibuild
320
- rev: v0.3.0
365
+ rev: v0.5.0
321
366
  hooks:
322
367
  - id: canibuild
323
368
  # args: [--python, "3.12"]
@@ -332,7 +377,9 @@ network access to PyPI.
332
377
  (Mercurial, Subversion, Bazaar) are listed as not checked. Private git repositories work
333
378
  only if `git` can reach them without a prompt.
334
379
  - The checks are static. A `setup.py` that fails for a reason not in the table above, or
335
- that needs a compiler or system library you don't have, isn't caught.
380
+ that needs a compiler or system library you don't have, isn't caught. The C checks only
381
+ cover the removed 3.15 functions and the limited-API conflict; other free-threading
382
+ problems (thread safety, `Py_mod_gil`) and C files over 512 KiB are not inspected.
336
383
  - Requirements files are not resolved: only the packages they list are checked, not their
337
384
  dependencies. Use a lockfile (`uv.lock`, `pylock.toml`, or `pip-compile` output) for the
338
385
  full tree.
@@ -83,11 +83,48 @@ imports, and parses them with `ast`. It never runs code from a package.
83
83
  | `distutils` | `setup.py` imports `distutils` on Python 3.12+ and setuptools isn't in the build |
84
84
  | `missing-build-requires` | `setup.py` imports a module at top level (such as `torch` or `numpy`) that the sdist doesn't declare in `build-system.requires`, so the isolated build can't import it |
85
85
  | `no-installable-file` | there is no wheel for the target and no sdist |
86
+ | `c-api-removed` | Python 3.15+: a C or C++ source calls a function that [Python 3.15 removed](https://docs.python.org/3.15/whatsnew/3.15.html#removed-c-apis), such as `PyWeakref_GetObject` or `Py_GetPrefix`, outside any version check |
87
+ | `free-threading-limited-api` | free-threaded 3.13t or 3.14t: the build enables the limited C API (`py_limited_api` in `setup.cfg` or `setup.py`, or `Py_LIMITED_API` defined in a source file or `define_macros`), which [these builds reject](https://github.com/python/cpython/issues/111506) |
86
88
 
87
89
  An import inside a `try: ... except ImportError` is ignored. An import inside a function
88
- is reported as a warning, since it fails only if that code runs during the build.
90
+ is reported as a warning, since it fails only if that code runs during the build. An
91
+ import in a branch that a pip/uv build never takes is ignored too: a test on `sys.argv`
92
+ for a command other than the ones setuptools' build backend runs (`egg_info`,
93
+ `dist_info`, `bdist_wheel`, `sdist`, `editable_wheel`), directly or through a helper
94
+ like pygame's `consume_arg("cython")`, or a check for a file the sdist doesn't contain
95
+ (`os.path.exists`, `glob.glob`), followed through simple flag variables. pygame 2.6.1,
96
+ for example, only imports Cython when its generated C files are missing, and msilib for
97
+ `bdist_msi`. When a condition can't be worked out, the import is reported as before.
89
98
  Packages that build from source with no known problem are listed as such, with a note
90
- when they compile native code.
99
+ when they compile native code. When such a package has compiled wheels, just none for
100
+ the target (say, wheels up to `cp313` but not `cp315` or `cp314t`), it is reported as a
101
+ `no-wheel-for-python` warning, since the build is probably unexpected and needs a
102
+ compiler; the fix names the first newer release with a matching wheel.
103
+
104
+ ### New Python versions and free-threaded builds
105
+
106
+ Pass `--python 3.15` to check a new Python before its wheels are out, and
107
+ `--python 3.14t` (or `cp314t`) for the free-threaded build. Wheel matching follows the
108
+ interpreter: `abi3` wheels don't install on free-threaded 3.13t and 3.14t, and on 3.15t
109
+ only `abi3t` wheels ([PEP 803](https://peps.python.org/pep-0803/)) do.
110
+
111
+ Two checks read the C sources of packages that would be built:
112
+
113
+ - `c-api-removed` looks for calls to the functions listed under "Removed C APIs" in
114
+ What's New in Python 3.15. With GCC 14+ or Clang 16+ the build fails with an implicit
115
+ declaration error; older compilers build a module that fails on import. Calls are
116
+ skipped when they sit inside an `#if` on `PY_VERSION_HEX`, `PY_MINOR_VERSION`,
117
+ `Py_LIMITED_API`, `PYPY_VERSION` or a Cython switch (or a macro defined from one of
118
+ those), when the package defines the name itself (a compat header), and under
119
+ `tests/`, `docs/` and `examples/`. Comments and strings are ignored.
120
+ - `free-threading-limited-api` flags builds that turn on the limited API for 3.13t or
121
+ 3.14t. CPython 3.13 and 3.14 stop the compile with `#error "The limited API is not
122
+ currently supported in the free-threaded build"`, and setuptools refuses
123
+ `py_limited_api` there. Settings behind a `Py_GIL_DISABLED` check are not reported.
124
+
125
+ For example, `pygame==2.6.1` on 3.15 (it calls `PyWeakref_GetObject` in
126
+ `src_c/surface.c`) and `pycryptodome==3.19.0` on 3.14t (`py-limited-api = cp35` in
127
+ `setup.cfg`); `--verify` confirms both.
91
128
 
92
129
  ### Git, path and URL dependencies
93
130
 
@@ -197,6 +234,13 @@ Each finding gets one of these results:
197
234
  | `refuted` | The build succeeded. The finding no longer counts toward `--fail-on`. |
198
235
  | `timeout` | No result within `--verify-timeout` seconds (default 900). |
199
236
  | `skipped` | uv isn't installed, the target platform isn't this machine (the detail names both), or uv couldn't create an environment for the target Python. |
237
+ | `builds` | For `no-wheel-for-python`: the sdist built on the target Python. It stays a warning, since the install still needs a compiler. |
238
+ | `fails` | For `no-wheel-for-python`: the source build failed; the first error it printed is shown, and the finding becomes an error. |
239
+
240
+ For example, msgpack 1.1.0 and numpy 1.26.4 build from source on 3.15 but fail on
241
+ free-threaded 3.14t (`unknown type name '__pyx_vectorcallfunc'` and `'PyObject' has no
242
+ member named 'ob_refcnt'`). "Builds" only means the build finished: a package with an
243
+ optional extension, such as PyYAML 6.0.1, may quietly install without it.
200
244
 
201
245
  Builds run one at a time, so `--verify` takes as long as the flagged builds do; large
202
246
  native packages can take minutes. uv may download the target Python if it isn't installed.
@@ -239,7 +283,8 @@ canibuild [check] LOCKFILE... [--python X.Y] [--platform P] [--format text|json]
239
283
  - `LOCKFILE`: one or more of `uv.lock`, `pylock.toml` (or `pylock.NAME.toml`), or a requirements file.
240
284
  Requirements files may include other files with `-r`. Unpinned requirements are checked
241
285
  at the newest release that matches and supports the target Python.
242
- - `--python`: the target Python, such as `3.12`. Defaults to the running interpreter, or
286
+ - `--python`: the target Python, such as `3.12`, `3.15`, or `3.14t` for a free-threaded
287
+ build. Defaults to the running interpreter, or
243
288
  to the oldest version a `uv.lock` or `pylock.toml` allows when the running one is outside
244
289
  its `requires-python`.
245
290
  - `--platform`: `linux-x86_64`, `linux-aarch64`, `musllinux-x86_64`, `musllinux-aarch64`,
@@ -262,7 +307,7 @@ or `$CANIBUILD_CACHE_DIR`).
262
307
 
263
308
  ```yaml
264
309
  - uses: actions/checkout@v4
265
- - uses: driftwright/canibuild@v0.3.0
310
+ - uses: driftwright/canibuild@v0.5.0
266
311
  with:
267
312
  lockfiles: uv.lock # default: every uv.lock, pylock*.toml, requirements*.txt
268
313
  python: "3.12" # default: as for --python below
@@ -285,7 +330,7 @@ when `platform` is the runner's own.
285
330
  ```yaml
286
331
  repos:
287
332
  - repo: https://github.com/driftwright/canibuild
288
- rev: v0.3.0
333
+ rev: v0.5.0
289
334
  hooks:
290
335
  - id: canibuild
291
336
  # args: [--python, "3.12"]
@@ -300,7 +345,9 @@ network access to PyPI.
300
345
  (Mercurial, Subversion, Bazaar) are listed as not checked. Private git repositories work
301
346
  only if `git` can reach them without a prompt.
302
347
  - The checks are static. A `setup.py` that fails for a reason not in the table above, or
303
- that needs a compiler or system library you don't have, isn't caught.
348
+ that needs a compiler or system library you don't have, isn't caught. The C checks only
349
+ cover the removed 3.15 functions and the limited-API conflict; other free-threading
350
+ problems (thread safety, `Py_mod_gil`) and C files over 512 KiB are not inspected.
304
351
  - Requirements files are not resolved: only the packages they list are checked, not their
305
352
  dependencies. Use a lockfile (`uv.lock`, `pylock.toml`, or `pip-compile` output) for the
306
353
  full tree.
@@ -15,7 +15,7 @@ inputs:
15
15
  description: Directory the lockfile paths are relative to.
16
16
  default: "."
17
17
  python:
18
- description: Target Python version (X.Y). Defaults to the oldest version the lockfile allows.
18
+ description: Target Python version, such as 3.13 or 3.14t (free-threaded). Defaults to the oldest version the lockfile allows.
19
19
  default: ""
20
20
  platform:
21
21
  description: Target platform, e.g. linux-x86_64, macos-arm64, windows-amd64. Defaults to the runner.
@@ -116,3 +116,62 @@ reference:
116
116
  `flash-attn` 2.8.3.post2 (OmniNWM) with `torch` added to its build through
117
117
  `extra-build-dependencies` gets past the missing import and then fails on
118
118
  `CUDA_HOME environment variable is not set`, which `--verify` now reports.
119
+
120
+ ## Python 3.15 and free-threaded 3.14t
121
+
122
+ Run on 2026-12-05 with the 0.4.0 code, with uv-managed CPython 3.15.2 and
123
+ 3.14.10+freethreaded, GCC 14, on linux-x86_64.
124
+
125
+ The 13 lockfiles above, checked with `--python 3.15` and `--python 3.14t`:
126
+
127
+ | Target | `no-wheel-for-python` | `c-api-removed` | `free-threading-limited-api` |
128
+ | --- | --- | --- | --- |
129
+ | 3.15 | 55 pins (PyYAML 6.0.1, aiohttp 3.11.16, cffi 1.17.1, greenlet 3.3.1, numpy 1.26.4, pydantic-core 2.33.2, ...) | psycopg2-binary 2.9.9 (nvidia-chain-server) | n/a |
130
+ | 3.14t | 59 pins (the above plus bcrypt 5.0.0, hf-xet 1.2.0, regex 2024.11.6, ...) | n/a | none |
131
+
132
+ Real builds of the C findings, and of packages that look similar but are fine:
133
+
134
+ | Package | Target | canibuild | Real build |
135
+ | --- | --- | --- | --- |
136
+ | pygame 2.6.1 | 3.15 | `c-api-removed` (`PyWeakref_GetObject`, `src_c/surface.c`) | fails: `implicit declaration of function 'PyWeakref_GetObject'`, confirmed by `--verify` |
137
+ | psycopg2-binary 2.9.9 | 3.15 | `c-api-removed` (`psycopg/connection_int.c:1050`) | fails with the same error, confirmed |
138
+ | pycryptodome 3.19.0 | 3.14t | `free-threading-limited-api` (`py-limited-api = cp35` in `setup.cfg`) | fails: setuptools `` `Py_LIMITED_API` is incompatible with `Py_GIL_DISABLED` ``, confirmed |
139
+ | sentencepiece 0.2.0 | 3.15 | builds from source (SWIG code under `#ifdef SWIGPYTHON_BUILTIN`) | builds |
140
+ | psycopg2 2.9.13, pycurl 7.49.0, PyQt5-sip 12.20.1, msgpack 1.2.4 | 3.15 | builds from source (calls behind `PY_VERSION_HEX` checks) | build |
141
+ | psutil 7.2.2, pycryptodome 3.23.0, gssapi 1.12.0 | 3.14t | builds from source (limited API only when `Py_GIL_DISABLED` is unset) | not built; the settings are visibly conditional |
142
+
143
+ The sentencepiece run and a first version that also reported cffi 1.17.1 (a header it
144
+ ships for generated modules) and sip 6.17.3 (C templates in a pure-Python package) led
145
+ to the rules for optional `#ifdef` branches, included headers and pure-Python builds.
146
+ With those, 32 current releases of common C-extension packages, forced to build with
147
+ `--no-binary :all:`, produce no C findings on either target.
148
+
149
+ Not caught statically: other reasons a build fails on a new Python. numpy 1.26.4, for
150
+ example, is only reported as building from source; since 0.5.0, `--verify` builds it
151
+ and shows that it builds on 3.15 but fails on 3.14t (see below).
152
+
153
+ ## Command-only branches and source builds (0.5.0)
154
+
155
+ Run on 2026-12-05.
156
+
157
+ Skipping setup.py branches a build never takes removed pygame 2.6.1's false Cython and
158
+ msilib findings; `--verify` had shown both as "fails-differently". The 13 lockfiles
159
+ above give exactly the same findings at their ground-truth Python versions as with
160
+ 0.4.0, so none of the 10 known build failures is hidden. The setup.py files of 70
161
+ popular sdists (numpy, lxml, psycopg2, pycurl, gevent, Twisted, grpcio, ...) were
162
+ scanned for branches now treated as dead. Each one was checked by hand: commands such
163
+ as `clean`, `test`, `--help`, `manifest`, `bdist_msi` or `--legacy`, and file checks
164
+ that match the sdist (pycurl's generated `src/docstrings.c`, pymssql's missing
165
+ `_mssql.c`, pycryptodome's absent `.separate_namespace`). Only pygame, bitarray (`import
166
+ bitarray` for `test`) and pymssql had imports in those branches.
167
+
168
+ `--verify` on packages that only lack a wheel for the target:
169
+
170
+ | Package | 3.15 | 3.14t |
171
+ | --- | --- | --- |
172
+ | cffi 1.17.1 | builds | builds |
173
+ | greenlet 3.3.1 | builds | (has a cp314t wheel) |
174
+ | markupsafe 3.0.2 | builds | builds |
175
+ | msgpack 1.1.0 | builds | fails: `unknown type name '__pyx_vectorcallfunc'` |
176
+ | numpy 1.26.4 | builds | fails: `'PyObject' has no member named 'ob_refcnt'` |
177
+ | PyYAML 6.0.1 | builds (its C extension is optional) | builds |
@@ -0,0 +1,5 @@
1
+ # Used by the new-python job in .github/workflows/integrations.yml.
2
+ # Builds with the limited API, which free-threaded 3.13 and 3.14 reject.
3
+ pycryptodome==3.19.0
4
+ # Wheels up to cp313 only: its sdist builds on 3.15, but not on free-threaded 3.14t.
5
+ msgpack==1.1.0
@@ -1,3 +1,3 @@
1
1
  """Find the dependencies in a lockfile that will fail to build from source."""
2
2
 
3
- __version__ = "0.3.0"
3
+ __version__ = "0.5.0"