Skip to content

fix: skip workspace version warning outside a workspace (no config/) - #192

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/workspace-version-warning-outside-workspace
Oct 7, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/workspace-version-warning-outside-workspace

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

autonerves.workspace.check_version runs on every import of autofit / autogalaxy / autolens with workspace_root defaulting to the current working directory. Running a plain script from a data directory (no workspace at all) found no version floor and warned "Cannot verify the workspace ...". The no-floor branch now returns silently when the directory has no config/ (new _looks_like_workspace) as well as for package source checkouts. A directory with a config/ but no version keys and no version.txt (a misconfigured workspace) still warns. There is deliberately no walk-up to a parent directory.

Reported by external contributor @HRSAstro in https://github.com/orgs/PyAutoLabs/discussions/13 (comment PyAutoLabs/.github#13 (comment)).

Closes #191.

API Changes

None to the public API. One behaviour change: check_version no longer warns in the no-floor case when workspace_root has no config/ directory.
See full details below.

Test Plan

  • New test test_missing_sources_without_config_dir_is_silent fails on unfixed source (red), passes after the fix
  • New test test_config_dir_without_general_yaml_or_version_txt_warns passes (the misconfigured workspace still warns)
  • test_missing_sources_warns now creates config/ first and still warns
  • Full autonerves suite: 241 passed
  • Live check: python -W always -c "import autofit" from a bare dir prints no warning; after mkdir config it warns once
Full API Changes (for automation & release notes)

Added

  • autonerves.workspace._looks_like_workspace(root) (private): (root / "config").is_dir()

Changed Behaviour

  • autonerves.workspace.check_version: when no floor is found (no config/general.yaml version keys, no version.txt), it returns silently if workspace_root is a source checkout or has no config/ directory. Previously only source checkouts were silent.
  • Side effect: autofit_workspace_developer and autolens_workspace_developer have no config/ and no floor, so running from their roots no longer emits the warning. Neither repo records a floor, so nothing was being checked there before either. Every other workspace root ships config/ and is unaffected.

Migration

  • None. Nothing asserts the warning text: Heart, Hands and PyAutoLens subprocess tests only set PYAUTO_SKIP_WORKSPACE_VERSION_CHECK=1.

Tier: judge — merge mode: human /prm

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

check_version defaults workspace_root to the cwd and runs on every import
of autofit/autogalaxy/autolens, so a plain script run from a data
directory warned "Cannot verify the workspace ...". In the no-floor
branch, return silently when the directory has no config/ (new
_looks_like_workspace) as well as for source checkouts. A config/ with no
version keys still warns. No walk-up to a parent directory.

Reported by @HRSAstro in PyAutoLabs Discussion #13. Closes #191.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Oct 7, 2026
@Jammy2211
Jammy2211 merged commit 91c2d0e into main Oct 7, 2026
3 checks passed
@Jammy2211
Jammy2211 deleted the feature/workspace-version-warning-outside-workspace branch October 7, 2026 09:58
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Oct 7, 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.

fix: skip workspace version warning outside a workspace (no config/)

1 participant