Skip to content

fix(doctor): stop flagging pip console-script symlink as legacy shim (#252) - #686

Merged
tcconnally merged 1 commit into
mainfrom
fix/doctor-stale-shim-false-positive
Jul 6, 2026
Merged

fix(doctor): stop flagging pip console-script symlink as legacy shim (#252)#686
tcconnally merged 1 commit into
mainfrom
fix/doctor-stale-shim-false-positive

Conversation

@tcconnally

Copy link
Copy Markdown
Collaborator

Problem

_doctor_check_stale_shim treated any ~/.local/bin/perseus symlink as a legacy install.sh shim. The recommended stable-pointer setup — a symlink from ~/.local/bin/perseus to the pip-installed console entry-point (e.g. ~/Library/Python/3.x/bin/perseus) — therefore always produced a false ⚠ Legacy shim warning, even on a clean, current pip install.

Fix

Resolve the symlink target and inspect the real script:

  • Treat it as current when it is a pip entry-point wrapper (contains from perseus import main / import perseus).
  • Only warn on a genuine /bin/sh shim or a reference to the old ~/.local/share/perseus/perseus.py bundle.

The legacy share_path check is unchanged.

Verification

  • python3 scripts/build.py regenerates perseus.py (smoke test ok, v1.0.19).
  • perseus doctor on a symlink-to-pip-console-script setup now reports ✓ Legacy shim shim at ~/.local/bin/perseus looks current (previously ).
  • A real /bin/sh shim / legacy bundle still warns.

Both the source module (src/perseus/doctor.py) and the built perseus.py are updated.

…252)

The stale-shim check treated ANY ~/.local/bin/perseus symlink as a legacy
install.sh shim, so the recommended stable-pointer setup (a symlink to the
pip-installed console entry-point) always produced a false 'Legacy shim'
warning. Resolve the symlink target and treat it as current when it is a
pip entry-point script (contains 'from perseus import main'); only warn on
genuine /bin/sh shims or references to the old
~/.local/share/perseus/perseus.py bundle.
@tcconnally
tcconnally merged commit ac9d7c2 into main Jul 6, 2026
8 checks passed
@tcconnally
tcconnally deleted the fix/doctor-stale-shim-false-positive branch July 6, 2026 03:27
tcconnally added a commit that referenced this pull request Aug 30, 2026
…252) (#686)

The stale-shim check treated ANY ~/.local/bin/perseus symlink as a legacy
install.sh shim, so the recommended stable-pointer setup (a symlink to the
pip-installed console entry-point) always produced a false 'Legacy shim'
warning. Resolve the symlink target and treat it as current when it is a
pip entry-point script (contains 'from perseus import main'); only warn on
genuine /bin/sh shims or references to the old
~/.local/share/perseus/perseus.py bundle.

Co-authored-by: Thomas Connally <greg@weirdplexbutok.biz>
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.

2 participants