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 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 “specification”, 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 Requirement 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.3.0.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

resolvelib-0.3.0-py2.py3-none-any.whl (10.9 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: resolvelib-0.3.0.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.1

File hashes

Hashes for resolvelib-0.3.0.tar.gz
Algorithm Hash digest
SHA256 9781c2038be2ba3377d075dd3aa8f5f0f7b508b6f59779b1414bea08ed402f1e
MD5 437a3f32a91ea4da4d607802a88f68bf
BLAKE2b-256 e1845c20d9bed18041343eeb537cc2b76aa17c18102ecf5873c12cd78a04cc69

See more details on using hashes here.

File details

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

File metadata

  • Download URL: resolvelib-0.3.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.1

File hashes

Hashes for resolvelib-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8ea817c951ffced489e71be10310c99eee36ff3dca02c24cd0dfe9e42d366da6
MD5 b008e0e0abc57ecd513d11f551f7f54d
BLAKE2b-256 31bd1482992ce30d1466f72338ac85930c18e853d41f5dde0707041f123a7a3e

See more details on using hashes here.

Supported by

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