Add run_constrained support to grayskull dependency updates#5646
Add run_constrained support to grayskull dependency updates#5646ctcjab wants to merge 4 commits intoregro:mainfrom
Conversation
The update-grayskull inspection feature now updates run_constrained dependencies when bumping package versions. This prevents stale version constraints that can break downstream packages. Changes: - Add "run_constrained" to SECTIONS_TO_PARSE - Add new SECTIONS_TO_UPDATE_CONSTRAINTS_ONLY for conservative updates - Add constraints_only parameter to _apply_env_dep_comparison() - Update _apply_dep_update_v1() and apply_dep_update() to handle run_constrained with constraints-only behavior - Update generate_dep_hint() to show run_constrained updates The constraints-only behavior for run_constrained: - Updates version constraints for packages in both recipe and grayskull - Does NOT add new packages (optional deps are maintainer's choice) - Does NOT remove packages (maintainer may have specific reasons) This fixes issues like litellm-feedstock where uvicorn constraint was stale (>=0.31.1,<0.32.0) instead of upstream's (>=0.32.1,<1.0.0). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
beckermr
left a comment
There was a problem hiding this comment.
This PR needs testing against v1 recipes. Those recipes put run constraints in a different part of the recipe.
|
@beckermr thanks for the quick review! Since I am not sure when I'll have time to pick this back up, anyone reading this please feel free to take over here. Happy to grant anyone permission to push to my branch as needed. |
|
OK. happy to wait on this PR until you have time. |
Added a test for a v1 recipe in ce05015. But based on https://conda.org/learn/ceps/cep-0014/#requirements-section and https://docs.conda.io/projects/conda-build/en/latest/resources/define-metadata.html#run-constrained both v1 and v0 recipes use the same location, |
|
It is called for v0 (conda-build) and for v1 (rattler-build) Notice it is |
v0 recipes (conda-build) use "run_constrained" while v1 recipes (rattler-build) use "run_constraints". Update _apply_dep_update_v1() to look for the correct section name when processing v1 recipes. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Oops, thanks for catching that! Fixed in 034de92:
The internal |
Description:
The
update-grayskullinspection feature now updatesrun_constraineddependencies when bumping package versions. This prevents stale version constraints that can break downstream packages.Changes:
"run_constrained"toSECTIONS_TO_PARSESECTIONS_TO_UPDATE_CONSTRAINTS_ONLYconstant for conservative updatesconstraints_onlyparameter to_apply_env_dep_comparison()_apply_dep_update_v1()andapply_dep_update()to handlerun_constrainedgenerate_dep_hint()to showrun_constrainedupdatesThe constraints-only behavior for
run_constrained:This conservative approach fixes stale constraints while respecting maintainer decisions about which optional dependencies to include.
Checklist:
Cross-refs, links to issues, etc:
Fixes #5645
Real-world example: litellm-feedstock had stale uvicorn constraint
>=0.31.1,<0.32.0instead of upstream's>=0.32.1,<1.0.0, breaking packages likenotebook_intelligence.