Skip to content

Add Reservoir manifest fetcher to aggregator subpackage - #6

Merged
justincasher merged 8 commits into
LeanPool:mainfrom
justincasher:justin/aggregator-draft
May 9, 2026
Merged

justincasher merged 8 commits into
LeanPool:mainfrom
justincasher:justin/aggregator-draft

Conversation

@justincasher

Copy link
Copy Markdown
Collaborator

Adds python/lean_pool/aggregator/ with a stdlib-only draft that fetches the Reservoir manifest from https://reservoir.lean-lang.org/index/manifest.json, saves it, and prints a summary plus the top 10 packages by stars. Run with uv run python -m lean_pool.aggregator from python/. Filtering logic comes next. Related: #2

@justincasher justincasher changed the title Draft aggregator subpackage Add Reservoir manifest fetcher to aggregator subpackage May 9, 2026
- Pass a 60s timeout to urlopen so a stalled connection cannot hang the CLI.
- Default --output to cache/manifest.json and gitignore cache/ so the
  53 MB Reservoir file does not land at the repo root.
- Rename abbreviated locals (pkg/p/f) to package/output_file per the
  no-abbreviations naming rule.
- Add tests for fetch_manifest (mocked urlopen) and save_manifest
  (round-trip to disk) under python/tests/.
Match the no-print convention used in reservoir.py: route the manifest
summary and top-stars listing through a module logger so the CLI uses
one output channel.
Move test_reservoir.py into tests/aggregator/ so the test tree mirrors
lean_pool/aggregator/. Adds tests/aggregator/__init__.py.
The aggregator CLI now just fetches the manifest and writes it to disk;
the summary stats and top-stars listing are gone. Replace argparse with
click for option parsing and add click as a runtime dependency.
- Define ReservoirManifest TypedDict for fetch_manifest / save_manifest
  signatures instead of dict[str, Any].
- Echo "Saved N packages to <path>" once on success so users see what
  landed without the previous verbose summary.
Replace the loose ReservoirManifest with a full hierarchy that
matches Reservoir's own type definitions in scripts/utils/
(package.py, manifest.py, toolchain.py): Package, PackageVersion,
PackageSource, Build / BuildResult, Dependency / Dependent,
Toolchain. The decoded manifest is now statically typed end to end
instead of relying on dict[str, Any] for nested structures.
@justincasher
justincasher force-pushed the justin/aggregator-draft branch from e160511 to e5eb7f6 Compare May 9, 2026 18:29
@justincasher
justincasher merged commit 67d6f44 into LeanPool:main May 9, 2026
2 checks passed
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