OpenQuizz
Une application de gestion des contenus pédagogiques
CandidateEvaluator Class Reference

Public Member Functions

def create (cls, project_name, target_python=None, prefer_binary=False, allow_all_prereleases=False, specifier=None, hashes=None)
 
def __init__ (self, project_name, supported_tags, specifier, prefer_binary=False, allow_all_prereleases=False, hashes=None)
 
def get_applicable_candidates (self, candidates)
 
def sort_best_candidate (self, candidates)
 
def compute_best_candidate (self, candidates)
 

Detailed Description

Responsible for filtering and sorting candidates for installation based
on what tags are valid.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  project_name,
  supported_tags,
  specifier,
  prefer_binary = False,
  allow_all_prereleases = False,
  hashes = None 
)
:param supported_tags: The PEP 425 tags supported by the target
    Python in order of preference (most preferred first).

Member Function Documentation

◆ compute_best_candidate()

def compute_best_candidate (   self,
  candidates 
)
Compute and return a `BestCandidateResult` instance.

◆ create()

def create (   cls,
  project_name,
  target_python = None,
  prefer_binary = False,
  allow_all_prereleases = False,
  specifier = None,
  hashes = None 
)
Create a CandidateEvaluator object.

:param target_python: The target Python interpreter to use when
    checking compatibility. If None (the default), a TargetPython
    object will be constructed from the running Python.
:param specifier: An optional object implementing `filter`
    (e.g. `packaging.specifiers.SpecifierSet`) to filter applicable
    versions.
:param hashes: An optional collection of allowed hashes.

◆ get_applicable_candidates()

def get_applicable_candidates (   self,
  candidates 
)
Return the applicable candidates from a list of candidates.

◆ sort_best_candidate()

def sort_best_candidate (   self,
  candidates 
)
Return the best candidate per the instance's sort order, or None if
no candidate is acceptable.

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