Skip to content

DependencyTable: requirements are resolved by pyTooling's Resolver - #62

Merged
Paebbels merged 2 commits into
devfrom
claude/dependency-table-resolver
Oct 20, 2026
Merged

Paebbels merged 2 commits into
devfrom
claude/dependency-table-resolver

Conversation

@pytooling-claude

@pytooling-claude pytooling-claude Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

The dependency-table directive resolved requirements with its own code; pyTooling v10.0.0-rc4 ships pyTooling.Dependency.Resolver, which does the same - in parallel per level, with statuses for what couldn't be resolved. The directive now renders what the resolver returns.

Changes

  • pyTooling.Sphinx.DependencyTable:
    • A table resolves its requirements with Resolver(index, strategy=ResolutionStrategy.Eager, limit=...): :depth: is the resolver's limit (0, the default, is unlimited), and every level is downloaded in parallel before the table is rendered. Rows and trees render the ResolvedRequirements: a dependency closing a cycle (ResolutionStatus.Cycle) isn't listed, dependencies below the limit (LimitReached) become the marker … N more dependencies not expanded, and a requirement not resolved to a release (unknown project, no matching release, undescribed release, index failure) shows not evaluated, as before.
    • A requirement naming extras lists their requirements in its tree too, as an installer installs them: pyTooling[pypi] lists aiohttp, packaging and requests, where it listed none.
    • A package entrypoint ({"package": "pyTooling[yaml]"}) is read with Resolver.ResolvePackages; an unknown package, a package without a release and an unknown extra are reported with pyTooling's messages, the known extras included.
    • DependencyCollector: new Resolve(requirements, limit) and PublishedRequirements(packages); Project(), Details() and their caches are removed - the shared PythonPackageIndex keeps every project and release it downloaded. ResolutionCount replaces RequestCount: the stopwatch measures each resolution, as the requests are no longer sent one by one. The build's final log line says N resolution(s) against the package index.
    • Warnings reported while resolving: an UnknownLicenseWarning naming its project (ProjectName, Dependency: release warnings carry the project name and version pyTooling#608) is recorded in UnresolvedLicenses; every other warning is a Sphinx warning, as before.
    • Removed private helpers: _OneLevelDown, _PublishedRequirements, _SelectRelease. New: _SelectedRelease, DependencyTable._Dependencies.

Bug Fixes

  • pyTooling.Sphinx.DependencyTable: a tree could show the requirements of an old release instead of the newest matching one. In a build of the tables requirements.txt and pyTooling[pypi], aiohttp ≥3.12 was listed with chardet and idna-ssl (aiohttp 3.7's requirements) and caused a license-override report for chardet; it now lists aiohttp 3.14.5's aiohappyeyeballs, aiosignal, frozenlist, propcache, ... The cause in the removed code wasn't traced.

Documentation

  • dependency-table: how the requirements are resolved (newest matching release, pre-releases, extras, cycles, parallel downloads).
  • doc/News.rst: entry under v0.1.0.

Unit Tests

  • tests/unit/DependencyTable.py:
    • Dependency trees: the trees are built from resolved requirements with statuses (Resolved, Cycle, LimitReached) instead of a table faking _SelectRelease; new Not resolved.
    • Collecting unresolved licenses and Reporting warnings test DependencyCollector._ReportWarnings: two spellings are one entry; a warning without a project name is logged; a broken requirement and a critical warning are logged.
    • 427 passed, against pyTooling 10.0.0rc5 from PyPI and pyTooling dev.
  • End-to-end: a two-table build (requirements.txt with :depth: 2, pyTooling[pypi]) renders the same rows as before except the two changes above; 2.8 s instead of 4.8 s.

Others

  • requirements.txt: pyTooling[pypi] >= 10.0.0rc5 (was rc4), for UnknownLicenseWarning.ProjectName.

Related Issues and Pull-Requests

pyTooling 10.0.0rc4 ships 'pyTooling.Dependency.Resolver'; the directive's own resolution goes:
'DependencyCollector.Project'/'Details' and their caches, '_PublishedRequirements', '_SelectRelease', and the depth
and cycle handling of the dependency trees. A table resolves its requirements with the strategy 'Eager' and its
':depth:' as the limit, so every level is downloaded in parallel before rendering; the rows and trees render the
'ResolvedRequirement's - 'Cycle' is left out, 'LimitReached' becomes the limit marker. A package entrypoint asks
'Resolver.ResolvePackages' with limit 0. All tables share the collector's 'PythonPackageIndex', which keeps what it
downloaded. 'ResolutionCount' replaces 'RequestCount', as requests are no longer counted one by one.

An 'UnknownLicenseWarning' naming its project (pyTooling/pyTooling#608) is recorded by 'ProjectName'; one that
doesn't - pyTooling 10.0.0rc4 - is reported as a Sphinx warning with its notes.

Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
@pytooling-claude
pytooling-claude Bot requested a review from Paebbels as a code owner October 20, 2026 18:46
@pytooling-claude pytooling-claude Bot added Bug Something isn't working Documentation Improvements or additions to documentation Enhancement New feature or request labels Oct 20, 2026
@codacy-production

codacy-production Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics -23 complexity · 2 duplication

Metric Results
Complexity -23
Duplication 2

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@pytooling-claude pytooling-claude Bot mentioned this pull request Oct 20, 2026
@codecov

codecov Bot commented Oct 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 55.69620% with 35 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.51%. Comparing base (1f4465c) to head (151a8b3).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
pyTooling/Sphinx/DependencyTable.py 55.69% 33 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev      #62      +/-   ##
==========================================
+ Coverage   85.46%   85.51%   +0.04%     
==========================================
  Files          24       24              
  Lines        4886     4854      -32     
  Branches      786      776      -10     
==========================================
- Hits         4176     4151      -25     
+ Misses        598      594       -4     
+ Partials      112      109       -3     
Flag Coverage Δ
unittests 85.51% <55.69%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…ound.

rc5 is on PyPI, so the floor rises to it and the getattr fallback and the test's warning
subclass are no longer needed.

Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
@Paebbels
Paebbels merged commit 8bf5f9b into dev Oct 20, 2026
12 of 41 checks passed
@Paebbels
Paebbels deleted the claude/dependency-table-resolver branch October 20, 2026 20:44
This was referenced Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Documentation Improvements or additions to documentation Enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants