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

Feature: provide local additions to grayskull_pypi_mapping.yaml

Open tlambert03 opened this issue 2 years ago • 2 comments

Checklist

  • [X] I added a descriptive title
  • [X] I searched open requests and couldn't find a duplicate

What is the idea?

Apologies if I've missed this feature in the readme or prior discussion in the issues.

I'm helping someone setup conda-lock with a pyproject.toml setup that includes:

[project.optional-dependencies]
cuda = [
    "cupy-cuda11x ; platform_system != 'Darwin'",
]

naturally, specific cuda builds of of cupy aren't declared on conda as they are on pypi, but grayskull's lookup doesn't (currently) deal with all of those maps.

I know that I can provide my own --pypi_to_conda_lookup_file, but that appears to A) require a URI I can easily pass to requests.get B) presumably requires me to duplicate stuff that I need from grayskull's map?

looking through the source code, there doesn't appear to be any way to append to the lookup.

Why is this needed?

to assist in pypi-to-conda name mapping with minimal duplication

What should happen?

I'm thinking something like:

[tool.conda-lock.pypi-to-conda-name]
cupy-cuda11x = {"conda_name" = "cupy"}

or simpler if no additional info is needed

[tool.conda-lock.pypi-to-conda-name]
cupy-cuda11x = "cupy"
# or multiple packages, as would be useful in the case of cupy
cupy-cuda11x = ["cupy", "cuda-version=11.8"]

Additional Context

No response

tlambert03 avatar Nov 10 '23 17:11 tlambert03

Looks sensible! I like the second schema where each package name has a specification given as a string or list of strings.

Would you like to implement it?

maresb avatar Nov 10 '23 17:11 maresb

i could give it a shot!

tlambert03 avatar Nov 10 '23 17:11 tlambert03