Skip to content

feat: require python_version in cog.yaml build section#2741

Merged
bfirsh merged 1 commit intomainfrom
require-python-version
Feb 18, 2026
Merged

feat: require python_version in cog.yaml build section#2741
bfirsh merged 1 commit intomainfrom
require-python-version

Conversation

@bfirsh
Copy link
Member

@bfirsh bfirsh commented Feb 18, 2026

Summary

  • Make python_version a required field in the build section of cog.yaml, so models don't silently break when the default Python version is bumped in a future release
  • Add a clear validation error guiding users to add the field
  • Remove the silent fallback to DefaultPythonVersion in config parsing

I was considering adding a warning saying it will be required in a future version of Cog, but I have never seen anyone not use python_version, so I would consider it a minor breaking change. We're still in the 0.x wild west land and so long as we mention it in release notes maybe it's fine? 🤷

Closes #101

Users must now explicitly set python_version in the build section of
cog.yaml. Previously, omitting it silently defaulted to the latest
Python version (3.13), which could break models when the default was
bumped in a future release.

Closes #101
@bfirsh bfirsh requested a review from a team as a code owner February 18, 2026 04:09
@bfirsh bfirsh merged commit 9b3a7ac into main Feb 18, 2026
54 of 56 checks passed
@bfirsh bfirsh deleted the require-python-version branch February 18, 2026 23:01
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.

Require users to set python_version in cog.yaml

2 participants

Comments