Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make Python version pinning pin to the major version only
For apps that do not specify an explicit Python version (eg: via a `.python-version` or `runtime.txt` file), the buildpack uses a curated default version for the first build of the app. Then for subsequent builds of the app, the buildpack selects a Python version based on the version found in the build cache, so that the version used for the app doesn't change in a breaking way over time as the buildpack's own default version changes. This feature is referred to as "version pinning" and/or "sticky versions". The existing implementation of this feature pinned the version to the full Python version (eg `3.13.0`), meaning that the app would always use that exact Python version, even as newer backwards-compatible patch releases (such as `3.13.1`) become available over time. Now that we have Python major version -> latest patch version resolution support (as of #1658) and improved build output around cache invalidation reasons (as of #1679), we can switch to instead only pinning to the major Python version (eg `3.13`). This allows apps that do not specify a Python version to pick up any bug and security fixes for their major Python version the next time the app is built, whilst still keeping the compatibility properties of version pinning. Longer term, the plan is to deprecate/sunset version pinning entirely (since it leads to confusing UX / lack of parity between multiple apps deployed from the same codebase at different times, eg review apps), and the Python CNB has already dropped support for it. However, that will be a breaking change for the classic buildpack, so out of scope for now. GUS-W-17384879.
- Loading branch information