Skip to content

Add run_constrained support to grayskull dependency updates#5646

Open
ctcjab wants to merge 1 commit intoregro:mainfrom
chicagotrading:add-run-constrained-support
Open

Add run_constrained support to grayskull dependency updates#5646
ctcjab wants to merge 1 commit intoregro:mainfrom
chicagotrading:add-run-constrained-support

Conversation

@ctcjab
Copy link

@ctcjab ctcjab commented Feb 27, 2026

Description:

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 constant 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
  • 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 conservative approach fixes stale constraints while respecting maintainer decisions about which optional dependencies to include.

Checklist:

  • Pydantic model updated or no update needed

Cross-refs, links to issues, etc:

Fixes #5645

Real-world example: litellm-feedstock had stale uvicorn constraint >=0.31.1,<0.32.0 instead of upstream's >=0.32.1,<1.0.0, breaking packages like notebook_intelligence.

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>
Copy link
Contributor

@beckermr beckermr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR needs testing against v1 recipes. Those recipes put run constraints in a different part of the recipe.

# For host/run sections: show add/remove suggestions
df_cf = ""
for sec in SECTIONS_TO_PARSE:
for sec in ["host", "run"]: # Exclude run_constrained from add suggestions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This set of sections should be made a constant above. Maybe we call it SECTIONS_TO_HINT?

@ctcjab
Copy link
Author

ctcjab commented Mar 2, 2026

@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.

@beckermr
Copy link
Contributor

beckermr commented Mar 2, 2026

OK. happy to wait on this PR until you have time.

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.

update-grayskull does not update run_constrained version constraints

2 participants