feat: handle .dev dependency pins in min-deps check and publish gate#6612
feat: handle .dev dependency pins in min-deps check and publish gate#6612masenf wants to merge 3 commits into
Conversation
A workspace package may pin a sibling to an unreleased *.dev version while that version is still unpublished. Such pins cannot resolve from PyPI, which the min-deps checker assumed for every dependency via --no-sources. check_min_deps.py: for a dependency whose lower bound is a development release AND which is a workspace member, install that sibling editable from its local checkout in both resolutions; every non-dev dependency still resolves from PyPI. Detection (name + dev-release lower bound) is a small self-contained PEP 508/440 parser so the script keeps running under `uv run --no-project` with only the stdlib. Add a --check-dev-pins mode that scans a package's published dependencies (core + optional groups) for *.dev pins and exits non-zero if any are found. The publish workflow runs it scoped to the package being published, before the build, so unpublishable dev pins never reach released metadata. Scoping to the build target (not the whole workspace) keeps the leaf-first release flow from deadlocking: a dependency can be released while dependents still dev-pin it. https://claude.ai/code/session_01GjDdCfj8ybHLu93NBXkTvQ
Greptile SummaryThis PR extends
Confidence Score: 4/5Safe to merge; the new publish gate and min-deps editable-install logic are well-scoped and thoroughly tested. The _DEV_RELEASE regex matches any occurrence of a dev version string in a specifier, including upper-bound and exclusion operators, not only lower-bound pins. This could cause check_dev_pins to block publishing a package that merely excludes a dev build, and could cause _local_dev_sources to add a spurious editable install. In practice this pattern is uncommon enough that it is unlikely to trigger, but it is a reachable false positive in the publish gate. scripts/check_min_deps.py — the _DEV_RELEASE regex and its use in _local_dev_sources and check_dev_pins. Important Files Changed
Reviews (1): Last reviewed commit: "feat: handle .dev dependency pins in min..." | Re-trigger Greptile |
Replace the hand-rolled requirement/version regexes with packaging's Requirement, canonicalize_name and Version.is_devrelease. This fixes a false positive flagged in review: the old regex matched a dev release anywhere in the specifier, so an upper-bound or exclusion clause (e.g. reflex-base >=1.0,!=2.0.dev1) — still resolvable from PyPI — was wrongly treated as an unpublishable dev pin. Detection now only fires for a dev release under a lower-bound operator (>=, >, ==, ===, ~=), and PEP 440 edge cases like ==1.2.* prefix matches are handled by the standard parser. packaging is a core reflex dependency so the synced check job already has it; the two --no-project invocations (min_deps discover, publish gate) get it via --with packaging, and it is declared in the script's PEP 723 metadata for direct runs. https://claude.ai/code/session_01GjDdCfj8ybHLu93NBXkTvQ
A workspace package may pin a sibling to an unreleased *.dev version while
that version is still unpublished. Such pins cannot resolve from PyPI, which
the min-deps checker assumed for every dependency via --no-sources.
check_min_deps.py: for a dependency whose lower bound is a development
release AND which is a workspace member, install that sibling editable from
its local checkout in both resolutions; every non-dev dependency still
resolves from PyPI. Detection (name + dev-release lower bound) is a small
self-contained PEP 508/440 parser so the script keeps running under
uv run --no-projectwith only the stdlib.Add a --check-dev-pins mode that scans a package's published dependencies
(core + optional groups) for *.dev pins and exits non-zero if any are found.
The publish workflow runs it scoped to the package being published, before
the build, so unpublishable dev pins never reach released metadata. Scoping
to the build target (not the whole workspace) keeps the leaf-first release
flow from deadlocking: a dependency can be released while dependents still
dev-pin it.
https://claude.ai/code/session_01GjDdCfj8ybHLu93NBXkTvQ