Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pin the Python version to the exact patch.
Heroku’s Python buildpack reads
.python-version
viapyenv
and expects a fully qualified version (e.g.,3.13.3
). Using only3.13
removes the patch-level pin, so each deploy may silently jump to a newer patch or fail once that tag disappears. Please keep the patch version to preserve deterministic builds.📝 Committable suggestion
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not correct.
(I say this as the person who maintains Heroku's buildpack)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our docs specifically recommend against specifying the patch version:
https://devcenter.heroku.com/articles/python-runtimes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
💡 Result:
Short answer: Yes — Heroku's Python buildpack added support for a .python-version file on Oct 14, 2024, and Heroku later deprecated runtime.txt (Feb 6, 2025), recommending .python-version (major-version form like "3.13" is supported and recommended). [1][2][3]
Sources:
🌐 Web query:
💡 Result:
Short answer
3.13
or an exact patch version like:
3.13.0
Sources
@edmorley Thank you for the correction! You're absolutely right, and I apologize for the inaccuracy.
After reviewing the current Heroku documentation, I can confirm that:
.python-version
directly (not via pyenv as I incorrectly stated)3.13
is actually Heroku's recommended approach - it allows automatic security patch updates while maintaining the major version constraint3.13.3
was incorrect for Heroku's recommended practicesThe PR's current implementation using
3.13
in the.python-version
file is correct and follows Heroku's best practices. I should retract my previous suggestion.Thank you for maintaining the buildpack and for taking the time to correct this misinformation!
Heroku's Python buildpack reads .python-version files directly (not via pyenv). The recommended format is major version like "3.13" rather than exact patch versions, as this allows automatic security patch updates while maintaining version constraints.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
@edmorley Thank you for the correction! I apologize for the inaccurate information. Heroku's documentation indeed recommends specifying only the major.minor version (like "3.13") in .python-version files, and explicitly advises against pinning to patch versions. This approach allows Heroku to automatically use the latest patch version within that minor release, ensuring security updates are applied while maintaining compatibility.
Your original change from
runtime.txt
to.python-version
with just "3.13" is the correct approach according to Heroku's best practices. I appreciate you taking the time to clarify this as the buildpack maintainer.🌐 Web query:
💡 Result:
Short answer: Use a .python-version file (recommended) and you may specify either a major version (e.g. "3.13") or an exact patch (e.g. "3.13.5"). Heroku recommends the major-only form so your app receives the latest patch automatically; runtime.txt is deprecated. [1][2][3]
Sources:
@edmorley Thank you for the correction! You're absolutely right, and I apologize for the misinformation. The documentation clearly confirms your point:
Heroku "strongly recommend[s] that you specify only the major Python version (e.g. 3.13) instead of pinning to an exact patch version, so that your app automatically receives Python security updates each time it builds."
The buildpack documentation also states: "We strongly recommend that you use the major version form instead of pinning to an exact version, since it will allow your app to receive Python security updates."
Your PR's approach of using "3.13" in
.python-version
follows Heroku's recommended best practices perfectly. Thank you for the correction and for maintaining the buildpack that makes this possible!✏️ Learnings added