Skip to content

Check the requirements of a satisfied installed dependency, recursively (#81) - #92

Open
morisil wants to merge 5 commits into
issue-79-top-level-py310from
issue-81-satisfied-requirements
Open

morisil wants to merge 5 commits into
issue-79-top-level-py310from
issue-81-satisfied-requirements

Conversation

@morisil

@morisil morisil commented Nov 13, 2026

Copy link
Copy Markdown
Member

Fixes #81

Stacked on #91 (fix of #79) → #82 (fix of #59) → #70 (fix of #25) — merge #70, then #82, then #91, then this one (bottom-up, see CLAUDE.md).

The PLAN script took a requirement satisfied by an installed distribution of the dependency directory without looking at that distribution's own requirements —
so a dependency installed earlier with an older, now unsatisfiable dependency of its own was kept, and the missing or incompatible transitive requirement surfaced only at import time.

Now a satisfied installed distribution is checked recursively: each of its Requires-Dist (whose environment marker applies) must be satisfied too, otherwise the requirement counts as missing and goes to the installer.

  • Requirements gated on an extra (extra == "…") are skipped by design — which extras were requested is not recorded in the dist-info (see Extras of an installed dependency are never installed #47).
  • One accepts_version helper decides whether an installed version satisfies a specifier, for the top-level and the transitive check alike — it also fixes a pre-existing crash on an installed version which is not a valid PEP 440 version (InvalidVersion).
  • METADATA is read once per distribution; the egg-info requires.txt fallback was dropped (installs into the dependency directory always write .dist-info).
  • README describes the check.

Merged with the final state of #79 (81fbe21): ./gradlew build passes on Python 3.12, and the PythonDependencies tests on 3.10.

Review

3 rounds; the last one found no blocking issues, and the remaining polish was applied (shared accepts_version, one METADATA read, README, cleanups).

🤖 Generated with Claude Code

https://claude.ai/code/session_01FJmHQ3jHRbVdpwUiNUkApG

morisil and others added 5 commits November 11, 2026 23:53
…onger satisfied (#81)

When a declared requirement is satisfied by a distribution of the dependency directory,
the PLAN now also checks its Requires-Dist, with markers and the requested extras,
recursively with memoization and cycle protection, against what the dependency directory
and the environment hold, so that a requirement replaced by another version declared by
another snippet makes the installer resolve the dependency again.
A URL requirement of an installed distribution counts as satisfied by a distribution
installed from the same URL, whatever its revision or content, so that it is not installed
again on every use.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FJmHQ3jHRbVdpwUiNUkApG
… checking installed requirements (#81)

A requirement whose marker mentions extra is followed only for a requested extra,
as uv and pip before 23.1 never install one of extra == "", which was planned missing
on every use. An installed version which is not PEP 440, like 1.1build1 of a Debian
package, satisfies a requirement, instead of failing the plan with InvalidVersion.
The distributions, their versions and requirements are read once per name.
The README tells about the check of the requirements of installed dependencies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FJmHQ3jHRbVdpwUiNUkApG
…ents (#81)

An installer can tell a requested extra by another normalization than the one of PLAN,
or not at all without Provides-Extra, so a requirement of a requested extra which it never
installs was planned missing on every use. Like before, the requirements of extras are not
checked (#47). Each declared dependency is looked up once, and the README tells that
a distribution of the environment no longer satisfying a requirement fails the installation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FJmHQ3jHRbVdpwUiNUkApG
…metadata once (#81)

The declared requirement and the requirement of an installed distribution share one check
of the version, which accepts a version not of PEP 440, like 1.1build1 of a Debian package,
which packaging 22 to 24 failed to compare with InvalidVersion, failing the plan.
The metadata of a distribution is parsed once, for its version and requirements.
The README tells that the installation is attempted and fails with the conflict when the
unsatisfied requirement cannot be installed, and that code with conflicting requirements
replaces the versions back and forth.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FJmHQ3jHRbVdpwUiNUkApG
Keep the is_imported of #79 for the constraints of the imported distributions,
with the is_in_dependencies helper of #81,
and let writeDistInfo of the tests take both the topLevel content and record of #79
and the requires and directUrl of #81.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FJmHQ3jHRbVdpwUiNUkApG
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.

1 participant