-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 'conda-remove-defaults' setting and support 'nodefaults' as a keyword channel #367
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
32935f2
Add 'no-implicit-channels' setting
jaimergp 2bce0f8
echo
jaimergp fc9f189
explicit true
jaimergp 91d408a
strings
jaimergp cd749c9
README
jaimergp 83466a0
Merge branch 'main' into no-implicit-channels
jezdez ddc0605
Apply suggestions from code review
jaimergp c9ca2d5
recompile
jaimergp 0d8a3c7
support nodefaults too
jaimergp 29b8ef4
skip nodefaults
jaimergp c588d86
rework tests
jaimergp f89f2d9
typo
jaimergp a6fd782
use base
jaimergp 4fb9670
use subprocess
jaimergp 3a38b58
split
jaimergp 7c535d2
use heredoc
jaimergp c58e1b1
use a script
jaimergp 051bf38
fix miniforge version in example 6
jaimergp 6dc458d
add .exe on Windows
jaimergp a9e3dc2
set solver
jaimergp e64f70f
use $CONDA_EXE?
jaimergp 2fc1dad
lint
jaimergp 5f71b9c
it's conda-solver
jaimergp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about something like
Admittedly verby, but I think we can write this in a way that gets closer to the long-term intended behavior
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #367 (review). I don't particularly care about the name itself, given it'll be probably be obsolete by March next year.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the long-term future for this feature is only to migrate conda users to the same pattern as mamba and pixi follow, setting a default channel in the distribution/bootstrapper layer and not hard-coding it in the codebase. That's why I think the name of the parameter for setup-miniconda is okay to focus on conda only, and not required to be named generically.