evaluate method
evaluate
python docstring
Evaluate a marker.
Return the boolean from evaluating the given marker against the environment. environment is an optional argument to override all or part of the determined environment.
The environment is determined from the current Python process.
python source
def evaluate(self, environment: Optional[Dict[str, str]] = None) -> bool:
"""Evaluate a marker.
Return the boolean from evaluating the given marker against the
environment. environment is an optional argument to override all or
part of the determined environment.
The environment is determined from the current Python process.
"""
current_environment = default_environment()
current_environment["extra"] = ""
if environment is not None:
current_environment.update(environment)
# The API used to allow setting extra to None. We need to handle this
# case for backwards compatibility.
if current_environment["extra"] is None:
current_environment["extra"] = ""
return _evaluate_markers(self._markers, current_environment)
Implementation
bool evaluate({
Object? environment,
}) =>
getFunction("evaluate").call(
<Object?>[
environment,
],
kwargs: <String, Object?>{},
);