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

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

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

provider = MyProvider()

# Create the (reusable) resolver.
from resolvelib import Resolver
resolver = Resolver(provider)

# 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 post 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 (e.g. Molinillo) refer this as a “specicifation”, but this is not chosen 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 Requiremnt should specify two things: a Package, and a Specifier.

Dependency

A dependency can be either a requirement, or a candidate. In implementations you can treat it as the parent class and/or a protocol of the two.

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-0.2.2.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

resolvelib-0.2.2-py2.py3-none-any.whl (8.7 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: resolvelib-0.2.2.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0

File hashes

Hashes for resolvelib-0.2.2.tar.gz
Algorithm Hash digest
SHA256 8734e53271ef98f38a2c99324d5e7905bc00c97dc3fc5bb7d83c82a979e71c04
MD5 89794f19d61c428fbf378c91e36c3df6
BLAKE2b-256 251ea08e328bd1286805ecec9defb1a8eff6525b7c67b0d700994b53a8ca869e

See more details on using hashes here.

File details

Details for the file resolvelib-0.2.2-py2.py3-none-any.whl.

File metadata

  • Download URL: resolvelib-0.2.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0

File hashes

Hashes for resolvelib-0.2.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6c4c6690b0bdd78bcc002e1a5d1b6abbde58c694a6ea1838f165b20d2c943db7
MD5 e22348e8d28933a2aa98327d1f9788ff
BLAKE2b-256 4707162748bcea9f9dfd2ba593b0fb562d4959cb9577090e5cd3028e8743218a

See more details on using hashes here.

Supported by

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