Skip to main content

Resolve abstract dependencies into concrete ones

Project description

ResolveLib at the highest level provides a Resolver class that includes dependency resolution logic. You give it some things, and a little information on how it should interact with them, and it will spit out a resolution result.

Intended Usage

import resolvelib

# Things I want to resolve.
requirements = [...]

# Implement logic so the resolver understands the requirement format.
class MyProvider:
    ...

provider = MyProvider()
reporter = resolvelib.BaseReporter()

# Create the (reusable) resolver.
resolver = resolvelib.Resolver(provider, reporter)

# Kick off the resolution process, and get the final result.
result = resolver.resolve(requirements)

The provider interface is specified in resolvelib.providers. You don’t need to inherit anything, however, only need to implement the right methods.

Terminology

The intention of this section is to unify the terms we use when talking about this code base, and packaging in general, to avoid confusion. Class and variable names in the code base should try to stick to terms defined here.

Things passed into Resolver.resolve() and provided by the provider are all considered opaque. They don’t need to adhere to this set of terminologies. Nothing can go wrong as long as the provider implementers can keep their heads straight.

Package

A thing that can be installed. A Package can have one or more versions available for installation.

Version

A string, usually in a number form, describing a snapshot of a Package. This number should increase when a Package posts a new snapshot, i.e a higher number means a more up-to-date snapshot.

Specifier

A collection of one or more Versions. This could be a wildcard, indicating that any Version is acceptable.

Candidate

A combination of a Package and a Version, i.e. a “concrete requirement”. Python people sometimes call this a “locked” or “pinned” dependency. Both of “requirement” and “dependency”, however, SHOULD NOT be used when describing a Candidate, to avoid confusion.

Some resolver architectures refer this as a “specification”, but it is not used here to avoid confusion with a Specifier.

Requirement

An intention to acquire a needed package, i.e. an “abstract requirement”. A “dependency”, if not clarified otherwise, also refers to this concept.

A Requirement should specify two things: a Package, and a Specifier.

Contributing

Please see developer documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

resolvelib-1.2.0.tar.gz (23.4 kB view details)

Uploaded Source

Built Distribution

resolvelib-1.2.0-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file resolvelib-1.2.0.tar.gz.

File metadata

  • Download URL: resolvelib-1.2.0.tar.gz
  • Upload date:
  • Size: 23.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for resolvelib-1.2.0.tar.gz
Algorithm Hash digest
SHA256 c27fbb5098acd7dfc01fb2be3724bd0881168edc2bd3b4dc876ca3f46b8e4a3d
MD5 1a4325000fb6801aaf33071ff1aee8e4
BLAKE2b-256 0557c5c178e21968123cf2aa90501b5fc14a48e342612695863333f4b70510ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for resolvelib-1.2.0.tar.gz:

Publisher: release.yml on sarugaku/resolvelib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file resolvelib-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: resolvelib-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for resolvelib-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8e3e2000beaf53fdfd8772fda1a7b1df97e803ab7c8925621bbb87c4d187a94d
MD5 0c860a73d81f6c606370c505b1d08c43
BLAKE2b-256 c7dda7bd1227a77403d894ac6c71bf55f6aff39cb485b268d285a158209d5963

See more details on using hashes here.

Provenance

The following attestation bundles were made for resolvelib-1.2.0-py3-none-any.whl:

Publisher: release.yml on sarugaku/resolvelib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page