INNER CODE UNIT · Python

get_dep_hash

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

    def get_dep_hash(reqirements_file: str) -> str:
        """
        Get the hash of the requirements file content.

        Used to check if the requirements file has been changed.
        """
        with open(reqirements_file, "r", encoding="utf-8") as f:
            content = f.read()
            return hashlib.md5(content.encode("utf-8")).hexdigest()

    def ensure(
        self,
        env_name: str,
        py_version: Optional[str] = None,
        reqirements_file: Optional[str] = None,
    ) -> Optional[str]:
        """
        Ensure the python environment exists with the given name and version.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…