-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow restricting of condarc search paths
- Loading branch information
1 parent
4ad8f0c
commit 6d37cb3
Showing
4 changed files
with
110 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
diff --git a/conda/base/constants.py b/conda/base/constants.py | ||
index d38502a48..dc180c0bf 100644 | ||
--- a/conda/base/constants.py | ||
+++ b/conda/base/constants.py | ||
@@ -25,42 +25,47 @@ machine_bits = 8 * struct.calcsize("P") | ||
|
||
APP_NAME = "conda" | ||
|
||
-if on_win: # pragma: no cover | ||
+if "CONDA_RESTRICT_RC_SEARCH_PATH" in os.environ: | ||
SEARCH_PATH = ( | ||
- "C:/ProgramData/conda/.condarc", | ||
- "C:/ProgramData/conda/condarc", | ||
- "C:/ProgramData/conda/condarc.d", | ||
+ "$CONDARC", | ||
) | ||
else: | ||
- SEARCH_PATH = ( | ||
- "/etc/conda/.condarc", | ||
- "/etc/conda/condarc", | ||
- "/etc/conda/condarc.d/", | ||
- "/var/lib/conda/.condarc", | ||
- "/var/lib/conda/condarc", | ||
- "/var/lib/conda/condarc.d/", | ||
+ if on_win: # pragma: no cover | ||
+ SEARCH_PATH = ( | ||
+ "C:/ProgramData/conda/.condarc", | ||
+ "C:/ProgramData/conda/condarc", | ||
+ "C:/ProgramData/conda/condarc.d", | ||
+ ) | ||
+ else: | ||
+ SEARCH_PATH = ( | ||
+ "/etc/conda/.condarc", | ||
+ "/etc/conda/condarc", | ||
+ "/etc/conda/condarc.d/", | ||
+ "/var/lib/conda/.condarc", | ||
+ "/var/lib/conda/condarc", | ||
+ "/var/lib/conda/condarc.d/", | ||
+ ) | ||
+ | ||
+ SEARCH_PATH += ( | ||
+ "$CONDA_ROOT/.condarc", | ||
+ "$CONDA_ROOT/condarc", | ||
+ "$CONDA_ROOT/condarc.d/", | ||
+ "$XDG_CONFIG_HOME/conda/.condarc", | ||
+ "$XDG_CONFIG_HOME/conda/condarc", | ||
+ "$XDG_CONFIG_HOME/conda/condarc.d/", | ||
+ "~/.config/conda/.condarc", | ||
+ "~/.config/conda/condarc", | ||
+ "~/.config/conda/condarc.d/", | ||
+ "~/.conda/.condarc", | ||
+ "~/.conda/condarc", | ||
+ "~/.conda/condarc.d/", | ||
+ "~/.condarc", | ||
+ "$CONDA_PREFIX/.condarc", | ||
+ "$CONDA_PREFIX/condarc", | ||
+ "$CONDA_PREFIX/condarc.d/", | ||
+ "$CONDARC", | ||
) | ||
|
||
-SEARCH_PATH += ( | ||
- "$CONDA_ROOT/.condarc", | ||
- "$CONDA_ROOT/condarc", | ||
- "$CONDA_ROOT/condarc.d/", | ||
- "$XDG_CONFIG_HOME/conda/.condarc", | ||
- "$XDG_CONFIG_HOME/conda/condarc", | ||
- "$XDG_CONFIG_HOME/conda/condarc.d/", | ||
- "~/.config/conda/.condarc", | ||
- "~/.config/conda/condarc", | ||
- "~/.config/conda/condarc.d/", | ||
- "~/.conda/.condarc", | ||
- "~/.conda/condarc", | ||
- "~/.conda/condarc.d/", | ||
- "~/.condarc", | ||
- "$CONDA_PREFIX/.condarc", | ||
- "$CONDA_PREFIX/condarc", | ||
- "$CONDA_PREFIX/condarc.d/", | ||
- "$CONDARC", | ||
-) | ||
- | ||
DEFAULT_CHANNEL_ALIAS = "https://conda.anaconda.org" | ||
CONDA_HOMEPAGE_URL = "https://conda.io" | ||
ERROR_UPLOAD_URL = "https://conda.io/conda-post/unexpected-error" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters