Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
pip._internal.resolution.resolvelib.candidates.ExtrasCandidate Class Reference
Inheritance diagram for pip._internal.resolution.resolvelib.candidates.ExtrasCandidate:
Inheritance graph
[legend]
Collaboration diagram for pip._internal.resolution.resolvelib.candidates.ExtrasCandidate:
Collaboration graph
[legend]

Public Member Functions

None __init__ (self, BaseCandidate base, FrozenSet[str] extras, *Optional[InstallRequirement] comes_from=None)
 
str __str__ (self)
 
str __repr__ (self)
 
int __hash__ (self)
 
bool __eq__ (self, Any other)
 
NormalizedName project_name (self)
 
str name (self)
 
CandidateVersion version (self)
 
str format_for_error (self)
 
bool is_installed (self)
 
bool is_editable (self)
 
Optional[Linksource_link (self)
 
Iterable[Optional[Requirement]] iter_dependencies (self, bool with_requires)
 
Optional[InstallRequirementget_install_requirement (self)
 

Public Attributes

 base
 
 extras
 
 version
 

Protected Member Functions

None _warn_invalid_extras (self, FrozenSet[str] requested, FrozenSet[str] valid)
 
FrozenSet[str] _calculate_valid_requested_extras (self)
 

Protected Attributes

 _unnormalized_extras
 
 _comes_from
 

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__()

None pip._internal.resolution.resolvelib.candidates.ExtrasCandidate.__init__ (   self,
BaseCandidate  base,
FrozenSet[str]  extras,
*Optional[InstallRequirement]   comes_from = None 
)
:param comes_from: the InstallRequirement that led to this candidate if it
    differs from the base's InstallRequirement. This will often be the
    case in the sense that this candidate's requirement has the extras
    while the base's does not. Unlike the InstallRequirement backed
    candidates, this requirement is used solely for reporting purposes,
    it does not do any leg work.

Member Function Documentation

◆ _calculate_valid_requested_extras()

FrozenSet[str] pip._internal.resolution.resolvelib.candidates.ExtrasCandidate._calculate_valid_requested_extras (   self)
protected
Get a list of valid extras requested by this candidate.

The user (or upstream dependant) may have specified extras that the
candidate doesn't support. Any unsupported extras are dropped, and each
cause a warning to be logged here.

◆ _warn_invalid_extras()

None pip._internal.resolution.resolvelib.candidates.ExtrasCandidate._warn_invalid_extras (   self,
FrozenSet[str]  requested,
FrozenSet[str]  valid 
)
protected
Emit warnings for invalid extras being requested.

This emits a warning for each requested extra that is not in the
candidate's ``Provides-Extra`` list.

◆ format_for_error()

str pip._internal.resolution.resolvelib.candidates.ExtrasCandidate.format_for_error (   self)

◆ get_install_requirement()

Optional[InstallRequirement] pip._internal.resolution.resolvelib.candidates.ExtrasCandidate.get_install_requirement (   self)

◆ is_editable()

bool pip._internal.resolution.resolvelib.candidates.ExtrasCandidate.is_editable (   self)

◆ is_installed()

bool pip._internal.resolution.resolvelib.candidates.ExtrasCandidate.is_installed (   self)

◆ iter_dependencies()

Iterable[Optional[Requirement]] pip._internal.resolution.resolvelib.candidates.ExtrasCandidate.iter_dependencies (   self,
bool  with_requires 
)

◆ name()

str pip._internal.resolution.resolvelib.candidates.ExtrasCandidate.name (   self)
The normalised name of the project the candidate refers to

Reimplemented from pip._internal.resolution.resolvelib.base.Candidate.

◆ project_name()

NormalizedName pip._internal.resolution.resolvelib.candidates.ExtrasCandidate.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 pip._internal.resolution.resolvelib.base.Candidate.

◆ source_link()

Optional[Link] pip._internal.resolution.resolvelib.candidates.ExtrasCandidate.source_link (   self)

◆ version()

CandidateVersion pip._internal.resolution.resolvelib.candidates.ExtrasCandidate.version (   self)

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