grayskull
grayskull copied to clipboard
[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
Hi @maresb ,
I believe the "fix" in this case is to just give an warning to the user that the package already exist on conda-forge
.
cc @ForgottenProgramme
@marcelotrevisani or to not follow redirects on PyPi?
The project name is slack_sdk
,
https://github.com/slackapi/python-slack-sdk/blob/d3615007df2b2f7fd9da1d7afbcd88fe873a3590/setup.py#L250
It is mimicking the pypi behaviour as it is generating the recipes looking for pypi
I think grayskull should follow the name of the project, so it should be slack_sdk
then
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.
@maresb
I guess PyPi is blindly converting underscores to dashes?
Yes.
Also, @maresb, when you say this:
It seems not so easy to search for duplicates: exponentially many possibilities in the number of underscores plus dashes
You mean searching for duplicates on conda-forge, right? Because if PyPI converts all underscores to hyphens, it's not possible to have duplicates. Isn't it?
@ForgottenProgramme, exactly.
For the PyPi name very-very-long-package-name
there are 16 possible package names to check on conda-forge. But it's not a serious difficulty, just an annoyance.
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.
So, we would like grayskull to give a warning if a package with the same name as entered by the user in the grayskull pypi <package_name>
command, already exists on conda-forge.
Yeap, that would be really useful
do you want me to assign this issue to you then?
Yes, please! :)
Do we have a gitter room for grayskull, @marcelotrevisani ?
Do we have a gitter room for grayskull, @marcelotrevisani ?
Yes, we already have one: https://gitter.im/conda_grayskull/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge