Skip to content

Commit

Permalink
Merge pull request #288 from sebastian-luna-valero/patch-1
Browse files Browse the repository at this point in the history
Do not use `--kind=explicit`
  • Loading branch information
mariusvniekerk authored Nov 26, 2022
2 parents e1feddd + b0f8a69 commit f31834c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions conda_lock/conda_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}.")

Expand Down
5 changes: 5 additions & 0 deletions docs/pip.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f31834c

Please sign in to comment.