-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 'conda-remove-defaults' setting and support 'nodefaults' as a key…
…word channel (#367) * Add 'no-implicit-channels' setting * echo * explicit true * strings * README * Apply suggestions from code review Co-authored-by: Jannis Leidel <jannis@leidel.info> * recompile * support nodefaults too Co-authored-by: liamhuber <liamhuber @users.noreply.github.com> * skip nodefaults * rework tests * typo * use base * use subprocess * split * use heredoc * use a script * fix miniforge version in example 6 * add .exe on Windows * set solver * use $CONDA_EXE? * lint * it's conda-solver --------- Co-authored-by: Jannis Leidel <jannis@leidel.info> Co-authored-by: liamhuber <liamhuber @users.noreply.github.com>
- Loading branch information
1 parent
899c78d
commit 65da104
Showing
8 changed files
with
191 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: "Example 14: Remove defaults channel" | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- "*" | ||
push: | ||
branches: | ||
- "develop" | ||
- "main" | ||
- "master" | ||
schedule: | ||
# Note that cronjobs run on master/main by default | ||
- cron: "0 0 * * *" | ||
|
||
concurrency: | ||
group: | ||
${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
example-14: | ||
# prevent cronjobs from running on forks | ||
if: | ||
(github.event_name == 'schedule' && github.repository == | ||
'conda-incubator/setup-miniconda') || (github.event_name != 'schedule') | ||
name: | ||
Ex14 (${{ matrix.os }}, remove=${{ matrix.conda-remove-defaults }}, | ||
channels=${{ matrix.channels }}) | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: ["ubuntu-latest", "macos-latest", "windows-latest"] | ||
conda-remove-defaults: ["true", "false"] | ||
channels: | ||
[ | ||
"conda-forge", | ||
"conda-forge,nodefaults", | ||
"conda-forge,defaults,nodefaults", | ||
] | ||
timeout-minutes: 30 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./ | ||
id: setup-miniconda | ||
continue-on-error: true | ||
with: | ||
channels: ${{ matrix.channels }} | ||
conda-remove-defaults: ${{ matrix.conda-remove-defaults }} | ||
python-version: "3.12" | ||
- shell: bash -el {0} | ||
run: | | ||
cat <<EOF | python | ||
import json | ||
import os | ||
from subprocess import check_output | ||
out = check_output( | ||
[ | ||
os.environ["CONDA_EXE"], | ||
"config", | ||
"--show", | ||
"channels", | ||
"--json", | ||
] | ||
) | ||
channels = json.loads(out)["channels"] | ||
input_channels = "${{ matrix.channels }}".split(",") | ||
remove_defaults = "${{ matrix.conda-remove-defaults }}" == "true" | ||
print("Input channels:", input_channels) | ||
print("Input remove-defaults:", remove_defaults) | ||
print("Computed channels:", channels) | ||
assert "nodefaults" not in channels | ||
if "defaults" in input_channels: | ||
assert "defaults" in channels | ||
elif "nodefaults" in input_channels or remove_defaults: | ||
assert "defaults" not in channels | ||
EOF |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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