grayskull: [BUG] Grayskull allows recipes with _ when name should have -

Describe the bug

Underscores vs. dashes:

Running

grayskull pypi slack_sdk

generates a recipe named slack_sdk, even though the PyPi package name is slack-sdk.

Expected behavior

An error message that the name slack_sdk doesn’t correspond to a PyPi package.

Outputs

{% set name = "slack_sdk" %}
{% set version = "3.6.0" %}
...

Environment:

  • grayskull --version 0.8.5

Additional context

I suspect that grayskull is following the PyPi redirect to remove underscores.

This issue led to unintentionally create a duplicate feedstock:

https://github.com/conda-forge/slack-sdk-feedstock/issues/10#issuecomment-860884130

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 15 (15 by maintainers)

Most upvoted comments

Yes, please! 😃

Hey, @maresb, @marcelotrevisani and @jaimergp ! I’m going to try and solve this issue. I’m writing down below what I’ve understood till now. Please correct me if I am wrong.

Suppose I create a python package called apples_bananas and I put it on conda-forge (not using grayskull). Suppose a different package called apples-bananas is there on PyPI (not there on conda-forge).

Now, grayskull in it’s present state would work like this: if a user types in grayskull pypi apples_bananas, grayskull would look up that package on pypi (underscores converted to hyphens) and create a recipe with the name of the package as typed in by the user (apples_bananas). So now there will be two packages on conda-forge named apples_bananas , but these will be two different packages.

Ah! Very good point. I guess PyPi is blindly converting underscores to dashes?

It seems not so easy to search for duplicates: exponentially many possibilities in the number of underscores plus dashes

I wish there was clear guidance for a standard on conda-forge. I have been searching and asking for a while with no answers.