-
-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drop Jinja name
from PyPI URL (using f-string instead)
#548
base: main
Are you sure you want to change the base?
Conversation
67c4007
to
d037674
Compare
It seems like it should be possible to drop this logic as well grayskull/grayskull/strategy/pypi.py Lines 512 to 520 in d23e5ce
Though please let me know if I'm missing something |
@@ -288,7 +288,7 @@ def get_pypi_metadata(config: Configuration) -> dict: | |||
"url": info.get("home_page"), | |||
"license": info.get("license"), | |||
"source": { | |||
"url": config.url_pypi + "/packages/source/{{ name[0] }}/{{ name }}/" | |||
"url": config.url_pypi + f"/packages/source/{config.name[0]}/{config.name}/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These will always be normalized (even for historic builds), with the most-widely used implementation being packaging.utils.canonicalize_name
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is a good idea, grayskull still tries to canonicalize the names, but having that implementation to use out of the box might be better indeed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be stored as a key for reuse?
Description
Instead of using Jinja to add
name
into the PyPI URL. Just use an f-string to template the URL. This removesname
from the PyPI URL entirely and lets users more easily change this as needed.Alternative to PR: #460