Skip to content

feat: fix plans and fix-pr for Poetry projects - #74

Merged
samuelrojas-dev merged 1 commit into
mainfrom
feat/poetry-fix-plan
Nov 15, 2026
Merged

samuelrojas-dev merged 1 commit into
mainfrom
feat/poetry-fix-plan

Conversation

@samuelrojas-dev

Copy link
Copy Markdown
Owner

Why

The gap fix-pr covers 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 in poetry.lock are "not supported/configurable" (renovate discussion #28776). Poetry has many more production projects than uv, and until now they got none of --fix-plan, --apply or fix-pr.

How Poetry differs

  • poetry update --lock urllib3 never fails when botocore holds urllib3 back; it resolves and leaves it. So there is no error to parse. depquiet reads the holders from poetry.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.
  • Poetry has no --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, a poetry edit 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 (restores pyproject.toml and poetry.lock on failure; POETRY_VIRTUALENVS_CREATE=false), wording and PR description.
  • CLI: a project with poetry.lock and no uv.lock uses the Poetry plan. --check-fixes alone points Poetry users to --fix-plan.
  • Action: installs Poetry when fix-pr is on and a poetry.lock is found; commits poetry.lock.

Verified with real Poetry 2.5.1 and pip-audit

Project Before After
Legacy table, requests = "2.31.0", botocore = "1.29.0" 10 alerts 0
PEP 621, requests>=2.31,<2.32, botocore~=1.29.0, jinja2==3.1.2, dev group 16 alerts 1 (pytest, dev-only, already filtered)

On 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) and poetry-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 for poetry.lock. 2690 passed; ruff, mypy and actionlint are clean.

Limits (documented)

  • Poetry source repositories, plugins and private indexes are whatever the user's Poetry is configured with; not tested here.
  • Holders are followed three levels deep.
  • No cooldown handling for Poetry (exclude-newer is a uv setting).

Generated by Claude Code

--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-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 86.77419% with 41 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/depquiet/poetryplan.py 85.14% 37 Missing ⚠️
src/depquiet/cli.py 66.66% 2 Missing ⚠️
src/depquiet/fixplan.py 96.36% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@samuelrojas-dev
samuelrojas-dev merged commit a03e5a9 into main Nov 15, 2026
11 checks passed
@samuelrojas-dev
samuelrojas-dev deleted the feat/poetry-fix-plan branch November 15, 2026 04:17
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.

3 participants