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

Public Member Functions

def __init__ (self, base, extras)
 
def __str__ (self)
 
def __repr__ (self)
 
def __hash__ (self)
 
def __eq__ (self, other)
 
def project_name (self)
 
def name (self)
 
def version (self)
 
def format_for_error (self)
 
def is_installed (self)
 
def is_editable (self)
 
def source_link (self)
 
def iter_dependencies (self, with_requires)
 
def get_install_requirement (self)
 

Data Fields

 base
 
 extras
 

Detailed Description

A candidate that has 'extras', indicating additional dependencies.

Requirements can be for a project with dependencies, something like
foo[extra].  The extras don't affect the project/version being installed
directly, but indicate that we need additional dependencies. We model that
by having an artificial ExtrasCandidate that wraps the "base" candidate.

The ExtrasCandidate differs from the base in the following ways:

1. It has a unique name, of the form foo[extra]. This causes the resolver
   to treat it as a separate node in the dependency graph.
2. When we're getting the candidate's dependencies,
   a) We specify that we want the extra dependencies as well.
   b) We add a dependency on the base candidate.
      See below for why this is needed.
3. We return None for the underlying InstallRequirement, as the base
   candidate will provide it, and we don't want to end up with duplicates.

The dependency on the base candidate is needed so that the resolver can't
decide that it should recommend foo[extra1] version 1.0 and foo[extra2]
version 2.0. Having those candidates depend on foo=1.0 and foo=2.0
respectively forces the resolver to recognise that this is a conflict.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  base,
  extras 
)

Member Function Documentation

◆ __eq__()

def __eq__ (   self,
  other 
)

◆ __hash__()

def __hash__ (   self)

◆ __repr__()

def __repr__ (   self)

◆ __str__()

def __str__ (   self)

◆ format_for_error()

def format_for_error (   self)

Reimplemented from Candidate.

◆ get_install_requirement()

def get_install_requirement (   self)

Reimplemented from Candidate.

◆ is_editable()

def is_editable (   self)

Reimplemented from Candidate.

◆ is_installed()

def is_installed (   self)

Reimplemented from Candidate.

◆ iter_dependencies()

def iter_dependencies (   self,
  with_requires 
)

Reimplemented from Candidate.

◆ name()

def name (   self)
The normalised name of the project the candidate refers to

Reimplemented from Candidate.

◆ project_name()

def project_name (   self)
The "project name" of the candidate.

This is different from ``name`` if this candidate contains extras,
in which case ``name`` would contain the ``[...]`` part, while this
refers to the name of the project.

Reimplemented from Candidate.

◆ source_link()

def source_link (   self)

Reimplemented from Candidate.

◆ version()

def version (   self)

Reimplemented from Candidate.

Field Documentation

◆ base

base

◆ extras

extras

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