[BUG] about.home defaults to None instead of PyPI project page
Describe the bug
Without a PyPI "homepage" URL on PyPI, the key about.home defaults to None.
To Reproduce Steps to reproduce the behavior:
grayskull pypi asyncache
Expected behavior
I would have expected it to be https://pypi.org/project/{{ name }}.
Environment:
- grayskull v2.2.2
Another similar case:
grayskull pypi mkdocs-include-markdown-plugin
generates a meta.yaml with about.dev_url pointing to GitHub and about.home entirely missing.
This results in a complaint by the linter: https://github.com/conda-forge/staged-recipes/pull/22080#issuecomment-1436036378
hey there @maresb and grayskull maintainers 👋 i was just looking into this myself. Something is a bit odd with grayskull.
I have been testing this for our tutorials. And no matter what i add to my pyproject.toml file it seems like home is missing.
[project.urls]
Homepage = "https://pypi.org/project/pyospackage/"
Documentation = "https://github.com/pyopensci/pyospackage#readme"
Issues = "https://github.com/pyopensci/pyospackage/issues"
Source = "https://github.com/pyopensci/pyospackage"
as a result the conda-linter bot (very friendly!!) tells me something is wrong with my recipe. i can absolutely add home= to my recipe manually, but i would expect grayskull to do one of two things as well:
- read the homepage = metadata from the pyproject.toml / package sdist metadata / pypi homepage or
- because it is required by default to have home = , i would expect it to default to the github repo which is rendered in my recipe as dev_url as of now when i run:
grayskull pypi pyospackage
This is what i get in the about section:
about:
summary: A package that adds numbers together
dev_url: https://github.com/pyopensci/pyospackage
license: MIT
license_file: LICENSE
i think for now i'll tell folks to add home = manually but i wondered if someone could help us understand if this is actually a bug OR something that I am missing when running grayskull.
thank you for making this tool as it's takes a lot of the confusion around creating a recipe away! For a pure python package i'd just hope it worked out of the box and gave the linter everything that it needs to pass a build!
Hi @lwasser, this is definitely a bug. There's some seemingly overcomplicated logic for merging the various data sources. It looks like there may be typos in the names. It would be really nice to add validation, e.g. with a type checker. That would prevent these sorts of problems, but adding that would unfortunately be quite a lot of work.
I attempted a quick fix in #525, but unfortunately my changes broke other stuff.