Skip to content
Open
Show file tree
Hide file tree
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 Apr 8, 2026
c33c7ef
fix: add conda entry point for conda-lock
beckermr Apr 8, 2026
7d834a3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 8, 2026
589987e
Refactor plugin to handle optional conda import
beckermr Apr 8, 2026
a989779
fix: typing issues
beckermr Apr 8, 2026
0dbc5d6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 8, 2026
5a3f923
fix: ignore typing errors?
beckermr Apr 8, 2026
10f270c
Apply suggestion from @beckermr
beckermr Apr 8, 2026
06dd585
Add basic logger configuration function
beckermr Apr 8, 2026
8917581
Replace basicConfig with configure_logger_basic
beckermr Apr 8, 2026
54af5cd
Replace basicConfig with configure_logger_basic
beckermr Apr 8, 2026
10b9e1b
Apply suggestion from @beckermr
beckermr Apr 8, 2026
7afefed
Apply suggestions from code review
beckermr Apr 8, 2026
0ed0ea2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 8, 2026
310a2e0
fix: pass args
beckermr Apr 8, 2026
c68609d
Apply suggestion from @beckermr
beckermr Apr 8, 2026
dd636ac
test: expand integration tests to test conda lock cli plugin
beckermr Apr 8, 2026
dc15ee6
fix: use proper shell in tests
beckermr Apr 8, 2026
131c2b0
fix: need hatchling
beckermr Apr 8, 2026
16ecdd4
fix: need hatch-vcs
beckermr Apr 8, 2026
9f893ba
fix: need editables
beckermr Apr 8, 2026
8cad0b3
fix: need conda too
beckermr Apr 8, 2026
76d1d6b
fix: exclude windows from 3.14 testing
beckermr Apr 8, 2026
84a0635
feat: use a simpler approach for the fix
beckermr Apr 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions conda_lock/plugin.py
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

@hookimpl
def conda_subcommands() -> CondaSubcommand:
yield CondaSubcommand(
name="lock",
summary=("enerate fully reproducible lock files for conda environments."),
action=_execute,
)
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ dependencies = [
[project.scripts]
conda-lock = "conda_lock:main"

[project.entry-points.conda]
conda-lock = "conda_lock.plugin"

[project.urls]
Homepage = "https://github.com/conda/conda-lock"
Repository = "https://github.com/conda/conda-lock"
Expand Down
Loading