Skip to content

Commit

Permalink
Use custom environment variable to designate .condarc directory
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoesters committed Sep 19, 2024
1 parent 0dde26f commit c29e93e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ build:
string: "g{{ GIT_FULL_HASH[:7] }}_py{{ pyver }}_{{ PKG_BUILDNUM }}"
ignore_run_exports:
- '*'
script_env:
- PYINSTALLER_CONDARC_DIR={{ RECIPE_DIR }}

requirements:
build:
Expand Down
2 changes: 1 addition & 1 deletion src/conda.exe.spec
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ elif sys.platform == "darwin":

# Add .condarc file to bundle to configure channels
# during the package building stage
if "RECIPE_DIR" in os.environ:
if "PYINSTALLER_CONDARC_DIR" in os.environ:
condarc = os.path.join(os.environ["RECIPE_DIR"], ".condarc")
if os.path.exists(condarc):
datas.append((condarc, "."))
Expand Down
2 changes: 1 addition & 1 deletion tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def test_constructor():
@pytest.mark.parametrize("search_paths", ("all_rcs", "--no-rc", "env_var"))
def test_conda_standalone_config(search_paths, tmp_path, monkeypatch):
expected_configs = {}
if recipe_dir := os.environ.get("RECIPE_DIR"):
if recipe_dir := os.environ.get("PYINSTALLER_CONDARC_DIR"):
recipe_condarc = Path(recipe_dir, ".condarc")
if recipe_condarc.exists():
yaml = YAML()
Expand Down

0 comments on commit c29e93e

Please sign in to comment.