refactor: directional update advice in workspace version mismatch error#107
Merged
Merged
Conversation
Replaces the `git clone --branch <version>` instruction in WorkspaceVersionMismatchError with advice that points users to update whichever side is older: pip install --upgrade <lib>==<workspace_version> when the workspace is newer, or `cd <ws> && git pull origin main` when the library is newer. Library package name (autolens, autogalaxy, autofit, ...) is derived from the workspace folder name. Drops the --branch <version> reference since we no longer publish workspace version branches.
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
Replaces the
git clone --branch <version>advice inWorkspaceVersionMismatchErrorwith directional advice that points users to update whichever side is older.pip install --upgrade <lib>==<workspace_version>where<lib>is derived from the workspace folder name (autolens_workspace→autolens,autogalaxy_workspace→autogalaxy,autofit_workspace→autofit, ...).cd <workspace_root> && git pull origin main.Drops the
git clone --branch <version> <workspace-repo-url>instruction since we no longer publish workspace version branches. Theworkspace_version_check: Falsebypass instructions and themain-branch IMPORTANT note are preserved unchanged.API Changes
None — public API surface (
WorkspaceVersionMismatchError,check_version) is unchanged. Only the error message text is modified, plus four new private helpers (_parse_version,_library_name_from_workspace,_update_library_block,_update_workspace_block).See full details below.
Test Plan
python -m pytest test_autoconf/test_workspace.py -q— all 14 tests passpip install --upgrade ...blockcd ... && git pull origin mainblockFull API Changes (for automation & release notes)
Changed Behaviour
autoconf.workspace.WorkspaceVersionMismatchErrormessage text now gives directional update advice instead of a re-clone instruction. Class, exception type, andcheck_versionsignature are unchanged.Added (private)
autoconf.workspace._parse_version(version_string)— parsesYYYY.M.D.Rinto a tuple of ints, returnsNoneon failure.autoconf.workspace._library_name_from_workspace(workspace_root)— strips trailing_workspacefrom the folder name, returnsNoneif absent.autoconf.workspace._update_library_block(library_name, target_version)— formats the pip-upgrade advice.autoconf.workspace._update_workspace_block(workspace_root)— formats the git-pull advice.Migration
None required — the change is purely cosmetic from any caller's perspective.
🤖 Generated with Claude Code