INNER CODE UNIT · Python

PyEnvManager

devstream-io/devstream · devstream/env_manager.py:36

class PyEnvManager:
    mamba_bin = MAMBA_BIN_PATH
    mamba_root = MAMBA_ROOT

    def __init__(self):
        pass

    @staticmethod
    def get_py_version(py: str) -> Optional[str]:
        """
        Get the version of the python executable.
        """
        py_version_cmd = [py, "--version"]
        with subprocess.Popen(py_version_cmd, stdout=subprocess.PIPE, stderr=None) as proc:
            proc.wait()

            if proc.returncode != 0:
                return None

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…