Giter VIP home page Giter VIP logo

resolvelib's Introduction

ResolveLib

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.

resolvelib's People

Contributors

dependabot[bot] avatar frostming avatar mcsinyx avatar pfmoore avatar pradyunsg avatar techalchemy avatar uranusjr avatar xavfernandez avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.