-
Notifications
You must be signed in to change notification settings - Fork 114
fix: register as conda plugin #905
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
beckermr
wants to merge
24
commits 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.
+101
−11
Open
Changes from 7 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
17912ca
fix: register as plugin properly
beckermr c33c7ef
fix: add conda entry point for conda-lock
beckermr 7d834a3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 589987e
Refactor plugin to handle optional conda import
beckermr a989779
fix: typing issues
beckermr 0dbc5d6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 5a3f923
fix: ignore typing errors?
beckermr 10f270c
Apply suggestion from @beckermr
beckermr 06dd585
Add basic logger configuration function
beckermr 8917581
Replace basicConfig with configure_logger_basic
beckermr 54af5cd
Replace basicConfig with configure_logger_basic
beckermr 10b9e1b
Apply suggestion from @beckermr
beckermr 7afefed
Apply suggestions from code review
beckermr 0ed0ea2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 310a2e0
fix: pass args
beckermr c68609d
Apply suggestion from @beckermr
beckermr dd636ac
test: expand integration tests to test conda lock cli plugin
beckermr dc15ee6
fix: use proper shell in tests
beckermr 131c2b0
fix: need hatchling
beckermr 16ecdd4
fix: need hatch-vcs
beckermr 9f893ba
fix: need editables
beckermr 8cad0b3
fix: need conda too
beckermr 76d1d6b
fix: exclude windows from 3.14 testing
beckermr 84a0635
feat: use a simpler approach for the fix
beckermr 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
Some comments aren't visible on the classic Files Changed page.
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 |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| """Conda plugin hooks for conda-lock. | ||
|
|
||
| Registers ``conda lock`` so the feedstock tooling is available as a conda | ||
| subcommand when this package is installed in the same environment as conda. | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
|
|
||
| try: | ||
| from conda.plugins import hookimpl # type: ignore | ||
| from conda.plugins.types import CondaSubcommand # type: ignore | ||
|
|
||
| HAVE_CONDA = True | ||
| except ImportError: | ||
| HAVE_CONDA = False | ||
|
|
||
|
|
||
| if HAVE_CONDA: | ||
|
|
||
| def _execute(args: tuple[str, ...]) -> int | None: | ||
| """Dispatch plugin arguments to the lock CLI. | ||
|
|
||
| Lazy import to avoid import-time side effects when not using conda-lock. | ||
| """ | ||
| from conda_lock.__main__ import main | ||
|
|
||
| return main() # TODO: does not accept args for parsing since using click | ||
beckermr marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| @hookimpl | ||
| def conda_subcommands() -> CondaSubcommand: | ||
| yield CondaSubcommand( | ||
| name="lock", | ||
| summary=("enerate fully reproducible lock files for conda environments."), | ||
| action=_execute, | ||
| ) | ||
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
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.
Uh oh!
There was an error while loading. Please reload this page.