-
Notifications
You must be signed in to change notification settings - Fork 404
feat(add): --channel parameter to specify channel.
#4987
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
Open
prady0t
wants to merge
15
commits into
prefix-dev:main
Choose a base branch
from
prady0t:add-channel-parameter
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+53
−85
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
96b27f2
Add --channel argument to specify channel.
prady0t fa8324a
addresing test failure
prady0t 0f07dce
Only accounting for --channel if input is specified
prady0t e25c18b
linter errors
prady0t 0d6e0c5
adding info to docs
prady0t ae9e562
Merge branch 'main' into add-channel-parameter
prady0t cc9d79e
Adding support of channel in MatchSpec
prady0t 98fbf8d
Merge branch 'add-channel-parameter' of https://github.com/prady0t/pi…
prady0t 55e0ffe
Merge branch 'main' into add-channel-parameter
prady0t 9ee7e8f
Moving the code to pixi_api
prady0t ec4b2af
Merge branch 'main' into add-channel-parameter
baszalmstra 74becfc
Use NamedChannelOrUrl instead of Channel
prady0t c033916
Removing redundent tests
prady0t b130eaa
Removing redundent tests
prady0t 2f0e72a
Removing redundent tests
prady0t 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 hidden or 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 |
|---|---|---|
|
|
@@ -429,6 +429,7 @@ impl PixiControl { | |
| }, | ||
| config: Default::default(), | ||
| editable: false, | ||
| channel: None, | ||
| }, | ||
| } | ||
| } | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -1380,7 +1380,7 @@ def test_add_url_no_channel(pixi: Path, tmp_pixi_workspace: Path) -> None: | |
|
|
||
| verify_cli_command([pixi, "init", tmp_pixi_workspace]) | ||
|
|
||
| # helpful error for missing channel | ||
| # verify channel can be added using matchspec syntax | ||
| verify_cli_command( | ||
| [ | ||
| pixi, | ||
|
|
@@ -1389,102 +1389,31 @@ def test_add_url_no_channel(pixi: Path, tmp_pixi_workspace: Path) -> None: | |
| "--manifest-path", | ||
| tmp_pixi_workspace, | ||
| ], | ||
| expected_exit_code=ExitCode.FAILURE, | ||
| stderr_contains="pixi workspace channel add https://repo.prefix.dev/bioconda", | ||
| ) | ||
|
|
||
| # test channel parameter with url | ||
| verify_cli_command( | ||
| [ | ||
| pixi, | ||
| "workspace", | ||
| "channel", | ||
| "add", | ||
| "https://repo.prefix.dev/bioconda", | ||
| "--manifest-path", | ||
| tmp_pixi_workspace, | ||
| ], | ||
| ) | ||
| # successful after adding the channel | ||
| verify_cli_command( | ||
| [ | ||
| pixi, | ||
| "add", | ||
| "https://repo.prefix.dev/bioconda::snakemake-minimal", | ||
| "--manifest-path", | ||
| tmp_pixi_workspace, | ||
| ], | ||
| stderr_contains="Added https://repo.prefix.dev/bioconda::snakemake-minimal", | ||
| ) | ||
|
|
||
| # no message for initially unused feature... | ||
| verify_cli_command( | ||
| [ | ||
| pixi, | ||
| "add", | ||
| "https://conda.anaconda.org/conda-forge::xz", | ||
| "--feature=prefix", | ||
| "--manifest-path", | ||
| tmp_pixi_workspace, | ||
| ], | ||
| ) | ||
| verify_cli_command( | ||
| [ | ||
| pixi, | ||
| "workspace", | ||
| "environment", | ||
| "add", | ||
| "prefix", | ||
| "--feature=prefix", | ||
| "--manifest-path", | ||
| tmp_pixi_workspace, | ||
| ], | ||
| ) | ||
| # ...but decent message on install: | ||
| verify_cli_command( | ||
| [ | ||
| pixi, | ||
| "install", | ||
| "--environment=prefix", | ||
| "--manifest-path", | ||
| tmp_pixi_workspace, | ||
| ], | ||
| expected_exit_code=ExitCode.FAILURE, | ||
| stderr_contains="unavailable channel 'https://conda.anaconda.org/conda-forge/'", | ||
| ) | ||
| # and helpful message now feature is used: | ||
| verify_cli_command( | ||
| [ | ||
| pixi, | ||
| "add", | ||
| "https://conda.anaconda.org/conda-forge::libzlib", | ||
| "--feature=prefix", | ||
| "--manifest-path", | ||
| tmp_pixi_workspace, | ||
| ], | ||
| expected_exit_code=ExitCode.FAILURE, | ||
| stderr_contains="pixi workspace channel add https://conda.anaconda.org/conda-forge", | ||
| ) | ||
|
|
||
| verify_cli_command( | ||
|
Comment on lines
-1399
to
-1468
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you remove these tests? |
||
| [ | ||
| pixi, | ||
| "workspace", | ||
| "channel", | ||
| "add", | ||
| "--feature=prefix", | ||
|
Comment on lines
-1407
to
-1474
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed these as using matchspec syntax adds the channel if not found, hence these tests are irrelevant. |
||
| "--channel", | ||
| "https://conda.anaconda.org/conda-forge", | ||
| "libzlib", | ||
| "--manifest-path", | ||
| tmp_pixi_workspace, | ||
| ], | ||
| stderr_contains="Added libzlib", | ||
| ) | ||
| # successful after adding the channel | ||
| # test channel parameter with name | ||
| verify_cli_command( | ||
| [ | ||
| pixi, | ||
| "install", | ||
| "--environment=prefix", | ||
| "add", | ||
| "--channel", | ||
| "conda-forge", | ||
| "libzlib", | ||
| "--manifest-path", | ||
| tmp_pixi_workspace, | ||
| ], | ||
| stderr_contains="The prefix environment has been installed", | ||
| stderr_contains="Added libzlib", | ||
| ) | ||
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.
channel is now Option<Vec> as oppose to Option earlier. This helps us take url and local channel paths as part of matchspec as well.