Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate support for the runtime.txt file #325

Merged
merged 1 commit into from
Feb 4, 2025
Merged

Conversation

edmorley
Copy link
Member

@edmorley edmorley commented Feb 4, 2025

The runtime.txt file is a classic Heroku Python buildpack invention that's not widely supported in the Python ecosystem. Instead, most other tooling (pyenv, package managers, GitHub Actions, dependency update bots etc) support/use the .python-version file.

As such, we recently added .python-version support to both the Python CNB and the classic Python buildpack, and updated all documentation and guides to use it instead of the runtime.txt file. eg:
https://devcenter.heroku.com/articles/python-runtimes

We would prefer apps use the new file, since it helps ensure their deployed app is using the same Python version used locally (via eg pyenv or uv) or in CI.

As such this adds a deprecation warning for apps using runtime.txt, which will be made an error in the CNB in near future (likely before Fir GA). We'll also be adding a deprecation warning to the classic Python buildpack, however, won't be making that an error any time soon (and maybe at all; but TBD).

Towards #275.
GUS-W-16878239.

@edmorley edmorley self-assigned this Feb 4, 2025
@edmorley edmorley force-pushed the deprecate-runtime-txt branch from 4dc45ee to 187ccc8 Compare February 4, 2025 14:10
@edmorley edmorley marked this pull request as ready for review February 4, 2025 14:10
@edmorley edmorley requested a review from a team as a code owner February 4, 2025 14:10
@edmorley edmorley enabled auto-merge (squash) February 4, 2025 14:10
@edmorley edmorley disabled auto-merge February 4, 2025 15:37
The `runtime.txt` file is a classic Heroku Python buildpack invention
that's not widely supported in the Python ecosystem. Instead, most
other tooling (pyenv, package managers, GitHub Actions, dependency
update bots etc) support/use the `.python-version` file.

As such, we recently added `.python-version` support to both the Python
CNB and the classic Python buildpack, and updated all documentation and
guides to use it instead of the `runtime.txt` file. eg:
https://devcenter.heroku.com/articles/python-runtimes

We would prefer apps use the new file, since it helps ensure their
deployed app is using the same Python version used locally (via eg
pyenv or uv) or in CI.

As such this adds a deprecation warning for apps using `runtime.txt`,
which will be made an error in the CNB in near future (likely before
Fir GA). We'll also be adding a deprecation warning to the classic
Python buildpack, however, won't be making that an error any time
soon (if at all).

Towards #275.
GUS-W-16878239.
@edmorley edmorley force-pushed the deprecate-runtime-txt branch from 187ccc8 to 5823f72 Compare February 4, 2025 15:39
@edmorley edmorley merged commit 4435b42 into main Feb 4, 2025
7 checks passed
@edmorley edmorley deleted the deprecate-runtime-txt branch February 4, 2025 22:46
heroku-linguist bot added a commit that referenced this pull request Feb 5, 2025
## heroku/python

### Added

- Added `runtime.txt` support for the `python-3.X` major Python version form. ([#322](#322))
- Enabled `libcnb`'s `trace` feature. ([#320](#320))

### Changed

- The Python 3.13 version alias now resolves to Python 3.13.2. ([#326](#326))
- The Python 3.12 version alias now resolves to Python 3.12.9. ([#326](#326))
- Deprecated support for the `runtime.txt` file. ([#325](#325))
- Improved the error messages shown when the `.python-version` file contents aren't valid. ([#325](#325))
@heroku-linguist heroku-linguist bot mentioned this pull request Feb 5, 2025
heroku-linguist bot added a commit to heroku/cnb-builder-images that referenced this pull request Feb 5, 2025
## heroku/python

### Added

- Added `runtime.txt` support for the `python-3.X` major Python version form. ([#322](heroku/buildpacks-python#322))
- Enabled `libcnb`'s `trace` feature. ([#320](heroku/buildpacks-python#320))

### Changed

- The Python 3.13 version alias now resolves to Python 3.13.2. ([#326](heroku/buildpacks-python#326))
- The Python 3.12 version alias now resolves to Python 3.12.9. ([#326](heroku/buildpacks-python#326))
- Deprecated support for the `runtime.txt` file. ([#325](heroku/buildpacks-python#325))
- Improved the error messages shown when the `.python-version` file contents aren't valid. ([#325](heroku/buildpacks-python#325))
@edmorley edmorley linked an issue Feb 5, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecate and eventually sunset runtime.txt support
2 participants