Stop tracking generated _version.py - #3483
Merged
vineetbansal merged 1 commit intoSep 22, 2026
Merged
Conversation
Remove _version.py from the index, fall back to 0.0.0 in imap_processing/__init__.py when it is missing.
vineetbansal
requested review from
bryan-harter,
lacoak21,
leowerneck and
tech3371
September 21, 2026 22:07
vineetbansal
merged commit Sep 22, 2026
d0a7fce
into
IMAP-Science-Operations-Center:dev
22 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #3476.
Some background on this is that backends that support auto-versioning (by looking at the state of the working tree against the current git branch+tag+commit), auto-generate a
_version.py(or a similarly named file) when doing apoetry installoruv installetc, and don't need a_version.pyfile in the git repo (a file they're going to overwrite anyway).Having this file in the git index causes developers to keep accidentally committing/pushing it. Its entry was added in
.gitignore, but perhaps too late (after it had already been committed to the git index).If some code relies on this file being present, it should guard against its absence with an
ImportError. There are other ways to do this "default" version instead of hardcoding it, but it gets very specific to the backend, for example, this page says:IMO it's easier to do the right thing and just have a default version specified on an
ImportError, which is more explicit, as we're doing here.