-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use .condarc file to configure conda-standalone (#99)
* Add .condarc file to bundle to set channels * Add test to test that config in conda-standalone is captured correctly * Change name of test function * Add news file * Add .condarc file to recipe * Add fallback value for when CONDA_ROOT is set externally * Allow restricting of condarc search paths * Make assertions less restrictive * Update build scripts to include patched file * Update patch * Change file order for config file loading * Use single-letter variable name in batch for loop * Revert using for-loop in bld.bat * Fix typo * Add --no-rcs CLI option * Add environment variable and CLI option to news file * Use custom environment variable to designate .condarc directory * Convert remaining RECIPE_DIR variable to PYINSTALLER_CONDARC_DIR * Generalize variable names in tests * Copy configuration dictionaries
- Loading branch information
1 parent
bfec230
commit e72cef1
Showing
10 changed files
with
208 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
### Enhancements | ||
|
||
* Configure conda-standalone binaries with .condarc files. (#97 via #99) | ||
* Add environment variable `CONDA_RESTRICT_RC_SEARCH_PATH` and CLI option `--no-rc` to only load `.condarc` file delivered by `conda-standalone` bundle or `CONDARC` environment variable. (#99) | ||
|
||
### Bug fixes | ||
|
||
* <news item> | ||
|
||
### Deprecations | ||
|
||
* <news item> | ||
|
||
### Docs | ||
|
||
* <news item> | ||
|
||
### Other | ||
|
||
* <news item> |
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,2 @@ | ||
channels: | ||
- conda-forge |
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
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
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,91 @@ | ||
diff --git a/conda/base/constants.py b/conda/base/constants.py | ||
index d38502a48..b56724933 100644 | ||
--- a/conda/base/constants.py | ||
+++ b/conda/base/constants.py | ||
@@ -10,6 +10,7 @@ Another important source of "static" configuration is conda/models/enums.py. | ||
|
||
import struct | ||
from enum import Enum, EnumMeta | ||
+from os import environ | ||
from os.path import join | ||
|
||
from ..common.compat import on_win | ||
@@ -25,42 +26,47 @@ machine_bits = 8 * struct.calcsize("P") | ||
|
||
APP_NAME = "conda" | ||
|
||
-if on_win: # pragma: no cover | ||
+if "CONDA_RESTRICT_RC_SEARCH_PATH" in 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
pytest | ||
menuinst>=2 | ||
ruamel.yaml |
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