我们从Python开源项目中,提取了以下4个代码示例,用于说明如何使用pkg_resources.evaluate_marker()。
def marker_passes(marker): """ Given an environment marker, return True if the marker is valid and matches this environment. """ return ( not marker or not pkg_resources.invalid_marker(marker) and pkg_resources.evaluate_marker(marker) )
def test_ordering(python_version_mock): assert evaluate_marker("python_full_version > '2.7.3'") is True