How to use the pythonfinder.utils.get_python_version function in pythonfinder

To help you get started, we’ve selected a few pythonfinder examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sarugaku / pythonfinder / tests / test_utils.py View on Github external
for v in pythons:
        py = v.py_version
        comes_from = getattr(py, "comes_from", None)
        if comes_from is not None:
            comes_from_path = getattr(comes_from, "path", v.path)
        else:
            comes_from_path = v.path
    return sorted(list(pythons))


PYTHON_VERSIONS = _get_python_versions()


versions = [
    (
        pythonfinder.utils.get_python_version(python.path.as_posix()),
        python.as_python.version,
    )
    for python in PYTHON_VERSIONS
]

version_dicts = [
    (
        pythonfinder.utils.parse_python_version(str(python.as_python.version)),
        python.as_python.as_dict(),
    )
    for python in PYTHON_VERSIONS
]

test_paths = [(python.path.as_posix(), True) for python in PYTHON_VERSIONS]