Repository navigation
feat: fix plans and fix-pr for Poetry projects - #74
Merged
Merged
Conversation
--fix-plan, --apply and the Action's fix-pr now work on Poetry projects, verified with Poetry's resolver, for [tool.poetry.dependencies] and [project] requirements. poetry update --lock never fails when another package holds a fix back, so the holders are read from poetry.lock, Poetry moves them on a copy, and the resulting lock is checked. Exact pins stay exact. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WUfEahsTXEpnGdTvHgNdvD
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The gap
fix-prcovers is not specific to uv. Dependabot's missing full-unlock applies to all Python managers (dependabot-core#16337), and Renovate's maintainers answered that security fixes for transitive packages inpoetry.lockare "not supported/configurable" (renovate discussion #28776). Poetry has many more production projects than uv, and until now they got none of--fix-plan,--applyorfix-pr.How Poetry differs
poetry update --lock urllib3never fails when botocore holds urllib3 back; it resolves and leaves it. So there is no error to parse. depquiet reads the holders frompoetry.lock(every package's constraints on its dependencies), relaxes their own requirements on a temporary copy, lets Poetry resolve, and reads which versions it chose. It then verifies the final edits together on a fresh copy.--upgrade-package name==version. A range can land above the fix; an exact pin stays exact at the fix version. The plan reports where each package ends.What
poetryplan.py: Poetry constraint reading (^,~, bare versions, ranges;||and VCS/path are left alone), holder detection from the lock, the probe/verify plan, greedy fallback when the set doesn't resolve together.fixplan.py:FixPlan.tool, apoetryedit kind that changes only that package's line inside[tool.poetry...]tables (another package pinned to the same version string is untouched), tool-aware apply (restorespyproject.tomlandpoetry.lockon failure;POETRY_VIRTUALENVS_CREATE=false), wording and PR description.poetry.lockand nouv.lockuses the Poetry plan.--check-fixesalone points Poetry users to--fix-plan.fix-pris on and apoetry.lockis found; commitspoetry.lock.Verified with real Poetry 2.5.1 and pip-audit
requests = "2.31.0",botocore = "1.29.0"requests>=2.31,<2.32,botocore~=1.29.0,jinja2==3.1.2, dev groupOn GitHub: depquiet-fixpr-test#2, opened by the Action from this branch on a Poetry project in a subfolder:
poetry-app/pyproject.toml(+2 −2) andpoetry-app/poetry.lock.Tests
tests/test_poetryplan.py(36, resolver faked): constraint semantics, line-scoped edits, holder moved and pins kept exact, range that needs no edit, holder with no release that allows the fix, partial plans, unreadable constraints, apply and restore. One more Action test forpoetry.lock. 2690 passed; ruff, mypy and actionlint are clean.Limits (documented)
sourcerepositories, plugins and private indexes are whatever the user's Poetry is configured with; not tested here.exclude-neweris a uv setting).Generated by Claude Code