MCPcopy Index your code
hub / github.com/nodejs/node / evaluate

Method evaluate

tools/gyp/pylib/packaging/markers.py:233–251  ·  view source on GitHub ↗

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.

(self, environment: Optional[Dict[str, str]] = None)

Source from the content-addressed store, hash-verified

231 return str(self) == str(other)
232
233 def evaluate(self, environment: Optional[Dict[str, str]] = None) -> bool:
234 """Evaluate a marker.
235
236 Return the boolean from evaluating the given marker against the
237 environment. environment is an optional argument to override all or
238 part of the determined environment.
239
240 The environment is determined from the current Python process.
241 """
242 current_environment = default_environment()
243 current_environment["extra"] = ""
244 if environment is not None:
245 current_environment.update(environment)
246 # The API used to allow setting extra to None. We need to handle this
247 # case for backwards compatibility.
248 if current_environment["extra"] is None:
249 current_environment["extra"] = ""
250
251 return _evaluate_markers(self._markers, current_environment)

Callers 15

createRealmsFunction · 0.45
createSyntheticModuleFunction · 0.45
importModuleDynamicallyFunction · 0.45
testBasicFunction · 0.45
test-util-types.jsFile · 0.45
checkModuleStateFunction · 0.45
checkLinkingFunction · 0.45
checkExecutionFunction · 0.45

Calls 3

default_environmentFunction · 0.85
_evaluate_markersFunction · 0.85
updateMethod · 0.65

Tested by 2

testFunction · 0.36
testFunction · 0.36