• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

src/H22-Jun-2021-1,128858

CHANGELOG.rstH A D22-Jun-20215.1 KiB15190

LICENSEH A D22-Oct-2020751 1411

MANIFEST.inH A D07-Mar-202167 32

PKG-INFOH A D22-Jun-20213.9 KiB10879

README.rstH A D27-Nov-20202.5 KiB8658

pyproject.tomlH A D27-Nov-2020687 3125

setup.cfgH A D22-Jun-20211.1 KiB7062

setup.pyH A D22-Oct-202037 32

README.rst

1==========
2ResolveLib
3==========
4
5ResolveLib at the highest level provides a ``Resolver`` class that includes
6dependency resolution logic. You give it some things, and a little information
7on how it should interact with them, and it will spit out a resolution result.
8
9
10Intended Usage
11==============
12
13::
14
15    import resolvelib
16
17    # Things I want to resolve.
18    requirements = [...]
19
20    # Implement logic so the resolver understands the requirement format.
21    class MyProvider:
22        ...
23
24    provider = MyProvider()
25    reporter = resolvelib.BaseReporter()
26
27    # Create the (reusable) resolver.
28    resolver = resolvelib.Resolver(provider, reporter)
29
30    # Kick off the resolution process, and get the final result.
31    result = resolver.resolve(requirements)
32
33The provider interface is specified in ``resolvelib.providers``. You don't
34need to inherit anything, however, only need to implement the right methods.
35
36
37Terminology
38===========
39
40The intention of this section is to unify the terms we use when talking about
41this code base, and packaging in general, to avoid confusion. Class and
42variable names in the code base should try to stick to terms defined here.
43
44Things passed into ``Resolver.resolve()`` and provided by the provider are all
45considered opaque. They don't need to adhere to this set of terminologies.
46Nothing can go wrong as long as the provider implementers can keep their heads
47straight.
48
49Package
50-------
51
52A thing that can be installed. A Package can have one or more versions
53available for installation.
54
55Version
56-------
57
58A string, usually in a number form, describing a snapshot of a Package. This
59number should increase when a Package post a new snapshot, i.e. a higher number
60means a more up-to-date snapshot.
61
62Specifier
63---------
64
65A collection of one or more Versions. This could be a wildcard, indicating that
66any Version is acceptable.
67
68Candidate
69---------
70
71A combination of a Package and a Version, i.e. a "concrete requirement". Python
72people sometimes call this a "locked" or "pinned" dependency. Both of
73"requirement" and "dependency", however, SHOULD NOT be used when describing a
74Candidate, to avoid confusion.
75
76Some resolver architectures refer this as a "specification", but it is not
77used here to avoid confusion with a *Specifier*.
78
79Requirement
80-----------
81
82An intention to acquire a needed package, i.e. an "abstract requirement". A
83"dependency", if not clarified otherwise, also refers to this concept.
84
85A Requirement should specify two things: a Package, and a Specifier.
86