go-pyresolver

module
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2026 License: Apache-2.0, MIT

README

go-pyresolver

Python dependency resolution for Go: the Python-aware adapter that drives a generic PubGrub solver with PyPI metadata.

Part of RFD 0001 — Native Go PyPI Dependency Resolution.

Status: version solving is implemented. resolver.Resolve takes PEP 508 requirements and an index.MetadataIndex and returns one pinned version per package the requirements transitively reach, or a failure explained in Python terms. Extras and Requires-Python are modeled as packages, so both are resolved and both are explainable.

Deliberately not included: distribution-file (wheel/sdist) selection — a resolution returns versions only — resolution across more than one marker environment at a time, and building sdists to discover their metadata. See CHANGELOG.md.

Where this sits

Three Posit-owned Go modules divide the work:

Module Role
go-python-packaging PEP primitives — PEP 440 versions, PEP 508 requirements and markers, PEP 685 extras, wheel/METADATA parsing, compatibility tags
go-pubgrub The version-solving algorithm, deliberately language-agnostic so it can serve future R or Julia resolution
go-pyresolver (this module) The Python-aware glue between the two, plus metadata retrieval

Packages

Package Scope
pypirsf/ PyPI record layout and dependency-blob decoder for Repository Snapshot Format files
index/ MetadataIndex — the seam between resolver and storage — and its implementations
candidate/ Which versions may be offered (pre-release admission) and in what order to try them
provider/ Adapts Python semantics (notably extras) to the generic solver
resolver/ The public entry point

Where dependency metadata comes from

Resolution needs two things: which versions of a package exist, and what each version requires. Both live in a Repository Snapshot Format (RSF) file, so a resolution reads one local file and makes no per-package network request. That is what makes offline and reproducible resolution possible.

pypirsf/ decodes that file. You supply the file; this module does not fetch it.

The resolver core never makes an HTTP request and never touches a database. It calls MetadataIndex, and the implementation decides where the bytes come from. That is what lets one resolver serve connected PPM, air-gapped PPM, local Python sources, and tests.

Build & test

go build ./...
go test ./...
go vet ./...

Module floor is Go 1.25, matching go-python-packaging (conservative for a public library; PPM consumes it fine at 1.26).

License

Dual-licensed under Apache-2.0 OR MIT at your option. Every source file carries SPDX-License-Identifier: Apache-2.0 OR MIT. See NOTICE for attribution.

Directories

Path Synopsis
Package candidate decides which versions of a package may be offered to the solver, and in what order it should try them.
Package candidate decides which versions of a package may be offered to the solver, and in what order it should try them.
cmd
pyresolve command
Command pyresolve inspects a PyPI Repository Snapshot Format (RSF) file: it reads package and dependency metadata straight out of a local file on disk.
Command pyresolve inspects a PyPI Repository Snapshot Format (RSF) file: it reads package and dependency metadata straight out of a local file on disk.
Package index defines MetadataIndex, the architectural seam between the resolver and storage, and its implementations.
Package index defines MetadataIndex, the architectural seam between the resolver and storage, and its implementations.
Package pep440set is the PEP 440 version-set algebra the resolver hands to the generic PubGrub solver.
Package pep440set is the PEP 440 version-set algebra the resolver hands to the generic PubGrub solver.
Package provider adapts Python packaging semantics to the generic PubGrub solver in github.com/posit-dev/go-pubgrub.
Package provider adapts Python packaging semantics to the generic PubGrub solver in github.com/posit-dev/go-pubgrub.
Package pypirsf reads PyPI dependency metadata out of a Repository Snapshot Format (RSF) file.
Package pypirsf reads PyPI dependency metadata out of a Repository Snapshot Format (RSF) file.
Package resolver is the public entry point of this module: give it PEP 508 requirements and a MetadataIndex, get back one pinned version per package, or a failure explained in Python terms.
Package resolver is the public entry point of this module: give it PEP 508 requirements and a MetadataIndex, get back one pinned version per package, or a failure explained in Python terms.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL