feat: check workspace version on import#1241
Merged
Conversation
This was referenced Apr 30, 2026
Merged
Merged
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.
Summary
Add a
check_version(__version__)call toautofit/__init__.pyso workspace/library version mismatches surface on every script run, not justwelcome.py. Pairs with the upstream PyAutoConf change (PyAutoLabs/PyAutoConf#100) which extendscheck_versionto read fromconfig/general.yamland adds a YAML-driven bypass formain-branch users.API Changes
None to autofit's public API. Importing
autofitnow triggers a workspace-version check viaautoconf.workspace.check_version, which may emit a warning (no version source found) or raiseautoconf.workspace.WorkspaceVersionMismatchError(workspace and library versions disagree). Users onmain-branch clones who hit this should disable viaversion.workspace_version_check: Falseinconfig/general.yaml— see PyAutoLabs/PyAutoConf#100 for the full rationale.See full details below.
Test Plan
pytest test_autofit/stays green (collection imports autofit; noversion.txtorgeneral.yamlat the repo root, so the check warns and continues)python -c "import autofit"fromautofit_workspace/succeeds silentlypython -c "import autofit"from/tmpwarns with the new message textFull API Changes (for automation & release notes)
Changed Behaviour
import autofitnow callsautoconf.workspace.check_version(autofit.__version__)at the end ofautofit/__init__.py. May warn (noversion.workspace_versionin config and noversion.txt) or raiseautoconf.workspace.WorkspaceVersionMismatchError(versions disagree).Migration
main-branch workspace clones should add toconfig/general.yaml:🤖 Generated with Claude Code