"git@developer.sourcefind.cn:OpenDAS/nni.git" did not exist on "0b78b8c35e5acf936850f1c6ab2de9648d01be9f"
Unverified Commit 5588adea authored by Mark's avatar Mark Committed by GitHub
Browse files

Allow for environment variable to set NNI configuration directory (#3936)


Co-authored-by: default avatarMark Janse <m.h.a.janse-2@umcutrecht.nl>
parent bccfa9ff
...@@ -13,7 +13,9 @@ def get_config_directory() -> Path: ...@@ -13,7 +13,9 @@ def get_config_directory() -> Path:
Get NNI config directory. Get NNI config directory.
Create it if not exist. Create it if not exist.
""" """
if sys.prefix != sys.base_prefix or Path(sys.prefix, 'conda-meta').is_dir(): if os.getenv('NNI_CONFIG_DIR') is not None:
config_dir = Path(os.getenv('NNI_CONFIG_DIR'))
elif sys.prefix != sys.base_prefix or Path(sys.prefix, 'conda-meta').is_dir():
config_dir = Path(sys.prefix, 'nni') config_dir = Path(sys.prefix, 'nni')
elif sys.platform == 'win32': elif sys.platform == 'win32':
config_dir = Path(os.environ['APPDATA'], 'nni') config_dir = Path(os.environ['APPDATA'], 'nni')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment