MCPcopy
hub / github.com/pex-tool/pex / includes

Function includes

pex/specifier_sets.py:309–328  ·  view source on GitHub ↗
(
    specifier,  # type: Union[str, SpecifierSet]
    candidate,  # type: Union[str, SpecifierSet]
)

Source from the content-addressed store, hash-verified

307
308
309def includes(
310 specifier, # type: Union[str, SpecifierSet]
311 candidate, # type: Union[str, SpecifierSet]
312):
313 # type: (...) -> bool
314
315 included_range = as_range(specifier)
316 if isinstance(included_range, UnsatisfiableSpecifierSet):
317 return False
318
319 candidate_range = as_range(candidate)
320 if isinstance(candidate_range, UnsatisfiableSpecifierSet):
321 return False
322
323 if isinstance(included_range, ArbitraryEquality) or isinstance(
324 candidate_range, ArbitraryEquality
325 ):
326 return included_range == candidate_range
327
328 return candidate_range in included_range

Callers 2

test_includesFunction · 0.90
test_unsatisfiableFunction · 0.90

Calls 1

as_rangeFunction · 0.85

Tested by 2

test_includesFunction · 0.72
test_unsatisfiableFunction · 0.72