-
Notifications
You must be signed in to change notification settings - Fork 23
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
CEP-17 add language-agnostic plugins #78
Open
beckermr
wants to merge
1
commit into
main
Choose a base branch
from
beckermr-patch-1
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.
Open
Changes from all commits
Commits
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,64 @@ | ||
<table> | ||
<tr><td> Title </td><td> Language-Independent Plugins</td> | ||
<tr><td> Status </td><td> Draft </td></tr> | ||
<tr><td> Author(s) </td><td> Matthew R. Becker <[email protected]></td></tr> | ||
<tr><td> Created </td><td> May 31, 2024</td></tr> | ||
<tr><td> Updated </td><td> May 31, 2024</td></tr> | ||
<tr><td> Discussion </td><td> NA </td></tr> | ||
<tr><td> Implementation </td><td> NA </td></tr> | ||
</table> | ||
|
||
## Abstract | ||
|
||
This CEP proposes a standard for language-independent plugins for `conda` and `conda`-like tools (e.g., `pixi`, `mamba`, `rattler`). | ||
The goal is to generalize the existing work on plugins in `conda` via `pluggy` to something that can be implemented | ||
by more parties in the ecosystem. The standard below augments the existing `pluggy` plugins by defining an additional | ||
source of plugin information that `conda` can use to generate plugins for `pluggy`. Other `conda`-compliant package managers | ||
can use the same information to take appropriate actions (e.g., add a virtual package to the repodata) in order to achieve | ||
the same effects. The primary target of this CEP is virtual packages. Other possible cross-language plugins can be added in future | ||
CEPS as the need arises. | ||
|
||
## Specification | ||
|
||
To generate plugins, a `conda`-compliant tool will | ||
|
||
1. Look for the `conda-plugins` executable on the current PATH. | ||
2. If `conda-plugins` is found, execute it. | ||
3. If `conda-plugins` executes successfully, parse `stdout` as JSON and take the appropriate action as defined below. | ||
4. If `conda-plugins` executes non-successfully, display an error to `stderr` containing any `stderr` from `conda-plugins` and continue. | ||
|
||
The JSON output from `conda-plugins` must be formatted and interpreted as follows: | ||
|
||
```JSON | ||
{ | ||
"virtual_pkgs": [ | ||
{ | ||
"name": "pkg1-name", | ||
"version": "pkg1-version", | ||
"build": "pkg1-build", | ||
}, | ||
{ | ||
"name": "pkg2-name", | ||
"version": "pkg2-version", | ||
"build": "pkg2-build", | ||
} | ||
] | ||
} | ||
``` | ||
|
||
### `virtual_pkgs` | ||
|
||
For every item in the `virtual_pkgs` list, a virtual package is defined with name `__<name>`, version `<version>`, and build string `<build>`. | ||
Any errors must be printed to `stderr` and the tool must continue. If the list is empty, no virtual packages will be defined. The `virtual_pkgs` key | ||
must be present at the top-level. | ||
|
||
## Backwards Compatibility | ||
|
||
The specification in this CEP can easily be made backwards compatible with the existing `conda` plugin architecture. | ||
A PR to `conda` should be made to run the `conda-plugins` executable, if it exists, and take the appropriate actions. | ||
In order to ensure conisstent behavior across the ecosystem, any plugins derived from `conda-plugins` should override | ||
any other source of plugins, including plugins implemented via `pluggy`. | ||
|
||
## Copyright | ||
|
||
All CEPs are explicitly [CC0 1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/). |
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.
The
PATH
based approach for extensibility is a no-go in the future, hence the adoption of a in-depth plugin system, as it doesn't provide for example a scalable error handling method (it's just glue all the way down).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.
Not following. Anything that runs on unix is on the PATH or located on disk somewhere...