Work
Make dl --version report install provenance, and have aid --version inherit it.
Current behavior. Both installs print dl 0.0.9. The version comes from importlib.metadata.version (devlaunch/dl.py:30), which is identical for the released build and an editable install of the same commit.
Wanted. The version string distinguishes them, and the dev build names the tree it resolves to. Exact wording is the implementer's call; the discriminating content is what matters. Something like:
$ dl --version
dl 0.0.9
$ dl-next --version
dl 0.0.9 (dev, editable from /home/ags/projects/devlaunch)
How. Read PEP 610 direct_url.json from the installed dist via importlib.metadata — do not stat paths or pattern-match against ~/.pixi or ~/.local, and do not hardcode any /home/<user> path (see CLAUDE.md). dir_info.editable == true is the discriminator; url supplies the tree to name.
Edge cases that must not crash --version:
- no
direct_url.json at all (a plain wheel/sdist install) — fall back to the current bare output
direct_url.json present but malformed or missing keys
- package metadata absent entirely —
PackageNotFoundError is already handled at the existing call site; keep that behavior
Provenance detection is strictly additive: it must never make --version fail, since a broken --version is worse than an ambiguous one.
Done when
- A test asserts an editable install (
dir_info.editable == true) yields output naming it as dev and containing the tree path from url.
- A test asserts a non-editable install yields the current bare
dl <version> output, unchanged.
- Tests cover the three degradation cases above, each falling back to bare output rather than raising.
pixi run ci is green (pytest, pylint, ruff, ty).
- README updated if it shows
--version output (per CLAUDE.md's docs rule).
Work
Make
dl --versionreport install provenance, and haveaid --versioninherit it.Current behavior. Both installs print
dl 0.0.9. The version comes fromimportlib.metadata.version(devlaunch/dl.py:30), which is identical for the released build and an editable install of the same commit.Wanted. The version string distinguishes them, and the dev build names the tree it resolves to. Exact wording is the implementer's call; the discriminating content is what matters. Something like:
How. Read PEP 610
direct_url.jsonfrom the installed dist viaimportlib.metadata— do not stat paths or pattern-match against~/.pixior~/.local, and do not hardcode any/home/<user>path (seeCLAUDE.md).dir_info.editable == trueis the discriminator;urlsupplies the tree to name.Edge cases that must not crash
--version:direct_url.jsonat all (a plain wheel/sdist install) — fall back to the current bare outputdirect_url.jsonpresent but malformed or missing keysPackageNotFoundErroris already handled at the existing call site; keep that behaviorProvenance detection is strictly additive: it must never make
--versionfail, since a broken--versionis worse than an ambiguous one.Done when
dir_info.editable == true) yields output naming it as dev and containing the tree path fromurl.dl <version>output, unchanged.pixi run ciis green (pytest, pylint, ruff, ty).--versionoutput (perCLAUDE.md's docs rule).