feat(build): match local Python version by default#351
Conversation
flash build/deploy now resolve the app Python version from the local interpreter (sys.version_info) when no --python-version override and no per-resource python_version is declared, instead of a hardcoded 3.12 fallback. An unsupported local interpreter raises an actionable error. The build prints the resolved version and its source. Extracted from #330 (which is stale/corrupted and built on the reverted #346); the 'add 3.13' half of #330 already landed on main, so only the match-local behavior is carried here. - manifest.py: _reconcile_python_version falls back to local interpreter - build.py: _python_version_source() + build-time 'targeting Python X' line - docs: flash-build/flash-deploy/deploy-guide describe parity-by-default - tests: local-match, unsupported-local, override/declaration precedence
|
Capy auto-review is paused for this organization because the usage-cycle auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews. |
|
Promptless prepared a documentation update related to this change. Triggered by PR #351 (feat(build): match local Python version by default) This PR's other user-facing behavior (local-interpreter default, Note: since PR #351 is still open, the exact output strings may still shift before merge. Review: Document flash build resolved Python version provenance output |
What
Makes
flash build/flash deployresolve the app Python version from the local interpreter (sys.version_info) when no--python-versionoverride and no per-resourcepython_versionis declared — replacing the hardcoded3.12fallback. An unsupported local interpreter (e.g. 3.9, 3.14) raises an actionable error. The build prints the resolved version and its source (matched local interpreter/--python-version override/declared on resource X).Why
Supersedes #330. That branch was cut from the #346 merge (since reverted via #350) and its files were corrupted by a bad conflict resolution. The "add 3.13" half of #330 already landed on
mainindependently; the only genuinely-unmerged piece was this match-local behavior, extracted here cleanly against currentmain.Resolution order (unchanged except the fallback):
--python-versionoverride (validated; must match any per-resource declarations)python_versionDEFAULT_PYTHON_VERSION)Test plan
manifest.py::_reconcile_python_version: newTestReconcileLocalInterpreter— parametrized local-match (3.10–3.13), unsupported-local raises with actionable message, override/declaration are not shadowed by local.monkeypatchofsys.version_info) or an explicit override.build.py::_python_version_source: unit tests for override / declared / local-match provenance strings.make quality-checkgreen (2580 passed; the 2TestVersionFlagfailures are pre-existing onmain— ANSI-color assertion sensitivity, unrelated to this change).Closes the useful part of #330.