conda-lock icon indicating copy to clipboard operation
conda-lock copied to clipboard

Support project-specific dep overrides / settings in pyproject.toml

Open mdekstrand opened this issue 3 years ago • 5 comments

It would be useful for conda-lock's pyproject.toml support if it could support configuring dependency-specific information directly in pyproject.toml. I see at least two things that would be useful to configure:

  • A dependency needs to be installed by Pip; this will probably only work with -k env, but would add the dependency to a pip section.
  • The Conda package name for a dependency (in case something isn't in the global rename file, or to remove dependency on it)

This could look something like:

[tool.cargo-lock.dependencies]
hpfrec = { source = "pip" }
msgpack = { conda-package = "python-msgpack" }

mdekstrand avatar Oct 25 '21 15:10 mdekstrand

This is conda-lock not cargo-lock?

mariusvniekerk avatar Oct 25 '21 15:10 mariusvniekerk

@mariusvniekerk Oops, sorry. Meant conda-lock and "Conda package" - using both Conda & Cargo on different projects, brain slipped.

mdekstrand avatar Oct 25 '21 17:10 mdekstrand

Okay, that sounds reasonable to me. Changes would probably be needed mostly in the source parser and maybe the spec handler class to carry along the pip dependencies.

mariusvniekerk avatar Oct 27 '21 21:10 mariusvniekerk

Being able to specify which packages should be installed via pip would indeed be great.

My understanding is that it is possible for poetry users currently, but that users of PEP621 pyproject.toml are unfortunately out of luck.

olivier-lacroix avatar Apr 16 '22 11:04 olivier-lacroix

I have given it a go in https://github.com/conda-incubator/conda-lock/pull/186 (for the pip item only)

olivier-lacroix avatar Apr 17 '22 03:04 olivier-lacroix