diff --git a/conda_lock/conda_lock.py b/conda_lock/conda_lock.py index 31b6157ba..179bc6ac3 100644 --- a/conda_lock/conda_lock.py +++ b/conda_lock/conda_lock.py @@ -675,6 +675,15 @@ def sanitize_lockfile_line(line: str) -> str: for dep in pip_deps ] ) + + if len(pip_deps) > 0: + logger.warning( + "WARNING: installation of pip dependencies is only supported " + "by the 'conda-lock install' command. Other tools may silently " + "ignore them. For portability, we recommend using the newer " + "unified lockfile format (i.e. removing the --kind=explicit " + "argument." + ) else: raise ValueError(f"Unrecognised lock kind {kind}.") diff --git a/docs/pip.md b/docs/pip.md index 58b1a1e18..1dba37e3c 100644 --- a/docs/pip.md +++ b/docs/pip.md @@ -21,6 +21,11 @@ dependencies: If in this case `some_pip_only_library` depends on `requests` that dependency will be met by conda and the version will be constrained to what the conda solver determines. +We recommend avoiding the `--kind=explicit` flag when there are `pip` +dependencies. Most tools (except for `conda-lock install`) do not recognize +`pip` dependencies from explicit lockfiles, so they may be silently ignored. +The default lockfile format explicitly supports pip dependencies. + ## Usage with pyproject.toml If a dependency refers directly to a URL rather than a package name and version,