Repository navigation
Commit 6bcfeed
* Start fix for #740
Assisted-by: Claude Code:claude-opus-5-5
* Warn when a pip constraints file gets a link pin
A common pip layout reuses requirements.txt as constraints, e.g. a
requirements-dev.txt with `-c requirements.txt`. Hosted and vendored
modes rewrite the patched pin there into a link (a URL or a vendored
wheel path), which pip 20.3.x and 21.0.x refuse in a constraints file
("Links are not allowed as constraints"). Installs on those pips then
failed with no hint from the scan.
Both modes still rewrite the pin, but now name every sibling file that
reads an edited requirements file as constraints:
redirect_requirements_constraints_link (hosted) and
vendor_requirements_constraints_link (vendored, dry run included).
The `-c` reader shares pip's option grammar with the `-r` include
reader, so `-c a -r b` still follows only `b`, as pip does.
Fixes #740
Assisted-by: Claude Code:claude-opus-5-5
* Keep warning about -c readers on every run
Review follow-ups for the constraints-link warning:
- Hosted and vendored re-runs keep naming each `-c` reader while the
link pin stays in place, not only the run that writes it. The hosted
check now runs once after the rewrite settles, from the confirmed
requirements pins, with each package named once.
- A vendored dry run takes its target files from the real plan (the
planner's files, or the superseded entry's), so it matches the wet
run for uv / Pipenv exports and re-wires.
- Readers are also found in other top-level directories when named
like requirements (docs/requirements.txt), skipping hidden and
dependency dirs; files without `-c` bytes are not parsed.
- `-r` and `-c` targets resolve through one helper, and an empty
`--constraint=` no longer swallows the next word.
Assisted-by: Claude Code:claude-opus-5-5
* Test constraints warning on re-runs
Assisted-by: Claude Code:claude-opus-5-5
* Warn about -c readers on in-sync sibling runs
Bugbot follow-ups: an already-wired uv / Pipenv lock whose exported
requirements.txt is wired (or, in a dry run, would be) now names its
-c readers too, and so does an in-sync run that rebuilds a missing
wheel.
Assisted-by: Claude Code:claude-opus-5-5
* Document docs/ constraint readers in the CLI contract
constraint_readers_in also scans requirements-named files in other
top-level directories (docs/requirements.txt, the Read the Docs layout),
but both contract rows said only the root and requirements*/ dirs were
searched, so a user reading the contract would not expect the warning
for a docs/ reader.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 6395098 commit 6bcfeed
5 files changed
Lines changed: 650 additions & 10 deletions
File tree
- crates
- socket-patch-cli
- tests
- socket-patch-core/src
- hosted
- vendor
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1623 | 1623 | | |
1624 | 1624 | | |
1625 | 1625 | | |
| 1626 | + | |
1626 | 1627 | | |
1627 | 1628 | | |
1628 | 1629 | | |
| |||
1675 | 1676 | | |
1676 | 1677 | | |
1677 | 1678 | | |
| 1679 | + | |
1678 | 1680 | | |
1679 | 1681 | | |
1680 | 1682 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
436 | 592 | | |
437 | 593 | | |
438 | 594 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
1765 | 1766 | | |
1766 | 1767 | | |
1767 | 1768 | | |
| 1769 | + | |
| 1770 | + | |
1768 | 1771 | | |
1769 | 1772 | | |
1770 | 1773 | | |
| |||
1777 | 1780 | | |
1778 | 1781 | | |
1779 | 1782 | | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
1780 | 1825 | | |
1781 | 1826 | | |
1782 | 1827 | | |
| |||
0 commit comments