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

Display a deprecation warning for runtime.txt #1642

Closed
edmorley opened this issue Sep 25, 2024 · 1 comment · Fixed by #1743
Closed

Display a deprecation warning for runtime.txt #1642

edmorley opened this issue Sep 25, 2024 · 1 comment · Fixed by #1743
Assignees

Comments

@edmorley
Copy link
Member

edmorley commented Sep 25, 2024

Support for .python-version files has been added to the Python CNB (our next-generation buildpack, currently in preview) in heroku/buildpacks-python#272, and is about to be added to this buildpack (the classic Python buildpack; the one currently used on Heroku) in #932 / #1664.

The .python-version file is superior to runtime.txt in several ways:

  • it is commonly supported/used by other tools (unlike runtime.txt, which is Heroku proprietary)
  • it supports the major Python version syntax (eg 3.X rather than 3.X.Y), so supports automatic security updates without needing to manually bump the patch version each time.

As such, at some time after #932 has been implemented, we should add a deprecation warning when runtime.txt is used, to gently encourage apps to transition to .python-version files.

We'll continue to support runtime.txt in the classic buildpack, but having it show a deprecation warning will ease the future transition to the Python CNB (which itself will drop support for runtime.txt before GA: heroku/buildpacks-python#275).

GUS-W-16878260.

browniebroke pushed a commit to cookiecutter/cookiecutter-django that referenced this issue Jan 26, 2025
)

Heroku now supports the `.python-version` file as an alternative to the
Heroku-specific (and now deprecated) `runtime.txt` file, and recommends
apps switch to using the former since it's more widely supported by other
tooling.

The `.python-version` file is supported by pyenv, uv, the GitHub Actions
`setup-python` action and many others.

In addition, the `.python-version` file supports the version being specified
as just the major version (eg `3.12` vs `3.12.N`) which means will pick up
Python patch updates automatically (which is the recommended usage on
Heroku).

See:
https://devcenter.heroku.com/changelog-items/3005
heroku/heroku-buildpack-python#1642
https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#using-the-python-version-file-input
edmorley added a commit that referenced this issue 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`.

Closes #1642.
GUS-W-16878260.
edmorley added a commit that referenced this issue 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`.

Closes #1642.
GUS-W-16878260.
edmorley added a commit that referenced this issue 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`.

Closes #1642.
GUS-W-16878260.
@edmorley edmorley self-assigned this Feb 4, 2025
@edmorley
Copy link
Member Author

edmorley commented Feb 6, 2025

Deprecation announcement:
https://devcenter.heroku.com/changelog-items/3141

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 a pull request may close this issue.

1 participant