Skip to content

feat(workspace): add version-mismatch check helper - #94

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/default-branch-release-to-main
Apr 18, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/default-branch-release-to-main

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Adds autoconf.workspace.check_version() so a workspace's version.txt can be paired to the installed library version. Companion to PyAutoLabs/autolens_workspace#71 (drop the release branch in favour of version-paired workspace tags).

API Changes

Added one helper and one exception, both exported from the top-level autoconf namespace:

  • autoconf.check_version(library_version, workspace_root=None) — reads <workspace_root>/version.txt and raises if it does not match library_version. Defaults to the current working directory.
  • autoconf.WorkspaceVersionMismatchError — subclass of ConfigException.

Override the check entirely with PYAUTO_SKIP_WORKSPACE_VERSION_CHECK=1 (intended for source-checkout development). Missing version.txt warns rather than raises.

See full details below.

Test Plan

  • pytest test_autoconf/test_workspace.py — 6 new tests cover match, mismatch, missing-file warning, env override, and default cwd resolution.
  • Full PyAutoConf suite — 77 tests pass.
  • Once welcome.py in each workspace calls this from the workspace root, verify mismatch raises with a clear message.
Full API Changes (for automation & release notes)

Added

  • autoconf.workspace.check_version(library_version, workspace_root=None) — verifies the workspace at workspace_root (or cwd) has a version.txt matching library_version. Raises WorkspaceVersionMismatchError on mismatch. Warns if version.txt is absent. No-op when PYAUTO_SKIP_WORKSPACE_VERSION_CHECK=1.
  • autoconf.workspace.WorkspaceVersionMismatchError — subclass of autoconf.exc.ConfigException.
  • Both re-exported from autoconf.__init__ as autoconf.check_version and autoconf.WorkspaceVersionMismatchError.

Removed

None.

Changed Signature

None.

Migration

None — purely additive.

🤖 Generated with Claude Code

Adds autoconf.workspace.check_version() so a workspace's version.txt
can be paired to the installed library version. Raises
WorkspaceVersionMismatchError on mismatch, warns when version.txt is
missing. Override with PYAUTO_SKIP_WORKSPACE_VERSION_CHECK=1 for
source-checkout development.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@Jammy2211

Copy link
Copy Markdown
Collaborator Author

@Jammy2211
Jammy2211 merged commit e759045 into main Apr 18, 2026
4 checks passed
@Jammy2211
Jammy2211 deleted the feature/default-branch-release-to-main branch April 18, 2026 12:33
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Sep 4, 2026
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.

1 participant