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

Uploaded Source

Built Distribution

resolvelib-0.8.1-py2.py3-none-any.whl (16.1 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: resolvelib-0.8.1.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/58.2.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.8.6

File hashes

Hashes for resolvelib-0.8.1.tar.gz
Algorithm Hash digest
SHA256 c6ea56732e9fb6fca1b2acc2ccc68a0b6b8c566d8f3e78e0443310ede61dbd37
MD5 fbd5fbcac181644333390ea6a71c4edc
BLAKE2b-256 ac209541749d77aebf66dd92e2b803f38a50e3a5c76e7876f45eb2b37e758d82

See more details on using hashes here.

File details

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

File metadata

  • Download URL: resolvelib-0.8.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/58.2.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.8.6

File hashes

Hashes for resolvelib-0.8.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d9b7907f055c3b3a2cfc56c914ffd940122915826ff5fb5b1de0c99778f4de98
MD5 9b92af9306678e346cd7f946a6419748
BLAKE2b-256 98c046cfa3f56e43033b705965120058c018375600fa8fdb44c4e53d75820673

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