INNER CODE UNIT · Python
_get_conda_forge_url
devstream-io/devstream · devstream/env_manager.py:317
def _get_conda_forge_url(self) -> str:
"""
Read the conda-forge URL from the config file.
If the config file does not exist or does not contain the conda-forge URL,
use the default value.
"""
config_file = os.path.join(CHAT_DIR, CHAT_CONFIG_FILENAME)
try:
if not os.path.exists(config_file):
return DEFAULT_CONDA_FORGE_URL
import yaml
with open(config_file, "r", encoding="utf-8") as f:
config = yaml.safe_load(f)
return config.get("conda-forge-url", DEFAULT_CONDA_FORGE_URL)