You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(build): match local Python version by default
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
Copy file name to clipboardExpand all lines: docs/Flash_Deploy_Guide.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,10 +12,10 @@ This guide walks through deploying a Flash application from local development to
12
12
13
13
### Python version selection
14
14
15
-
Flash apps ship as a single tarball, so every resource in an app shares one Python version. The worker runtime defaults to 3.12 (the version torch is pre-installed for in the GPU base image). Select a different version in two ways:
15
+
Flash apps ship as a single tarball, so every resource in an app shares one Python version. By default, `flash build` and `flash deploy` target the Python version you're running flash from — if you're on 3.11 locally, your deploy runs on 3.11; on 3.13, it runs on 3.13. The build prints the resolved version and its source. If your local interpreter is outside the supported set (`3.10`–`3.13`), the build fails with an actionable error. Override the default in two ways:
16
16
17
-
-**Per-resource declaration**: set `python_version="3.11"` on any resource config — all resources in the same app must agree or leave it unset.
18
-
-**App-level override**: pass `--python-version 3.11` to `flash build` or `flash deploy`. The override wins over per-resource values that are unset and must match any that are set.
17
+
-**Per-resource declaration**: set `python_version="3.11"` on any resource config — all resources in the same app must agree or leave it unset. For projects shared across a team or CI, declaring it explicitly makes the deploy result identical regardless of who runs `flash build` and which interpreter they have.
18
+
-**App-level override**: pass `--python-version 3.11` to `flash build` or `flash deploy`. The override sets the target when no resource declares one and must match any that are set (a conflict raises).
Copy file name to clipboardExpand all lines: src/runpod_flash/cli/docs/flash-build.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ flash build [OPTIONS]
28
28
-`--no-deps`: Skip transitive dependencies during pip install (default: false)
29
29
-`--output, -o`: Custom archive name (default: artifact.tar.gz)
30
30
-`--exclude`: Comma-separated packages to exclude (e.g., 'torch,torchvision')
31
-
-`--python-version`: Target Python version for worker images (`3.10`, `3.11`, or `3.12`). Overrides per-resource `python_version`. Default: value declared on resource configs, or 3.12 if none set.
31
+
-`--python-version`: Target Python version for worker images (`3.10`, `3.11`, `3.12`, or `3.13`). Overrides the local-interpreter default; must match any per-resource `python_version` declarations (conflicting declarations raise). By default, `flash build` targets the Python version you're running flash from.
32
32
33
33
To launch a local preview environment, use `flash deploy --preview` instead.
34
34
@@ -68,7 +68,7 @@ After `flash build` completes:
68
68
Flash automatically handles cross-platform builds, ensuring compatibility with Runpod's Linux x86_64 serverless infrastructure:
69
69
70
70
-**Automatic Platform Targeting**: Dependencies are always installed for Linux x86_64, regardless of your build platform (macOS, Windows, or Linux)
71
-
-**Python Version**: Targets Python 3.12 for wheel ABI selection regardless of local interpreter
71
+
-**Python Version**: Targets the resolved Python version (your local interpreter by default, or whatever `--python-version` / per-resource `python_version` selects) for wheel ABI selection
72
72
-**Binary Wheel Enforcement**: Only pre-built binary wheels are used, preventing platform-specific compilation issues
73
73
74
74
This means you can safely build on macOS ARM64, Windows, or any platform, and the deployment will work correctly on Runpod.
@@ -181,8 +181,8 @@ ls .flash/.build/my-project/
181
181
If a package doesn't have pre-built Linux x86_64 wheels:
182
182
183
183
1.**Install standard pip**: `python -m ensurepip --upgrade` -- standard pip has better manylinux compatibility than uv pip
184
-
2.**Check package availability**: Visit PyPI and verify the package has Linux wheels for Python 3.12
185
-
3.**Python 3.12**: All flash workers run Python 3.12. Ensure packages are available for this version.
184
+
2.**Check package availability**: Visit PyPI and verify the package has Linux wheels for your target Python version (`3.10`, `3.11`, `3.12`, or `3.13`)
185
+
3.**Match interpreter**: Flash builds default to your local Python version. If a wheel is missing for that version, either pick a different `--python-version` or upgrade/downgrade the package.
186
186
4.**Pure-Python packages**: These work regardless, as they don't require platform-specific builds
Copy file name to clipboardExpand all lines: src/runpod_flash/cli/docs/flash-deploy.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,7 +88,7 @@ flash deploy [OPTIONS]
88
88
-`--exclude`: Comma-separated packages to exclude (e.g., 'torch,torchvision')
89
89
-`--output, -o`: Custom archive name (default: artifact.tar.gz)
90
90
-`--preview`: Build and launch local preview environment instead of deploying
91
-
-`--python-version`: Target Python version for worker images (`3.10`, `3.11`, or `3.12`). Overrides per-resource `python_version`.
91
+
-`--python-version`: Target Python version for worker images (`3.10`, `3.11`, `3.12`, or `3.13`). Overrides the local-interpreter default; must match any per-resource `python_version` declarations (conflicting declarations raise). By default, `flash deploy` targets the Python version you're running flash from.
0 commit comments