MCPcopy Create free account
hub / github.com/conda/constructor / get_frozen_env

Function get_frozen_env

constructor/main.py:150–161  ·  view source on GitHub ↗

Extract environment name from frozen marker destination path. Returns: Environment name if frozen marker found in the path, otherwise None.

(path: str)

Source from the content-addressed store, hash-verified

148 """
149
150 def get_frozen_env(path: str) -> str | None:
151 """Extract environment name from frozen marker destination path.
152
153 Returns:
154 Environment name if frozen marker found in the path, otherwise None.
155 """
156 parts = Path(path).parts
157 if parts == ("conda-meta", "frozen"):
158 return "base"
159 if len(parts) == 4 and parts[0] == "envs" and parts[-2:] == ("conda-meta", "frozen"):
160 return parts[1]
161 return None
162
163 # Collect environments using freeze_base/freeze_env
164 frozen_envs = set()

Callers 1

validate_frozen_envsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected