OpenQuizz
Une application de gestion des contenus pédagogiques
DependencyFinder Class Reference
Inheritance diagram for DependencyFinder:
Collaboration diagram for DependencyFinder:

Public Member Functions

def __init__ (self, locator=None)
 
def add_distribution (self, dist)
 
def remove_distribution (self, dist)
 
def get_matcher (self, reqt)
 
def find_providers (self, reqt)
 
def try_to_replace (self, provider, other, problems)
 
def find (self, requirement, meta_extras=None, prereleases=False)
 

Data Fields

 locator
 
 scheme
 
 provided
 
 dists
 
 dists_by_name
 
 reqts
 

Detailed Description

Locate dependencies for distributions.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  locator = None 
)
Initialise an instance, using the specified locator
to locate distributions.

Member Function Documentation

◆ add_distribution()

def add_distribution (   self,
  dist 
)
Add a distribution to the finder. This will update internal information
about who provides what.
:param dist: The distribution to add.

◆ find()

def find (   self,
  requirement,
  meta_extras = None,
  prereleases = False 
)
Find a distribution and all distributions it depends on.

:param requirement: The requirement specifying the distribution to
            find, or a Distribution instance.
:param meta_extras: A list of meta extras such as :test:, :build: and
            so on.
:param prereleases: If ``True``, allow pre-release versions to be
            returned - otherwise, don't return prereleases
            unless they're all that's available.

Return a set of :class:`Distribution` instances and a set of
problems.

The distributions returned should be such that they have the
:attr:`required` attribute set to ``True`` if they were
from the ``requirement`` passed to ``find()``, and they have the
:attr:`build_time_dependency` attribute set to ``True`` unless they
are post-installation dependencies of the ``requirement``.

The problems should be a tuple consisting of the string
``'unsatisfied'`` and the requirement which couldn't be satisfied
by any distribution known to the locator.

◆ find_providers()

def find_providers (   self,
  reqt 
)
Find the distributions which can fulfill a requirement.

:param reqt: The requirement.
 :type reqt: str
:return: A set of distribution which can fulfill the requirement.

◆ get_matcher()

def get_matcher (   self,
  reqt 
)
Get a version matcher for a requirement.
:param reqt: The requirement
:type reqt: str
:return: A version matcher (an instance of
 :class:`distlib.version.Matcher`).

◆ remove_distribution()

def remove_distribution (   self,
  dist 
)
Remove a distribution from the finder. This will update internal
information about who provides what.
:param dist: The distribution to remove.

◆ try_to_replace()

def try_to_replace (   self,
  provider,
  other,
  problems 
)
Attempt to replace one provider with another. This is typically used
when resolving dependencies from multiple sources, e.g. A requires
(B >= 1.0) while C requires (B >= 1.1).

For successful replacement, ``provider`` must meet all the requirements
which ``other`` fulfills.

:param provider: The provider we are trying to replace with.
:param other: The provider we're trying to replace.
:param problems: If False is returned, this will contain what
         problems prevented replacement. This is currently
         a tuple of the literal string 'cantreplace',
         ``provider``, ``other``  and the set of requirements
         that ``provider`` couldn't fulfill.
:return: True if we can replace ``other`` with ``provider``, else
 False.

Field Documentation

◆ dists

dists

◆ dists_by_name

dists_by_name

◆ locator

locator

◆ provided

provided

◆ reqts

reqts

◆ scheme

scheme

The documentation for this class was generated from the following file: