canibuild 0.2.0__tar.gz → 0.3.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.
- {canibuild-0.2.0 → canibuild-0.3.0}/.github/workflows/integrations.yml +48 -0
- {canibuild-0.2.0 → canibuild-0.3.0}/CHANGELOG.md +17 -0
- {canibuild-0.2.0 → canibuild-0.3.0}/PKG-INFO +56 -7
- {canibuild-0.2.0 → canibuild-0.3.0}/README.md +55 -6
- {canibuild-0.2.0 → canibuild-0.3.0}/action/run.sh +2 -0
- {canibuild-0.2.0 → canibuild-0.3.0}/action.yml +8 -0
- {canibuild-0.2.0 → canibuild-0.3.0}/docs/validation.md +22 -0
- canibuild-0.3.0/examples/git/requirements.txt +1 -0
- {canibuild-0.2.0 → canibuild-0.3.0}/src/canibuild/__init__.py +1 -1
- {canibuild-0.2.0 → canibuild-0.3.0}/src/canibuild/check.py +276 -17
- {canibuild-0.2.0 → canibuild-0.3.0}/src/canibuild/cli.py +78 -2
- {canibuild-0.2.0 → canibuild-0.3.0}/src/canibuild/fixes.py +9 -0
- {canibuild-0.2.0 → canibuild-0.3.0}/src/canibuild/lockfiles.py +348 -5
- canibuild-0.3.0/src/canibuild/model.py +235 -0
- {canibuild-0.2.0 → canibuild-0.3.0}/src/canibuild/pypi.py +4 -0
- {canibuild-0.2.0 → canibuild-0.3.0}/src/canibuild/report.py +10 -2
- {canibuild-0.2.0 → canibuild-0.3.0}/src/canibuild/sdist.py +104 -30
- canibuild-0.3.0/src/canibuild/sources.py +254 -0
- {canibuild-0.2.0 → canibuild-0.3.0}/src/canibuild/verify.py +92 -32
- canibuild-0.3.0/tests/fixtures/uv-direct-sources.pyproject.toml +12 -0
- canibuild-0.3.0/tests/fixtures/uv-direct-sources.uv.lock +54 -0
- {canibuild-0.2.0 → canibuild-0.3.0}/tests/test_check.py +350 -9
- {canibuild-0.2.0 → canibuild-0.3.0}/tests/test_cli.py +67 -1
- {canibuild-0.2.0 → canibuild-0.3.0}/tests/test_fixes.py +24 -0
- {canibuild-0.2.0 → canibuild-0.3.0}/tests/test_lockfiles.py +195 -2
- canibuild-0.3.0/tests/test_model.py +84 -0
- {canibuild-0.2.0 → canibuild-0.3.0}/tests/test_report.py +60 -4
- {canibuild-0.2.0 → canibuild-0.3.0}/tests/test_sdist.py +31 -1
- canibuild-0.3.0/tests/test_sources.py +96 -0
- {canibuild-0.2.0 → canibuild-0.3.0}/tests/test_verify.py +77 -1
- canibuild-0.2.0/src/canibuild/model.py +0 -118
- {canibuild-0.2.0 → canibuild-0.3.0}/.github/workflows/tests.yml +0 -0
- {canibuild-0.2.0 → canibuild-0.3.0}/.gitignore +0 -0
- {canibuild-0.2.0 → canibuild-0.3.0}/.pre-commit-hooks.yaml +0 -0
- {canibuild-0.2.0 → canibuild-0.3.0}/LICENSE +0 -0
- {canibuild-0.2.0 → canibuild-0.3.0}/examples/broken/requirements.txt +0 -0
- {canibuild-0.2.0 → canibuild-0.3.0}/examples/clean/pyproject.toml +0 -0
- {canibuild-0.2.0 → canibuild-0.3.0}/examples/clean/uv.lock +0 -0
- {canibuild-0.2.0 → canibuild-0.3.0}/pyproject.toml +0 -0
- {canibuild-0.2.0 → canibuild-0.3.0}/src/canibuild/__main__.py +0 -0
- {canibuild-0.2.0 → canibuild-0.3.0}/src/canibuild/py.typed +0 -0
- {canibuild-0.2.0 → canibuild-0.3.0}/src/canibuild/rules.py +0 -0
- {canibuild-0.2.0 → canibuild-0.3.0}/src/canibuild/target.py +0 -0
- {canibuild-0.2.0 → canibuild-0.3.0}/tests/conftest.py +0 -0
- {canibuild-0.2.0 → canibuild-0.3.0}/tests/fixtures/base.txt +0 -0
- {canibuild-0.2.0 → canibuild-0.3.0}/tests/fixtures/pylock.toml +0 -0
- {canibuild-0.2.0 → canibuild-0.3.0}/tests/fixtures/requirements.txt +0 -0
- {canibuild-0.2.0 → canibuild-0.3.0}/tests/fixtures/uv.lock +0 -0
- {canibuild-0.2.0 → canibuild-0.3.0}/tests/test_pypi.py +0 -0
- {canibuild-0.2.0 → canibuild-0.3.0}/tests/test_rules.py +0 -0
- {canibuild-0.2.0 → canibuild-0.3.0}/tests/test_target.py +0 -0
|
@@ -49,6 +49,54 @@ jobs:
|
|
|
49
49
|
assert flatdict["verification"]["fix_builds"] is True, flatdict
|
|
50
50
|
PY
|
|
51
51
|
|
|
52
|
+
- name: no-build turns the missing wheel into a failure
|
|
53
|
+
id: nobuild
|
|
54
|
+
continue-on-error: true
|
|
55
|
+
uses: ./
|
|
56
|
+
with:
|
|
57
|
+
lockfiles: examples/broken/requirements.txt
|
|
58
|
+
python: "3.12"
|
|
59
|
+
no-build: ":all:"
|
|
60
|
+
|
|
61
|
+
- name: Check the no-build run reported the no-build rule
|
|
62
|
+
shell: bash
|
|
63
|
+
env:
|
|
64
|
+
OUTCOME: ${{ steps.nobuild.outcome }}
|
|
65
|
+
REPORT: ${{ steps.nobuild.outputs.report }}
|
|
66
|
+
run: |
|
|
67
|
+
test "$OUTCOME" = failure
|
|
68
|
+
python3 - "$REPORT" <<'PY'
|
|
69
|
+
import json, sys
|
|
70
|
+
reports = json.load(open(sys.argv[1]))
|
|
71
|
+
rules = {f["rule"] for r in reports for f in r["findings"]}
|
|
72
|
+
assert rules == {"no-build"}, rules
|
|
73
|
+
PY
|
|
74
|
+
|
|
75
|
+
- name: Git dependency is fetched, checked and built
|
|
76
|
+
id: git
|
|
77
|
+
continue-on-error: true
|
|
78
|
+
uses: ./
|
|
79
|
+
with:
|
|
80
|
+
lockfiles: examples/git/requirements.txt
|
|
81
|
+
python: "3.12"
|
|
82
|
+
verify: "true"
|
|
83
|
+
|
|
84
|
+
- name: Check the git dependency was confirmed by a real build
|
|
85
|
+
shell: bash
|
|
86
|
+
env:
|
|
87
|
+
OUTCOME: ${{ steps.git.outcome }}
|
|
88
|
+
REPORT: ${{ steps.git.outputs.report }}
|
|
89
|
+
run: |
|
|
90
|
+
test "$OUTCOME" = failure
|
|
91
|
+
python3 - "$REPORT" <<'PY'
|
|
92
|
+
import json, sys
|
|
93
|
+
[finding] = [f for r in json.load(open(sys.argv[1])) for f in r["findings"]]
|
|
94
|
+
assert finding["rule"] == "pkg-resources", finding
|
|
95
|
+
assert finding["source"].startswith("flatdict @ git+https://github.com/gmr/flatdict@"), finding
|
|
96
|
+
assert finding["verification"]["status"] == "confirmed", finding
|
|
97
|
+
assert finding["verification"]["fix_builds"] is True, finding
|
|
98
|
+
PY
|
|
99
|
+
|
|
52
100
|
- name: Lockfiles found automatically
|
|
53
101
|
uses: ./
|
|
54
102
|
with:
|
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.0 (2026-12-05)
|
|
4
|
+
|
|
5
|
+
- Git, path and URL dependencies are now checked instead of listed as not checked.
|
|
6
|
+
Git sources are fetched at the locked commit (shallow, hooks disabled, no submodules)
|
|
7
|
+
and cached by commit; local directories and archives are read in place; URL sdists are
|
|
8
|
+
downloaded and wheel URLs are matched against the target. Package code is never run.
|
|
9
|
+
Findings say where the code came from, and `--verify` builds them from the same
|
|
10
|
+
reference.
|
|
11
|
+
- no-binary and no-build settings are honoured: from `[tool.uv]`, `[tool.uv.pip]`,
|
|
12
|
+
`uv.toml`, requirements-file `--no-binary` / `--only-binary` lines, and the new
|
|
13
|
+
`--no-binary` / `--no-build` options. A package that needs a build while builds are
|
|
14
|
+
forbidden is reported with the new `no-build` rule. The report shows the settings in
|
|
15
|
+
effect. The GitHub Action has matching `no-binary` and `no-build` inputs.
|
|
16
|
+
- `--verify` retries a confirmed missing build requirement with it added through uv's
|
|
17
|
+
`extra-build-dependencies`, and shows the next error when the build still fails.
|
|
18
|
+
- `--verify` explains why it skipped a foreign target platform.
|
|
19
|
+
|
|
3
20
|
## 0.2.0 (2026-12-05)
|
|
4
21
|
|
|
5
22
|
- `--verify` builds each flagged sdist in a throwaway uv environment and reports, per
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: canibuild
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.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
|
|
@@ -121,6 +121,47 @@ is reported as a warning, since it fails only if that code runs during the build
|
|
|
121
121
|
Packages that build from source with no known problem are listed as such, with a note
|
|
122
122
|
when they compile native code.
|
|
123
123
|
|
|
124
|
+
### Git, path and URL dependencies
|
|
125
|
+
|
|
126
|
+
Dependencies that installers fetch directly are always built from source, so canibuild
|
|
127
|
+
checks them with the same rules:
|
|
128
|
+
|
|
129
|
+
- **git** (`source = { git = ... }` in `uv.lock`, `vcs` in `pylock.toml`,
|
|
130
|
+
`name @ git+https://...@rev` or `-e git+...` in requirements): fetched with
|
|
131
|
+
`git fetch --depth 1` at the locked commit (or the branch or tag the requirement names),
|
|
132
|
+
with hooks disabled and no submodules, then read like an sdist. Checkouts of a pinned
|
|
133
|
+
commit are cached. When the requirement names a branch or tag, or nothing, the report
|
|
134
|
+
says which commit was checked.
|
|
135
|
+
- **path** (`directory`, `path` and non-root `editable` sources, `./dir`, `file:` URLs):
|
|
136
|
+
the local directory or archive is read in place, relative to the lockfile.
|
|
137
|
+
- **URL** (`source = { url = ... }`, `archive` in `pylock.toml`, `name @ https://...`):
|
|
138
|
+
sdists are downloaded and read; a wheel URL is only checked against the target's tags.
|
|
139
|
+
|
|
140
|
+
Findings for these show where the code came from, and `--verify` builds them from the same
|
|
141
|
+
reference (`name @ git+URL@commit`), so a git build needs access to that git host.
|
|
142
|
+
|
|
143
|
+
### Forcing or forbidding source builds
|
|
144
|
+
|
|
145
|
+
Some projects build certain packages from source on purpose, or forbid source builds
|
|
146
|
+
entirely. canibuild reads those settings and checks accordingly:
|
|
147
|
+
|
|
148
|
+
| Setting | Where canibuild reads it | Effect |
|
|
149
|
+
| --- | --- | --- |
|
|
150
|
+
| no-binary | `[tool.uv]` `no-binary = true` / `no-binary-package = [...]` (pyproject.toml or uv.toml next to `uv.lock`); `[tool.uv.pip]` `no-binary = [...]`; `--no-binary` lines in requirements files; `--no-binary PKGS` on the command line | Wheels are ignored for those packages, so their sdists are inspected even when a wheel exists. |
|
|
151
|
+
| no-build | `[tool.uv]` `no-build` / `no-build-package`; `[tool.uv.pip]` `no-build` and `only-binary`; `--only-binary` lines in requirements files; `--no-build PKGS` on the command line | A package with no matching wheel is an error (`no-build`), with the first newer release that has a wheel as the fix. |
|
|
152
|
+
|
|
153
|
+
`PKGS` is a comma-separated list of names or `:all:`; requirements files also accept
|
|
154
|
+
`:none:`, and later lines override earlier ones as in pip. A package named explicitly in
|
|
155
|
+
one setting beats `:all:` in the other. The report shows the settings in effect and where
|
|
156
|
+
they came from:
|
|
157
|
+
|
|
158
|
+
```console
|
|
159
|
+
$ canibuild examples/broken/requirements.txt --python 3.12 --no-build :all:
|
|
160
|
+
canibuild: examples/broken/requirements.txt for CPython 3.12 on linux-x86_64
|
|
161
|
+
2 packages checked, 0 build from source, 1 will fail, 0 may fail
|
|
162
|
+
build settings: no-build: :all: (from --no-build)
|
|
163
|
+
```
|
|
164
|
+
|
|
124
165
|
The setuptools version a build would get is worked out from the sdist's own
|
|
125
166
|
`build-system.requires` (or pip's and uv's default of `setuptools>=40.8.0` when it has
|
|
126
167
|
none) and the setuptools releases on PyPI, so a package that already caps
|
|
@@ -155,7 +196,9 @@ error or warning, it builds that sdist in a throwaway environment with uv
|
|
|
155
196
|
(`uv pip install --no-deps --no-binary PKG`, from PyPI only, isolated from your uv config),
|
|
156
197
|
and records whether the build really fails the way canibuild said. When the finding has a
|
|
157
198
|
build constraint such as `setuptools<82`, it builds once more with that constraint to show
|
|
158
|
-
whether the fix works.
|
|
199
|
+
whether the fix works. For a missing build requirement such as `torch`, it builds once more
|
|
200
|
+
with the requirement added through uv's `extra-build-dependencies`, and shows the next error
|
|
201
|
+
if the build still fails (for `flash-attn` that is `CUDA_HOME` not being set).
|
|
159
202
|
|
|
160
203
|
```console
|
|
161
204
|
$ canibuild examples/broken/requirements.txt --python 3.12 --verify --tool uv-pip
|
|
@@ -185,7 +228,7 @@ Each finding gets one of these results:
|
|
|
185
228
|
| `fails-differently` | The build failed, but not with that error. The last error line is shown. |
|
|
186
229
|
| `refuted` | The build succeeded. The finding no longer counts toward `--fail-on`. |
|
|
187
230
|
| `timeout` | No result within `--verify-timeout` seconds (default 900). |
|
|
188
|
-
| `skipped` | uv isn't installed, the target platform isn't this machine, or uv couldn't create an environment for the target Python. |
|
|
231
|
+
| `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. |
|
|
189
232
|
|
|
190
233
|
Builds run one at a time, so `--verify` takes as long as the flagged builds do; large
|
|
191
234
|
native packages can take minutes. uv may download the target Python if it isn't installed.
|
|
@@ -220,6 +263,7 @@ The lockfiles, their commits and the per-package results are in
|
|
|
220
263
|
```
|
|
221
264
|
canibuild [check] LOCKFILE... [--python X.Y] [--platform P] [--format text|json]
|
|
222
265
|
[--fail-on error|warning|never] [--tool TOOL] [--jobs N]
|
|
266
|
+
[--no-binary PKGS] [--no-build PKGS]
|
|
223
267
|
[--verify] [--verify-timeout SECONDS] [--json-report PATH]
|
|
224
268
|
[--cache-dir DIR] [--no-cache] [-v]
|
|
225
269
|
```
|
|
@@ -236,6 +280,8 @@ canibuild [check] LOCKFILE... [--python X.Y] [--platform P] [--format text|json]
|
|
|
236
280
|
- `--format json`: machine-readable output with every finding and fix (a list when you
|
|
237
281
|
pass several lockfiles).
|
|
238
282
|
- `--json-report PATH`: also write the JSON report, always as a list, while printing text.
|
|
283
|
+
- `--no-binary`, `--no-build`: force or forbid source builds (see above); added to the
|
|
284
|
+
settings found in the project's files.
|
|
239
285
|
- `--verify`, `--verify-timeout`: build flagged sdists to confirm the findings (see above).
|
|
240
286
|
- `--fail-on`: exit with 1 on errors (the default), on warnings too, or never.
|
|
241
287
|
With several lockfiles, the run fails if any of them does. Usage errors and unreadable
|
|
@@ -248,13 +294,15 @@ or `$CANIBUILD_CACHE_DIR`).
|
|
|
248
294
|
|
|
249
295
|
```yaml
|
|
250
296
|
- uses: actions/checkout@v4
|
|
251
|
-
- uses: driftwright/canibuild@v0.
|
|
297
|
+
- uses: driftwright/canibuild@v0.3.0
|
|
252
298
|
with:
|
|
253
299
|
lockfiles: uv.lock # default: every uv.lock, pylock*.toml, requirements*.txt
|
|
254
300
|
python: "3.12" # default: as for --python below
|
|
255
301
|
# platform: linux-x86_64 # default: the runner
|
|
256
302
|
# fail-on: error # error, warning or never
|
|
257
303
|
# tool: uv # tools to show fixes for
|
|
304
|
+
# no-binary: ":all:" # build these from source even when a wheel exists
|
|
305
|
+
# no-build: numpy # these must install from a wheel
|
|
258
306
|
# verify: "true" # build flagged sdists to confirm the findings
|
|
259
307
|
```
|
|
260
308
|
|
|
@@ -269,7 +317,7 @@ when `platform` is the runner's own.
|
|
|
269
317
|
```yaml
|
|
270
318
|
repos:
|
|
271
319
|
- repo: https://github.com/driftwright/canibuild
|
|
272
|
-
rev: v0.
|
|
320
|
+
rev: v0.3.0
|
|
273
321
|
hooks:
|
|
274
322
|
- id: canibuild
|
|
275
323
|
# args: [--python, "3.12"]
|
|
@@ -280,8 +328,9 @@ network access to PyPI.
|
|
|
280
328
|
|
|
281
329
|
## Limits
|
|
282
330
|
|
|
283
|
-
-
|
|
284
|
-
|
|
331
|
+
- Versions from other indexes (such as `torch==2.1.2+cu121`) and non-git version control
|
|
332
|
+
(Mercurial, Subversion, Bazaar) are listed as not checked. Private git repositories work
|
|
333
|
+
only if `git` can reach them without a prompt.
|
|
285
334
|
- The checks are static. A `setup.py` that fails for a reason not in the table above, or
|
|
286
335
|
that needs a compiler or system library you don't have, isn't caught.
|
|
287
336
|
- Requirements files are not resolved: only the packages they list are checked, not their
|
|
@@ -89,6 +89,47 @@ is reported as a warning, since it fails only if that code runs during the build
|
|
|
89
89
|
Packages that build from source with no known problem are listed as such, with a note
|
|
90
90
|
when they compile native code.
|
|
91
91
|
|
|
92
|
+
### Git, path and URL dependencies
|
|
93
|
+
|
|
94
|
+
Dependencies that installers fetch directly are always built from source, so canibuild
|
|
95
|
+
checks them with the same rules:
|
|
96
|
+
|
|
97
|
+
- **git** (`source = { git = ... }` in `uv.lock`, `vcs` in `pylock.toml`,
|
|
98
|
+
`name @ git+https://...@rev` or `-e git+...` in requirements): fetched with
|
|
99
|
+
`git fetch --depth 1` at the locked commit (or the branch or tag the requirement names),
|
|
100
|
+
with hooks disabled and no submodules, then read like an sdist. Checkouts of a pinned
|
|
101
|
+
commit are cached. When the requirement names a branch or tag, or nothing, the report
|
|
102
|
+
says which commit was checked.
|
|
103
|
+
- **path** (`directory`, `path` and non-root `editable` sources, `./dir`, `file:` URLs):
|
|
104
|
+
the local directory or archive is read in place, relative to the lockfile.
|
|
105
|
+
- **URL** (`source = { url = ... }`, `archive` in `pylock.toml`, `name @ https://...`):
|
|
106
|
+
sdists are downloaded and read; a wheel URL is only checked against the target's tags.
|
|
107
|
+
|
|
108
|
+
Findings for these show where the code came from, and `--verify` builds them from the same
|
|
109
|
+
reference (`name @ git+URL@commit`), so a git build needs access to that git host.
|
|
110
|
+
|
|
111
|
+
### Forcing or forbidding source builds
|
|
112
|
+
|
|
113
|
+
Some projects build certain packages from source on purpose, or forbid source builds
|
|
114
|
+
entirely. canibuild reads those settings and checks accordingly:
|
|
115
|
+
|
|
116
|
+
| Setting | Where canibuild reads it | Effect |
|
|
117
|
+
| --- | --- | --- |
|
|
118
|
+
| no-binary | `[tool.uv]` `no-binary = true` / `no-binary-package = [...]` (pyproject.toml or uv.toml next to `uv.lock`); `[tool.uv.pip]` `no-binary = [...]`; `--no-binary` lines in requirements files; `--no-binary PKGS` on the command line | Wheels are ignored for those packages, so their sdists are inspected even when a wheel exists. |
|
|
119
|
+
| no-build | `[tool.uv]` `no-build` / `no-build-package`; `[tool.uv.pip]` `no-build` and `only-binary`; `--only-binary` lines in requirements files; `--no-build PKGS` on the command line | A package with no matching wheel is an error (`no-build`), with the first newer release that has a wheel as the fix. |
|
|
120
|
+
|
|
121
|
+
`PKGS` is a comma-separated list of names or `:all:`; requirements files also accept
|
|
122
|
+
`:none:`, and later lines override earlier ones as in pip. A package named explicitly in
|
|
123
|
+
one setting beats `:all:` in the other. The report shows the settings in effect and where
|
|
124
|
+
they came from:
|
|
125
|
+
|
|
126
|
+
```console
|
|
127
|
+
$ canibuild examples/broken/requirements.txt --python 3.12 --no-build :all:
|
|
128
|
+
canibuild: examples/broken/requirements.txt for CPython 3.12 on linux-x86_64
|
|
129
|
+
2 packages checked, 0 build from source, 1 will fail, 0 may fail
|
|
130
|
+
build settings: no-build: :all: (from --no-build)
|
|
131
|
+
```
|
|
132
|
+
|
|
92
133
|
The setuptools version a build would get is worked out from the sdist's own
|
|
93
134
|
`build-system.requires` (or pip's and uv's default of `setuptools>=40.8.0` when it has
|
|
94
135
|
none) and the setuptools releases on PyPI, so a package that already caps
|
|
@@ -123,7 +164,9 @@ error or warning, it builds that sdist in a throwaway environment with uv
|
|
|
123
164
|
(`uv pip install --no-deps --no-binary PKG`, from PyPI only, isolated from your uv config),
|
|
124
165
|
and records whether the build really fails the way canibuild said. When the finding has a
|
|
125
166
|
build constraint such as `setuptools<82`, it builds once more with that constraint to show
|
|
126
|
-
whether the fix works.
|
|
167
|
+
whether the fix works. For a missing build requirement such as `torch`, it builds once more
|
|
168
|
+
with the requirement added through uv's `extra-build-dependencies`, and shows the next error
|
|
169
|
+
if the build still fails (for `flash-attn` that is `CUDA_HOME` not being set).
|
|
127
170
|
|
|
128
171
|
```console
|
|
129
172
|
$ canibuild examples/broken/requirements.txt --python 3.12 --verify --tool uv-pip
|
|
@@ -153,7 +196,7 @@ Each finding gets one of these results:
|
|
|
153
196
|
| `fails-differently` | The build failed, but not with that error. The last error line is shown. |
|
|
154
197
|
| `refuted` | The build succeeded. The finding no longer counts toward `--fail-on`. |
|
|
155
198
|
| `timeout` | No result within `--verify-timeout` seconds (default 900). |
|
|
156
|
-
| `skipped` | uv isn't installed, the target platform isn't this machine, or uv couldn't create an environment for the target Python. |
|
|
199
|
+
| `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. |
|
|
157
200
|
|
|
158
201
|
Builds run one at a time, so `--verify` takes as long as the flagged builds do; large
|
|
159
202
|
native packages can take minutes. uv may download the target Python if it isn't installed.
|
|
@@ -188,6 +231,7 @@ The lockfiles, their commits and the per-package results are in
|
|
|
188
231
|
```
|
|
189
232
|
canibuild [check] LOCKFILE... [--python X.Y] [--platform P] [--format text|json]
|
|
190
233
|
[--fail-on error|warning|never] [--tool TOOL] [--jobs N]
|
|
234
|
+
[--no-binary PKGS] [--no-build PKGS]
|
|
191
235
|
[--verify] [--verify-timeout SECONDS] [--json-report PATH]
|
|
192
236
|
[--cache-dir DIR] [--no-cache] [-v]
|
|
193
237
|
```
|
|
@@ -204,6 +248,8 @@ canibuild [check] LOCKFILE... [--python X.Y] [--platform P] [--format text|json]
|
|
|
204
248
|
- `--format json`: machine-readable output with every finding and fix (a list when you
|
|
205
249
|
pass several lockfiles).
|
|
206
250
|
- `--json-report PATH`: also write the JSON report, always as a list, while printing text.
|
|
251
|
+
- `--no-binary`, `--no-build`: force or forbid source builds (see above); added to the
|
|
252
|
+
settings found in the project's files.
|
|
207
253
|
- `--verify`, `--verify-timeout`: build flagged sdists to confirm the findings (see above).
|
|
208
254
|
- `--fail-on`: exit with 1 on errors (the default), on warnings too, or never.
|
|
209
255
|
With several lockfiles, the run fails if any of them does. Usage errors and unreadable
|
|
@@ -216,13 +262,15 @@ or `$CANIBUILD_CACHE_DIR`).
|
|
|
216
262
|
|
|
217
263
|
```yaml
|
|
218
264
|
- uses: actions/checkout@v4
|
|
219
|
-
- uses: driftwright/canibuild@v0.
|
|
265
|
+
- uses: driftwright/canibuild@v0.3.0
|
|
220
266
|
with:
|
|
221
267
|
lockfiles: uv.lock # default: every uv.lock, pylock*.toml, requirements*.txt
|
|
222
268
|
python: "3.12" # default: as for --python below
|
|
223
269
|
# platform: linux-x86_64 # default: the runner
|
|
224
270
|
# fail-on: error # error, warning or never
|
|
225
271
|
# tool: uv # tools to show fixes for
|
|
272
|
+
# no-binary: ":all:" # build these from source even when a wheel exists
|
|
273
|
+
# no-build: numpy # these must install from a wheel
|
|
226
274
|
# verify: "true" # build flagged sdists to confirm the findings
|
|
227
275
|
```
|
|
228
276
|
|
|
@@ -237,7 +285,7 @@ when `platform` is the runner's own.
|
|
|
237
285
|
```yaml
|
|
238
286
|
repos:
|
|
239
287
|
- repo: https://github.com/driftwright/canibuild
|
|
240
|
-
rev: v0.
|
|
288
|
+
rev: v0.3.0
|
|
241
289
|
hooks:
|
|
242
290
|
- id: canibuild
|
|
243
291
|
# args: [--python, "3.12"]
|
|
@@ -248,8 +296,9 @@ network access to PyPI.
|
|
|
248
296
|
|
|
249
297
|
## Limits
|
|
250
298
|
|
|
251
|
-
-
|
|
252
|
-
|
|
299
|
+
- Versions from other indexes (such as `torch==2.1.2+cu121`) and non-git version control
|
|
300
|
+
(Mercurial, Subversion, Bazaar) are listed as not checked. Private git repositories work
|
|
301
|
+
only if `git` can reach them without a prompt.
|
|
253
302
|
- The checks are static. A `setup.py` that fails for a reason not in the table above, or
|
|
254
303
|
that needs a compiler or system library you don't have, isn't caught.
|
|
255
304
|
- Requirements files are not resolved: only the packages they list are checked, not their
|
|
@@ -27,6 +27,8 @@ args=(--fail-on "$CANIBUILD_FAIL_ON")
|
|
|
27
27
|
[[ -n "$CANIBUILD_PLATFORM" ]] && args+=(--platform "$CANIBUILD_PLATFORM")
|
|
28
28
|
for tool in $CANIBUILD_TOOL; do args+=(--tool "$tool"); done
|
|
29
29
|
[[ "$CANIBUILD_VERIFY" == "true" ]] && args+=(--verify)
|
|
30
|
+
[[ -n "${CANIBUILD_NO_BINARY:-}" ]] && args+=(--no-binary "$CANIBUILD_NO_BINARY")
|
|
31
|
+
[[ -n "${CANIBUILD_NO_BUILD:-}" ]] && args+=(--no-build "$CANIBUILD_NO_BUILD")
|
|
30
32
|
|
|
31
33
|
report="${RUNNER_TEMP:-/tmp}/canibuild-report.json"
|
|
32
34
|
text="${RUNNER_TEMP:-/tmp}/canibuild-report.txt"
|
|
@@ -26,6 +26,12 @@ inputs:
|
|
|
26
26
|
tool:
|
|
27
27
|
description: "Tools to write fixes for, separated by spaces: uv, uv-pip, pip, poetry or all."
|
|
28
28
|
default: ""
|
|
29
|
+
no-binary:
|
|
30
|
+
description: "Packages to build from source even when a wheel exists (comma-separated, or :all:)."
|
|
31
|
+
default: ""
|
|
32
|
+
no-build:
|
|
33
|
+
description: "Packages that must install from a wheel (comma-separated, or :all:)."
|
|
34
|
+
default: ""
|
|
29
35
|
verify:
|
|
30
36
|
description: Build each flagged sdist in a throwaway environment to confirm the prediction.
|
|
31
37
|
default: "false"
|
|
@@ -55,6 +61,8 @@ runs:
|
|
|
55
61
|
CANIBUILD_FAIL_ON: ${{ inputs.fail-on }}
|
|
56
62
|
CANIBUILD_TOOL: ${{ inputs.tool }}
|
|
57
63
|
CANIBUILD_VERIFY: ${{ inputs.verify }}
|
|
64
|
+
CANIBUILD_NO_BINARY: ${{ inputs.no-binary }}
|
|
65
|
+
CANIBUILD_NO_BUILD: ${{ inputs.no-build }}
|
|
58
66
|
CANIBUILD_VERSION: ${{ inputs.version }}
|
|
59
67
|
CANIBUILD_ACTION_PATH: ${{ github.action_path }}
|
|
60
68
|
run: "$CANIBUILD_ACTION_PATH/action/run.sh"
|
|
@@ -94,3 +94,25 @@ Run on 2026-12-05 with canibuild 0.2.0 and uv 0.13.10, same lockfiles and target
|
|
|
94
94
|
| pcse-notebooks | salib 1.3.12 | confirmed: `No module named 'pkg_resources'` | builds |
|
|
95
95
|
| wenet | openai-whisper 20231117 | confirmed: `No module named 'pkg_resources'` | builds |
|
|
96
96
|
| whisper-s2t | openai-whisper 20231117 | confirmed: `No module named 'pkg_resources'` | builds |
|
|
97
|
+
|
|
98
|
+
## Git, path and URL dependencies
|
|
99
|
+
|
|
100
|
+
Run on 2026-12-05 with canibuild 0.3.0. Every direct dependency in the lockfiles above,
|
|
101
|
+
plus a uv project that locks `flatdict` from git, `jproperties` from an sdist URL and a
|
|
102
|
+
local directory, was checked and then built with `uv pip install --no-deps` from the same
|
|
103
|
+
reference:
|
|
104
|
+
|
|
105
|
+
| Lockfile | Dependency | Real build | canibuild |
|
|
106
|
+
| --- | --- | --- | --- |
|
|
107
|
+
| Whisper-WebUI | `git+https://github.com/jhj0517/jhj0517-whisper.git` (unpinned, checked at `197244318d5d`) | fails: `No module named 'pkg_resources'` | error `pkg-resources` |
|
|
108
|
+
| Whisper-WebUI | `git+https://github.com/jhj0517/ultimatevocalremover_api.git` | builds | builds from source |
|
|
109
|
+
| Whisper-WebUI | `git+https://github.com/jhj0517/pyrubberband.git` | builds | builds from source |
|
|
110
|
+
| mcp-bible | mcp-weather, git `cdcae1b61322` | builds | builds from source |
|
|
111
|
+
| moshi-finetune | moshi, git `061cc4c630d9`, subdirectory `moshi` | builds | builds from source |
|
|
112
|
+
| uv sample | flatdict 4.0.1, git `f86186671944` | fails: `pkg_resources` | error `pkg-resources`, confirmed by `--verify`; builds with `setuptools<82` |
|
|
113
|
+
| uv sample | jproperties 2.1.1, sdist URL | fails: `pkg_resources` (via setuptools-scm 3.5) | error `build-tool-needs-pkg-resources`, confirmed; builds with `setuptools<82` |
|
|
114
|
+
| uv sample | localpkg, local directory | builds | builds from source |
|
|
115
|
+
|
|
116
|
+
`flash-attn` 2.8.3.post2 (OmniNWM) with `torch` added to its build through
|
|
117
|
+
`extra-build-dependencies` gets past the missing import and then fails on
|
|
118
|
+
`CUDA_HOME environment variable is not set`, which `--verify` now reports.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
flatdict @ git+https://github.com/gmr/flatdict@f86186671944e39ae194b49c5f444d69ffa37424
|