-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
Use {{ name }}
in filename too
#460
base: main
Are you sure you want to change the base?
Conversation
Since `{{ name }}` is already templated elsewhere, template it in the filename of the archive too for consistency.
for more information, see https://pre-commit.ci
Should add the other option would be to skip templating |
@@ -132,8 +132,13 @@ def get_url_filename(metadata: dict, default: Optional[str] = None) -> str: | |||
|
|||
for pkg_url in metadata["urls"]: | |||
if pkg_url["packagetype"] == "sdist": | |||
name = metadata["info"]["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.
AFAICT metadata
is gotten by requesting JSON for a package on PyPI like so...
import json
import requests
name = "dask-cuda"
req = requests.get(f"https://pypi.org/pypi/{name}/json")
metadata = json.loads(req.content)
assert metadata["info"]["name"] == name
This appears valid when looking at dask-cuda
on PyPI
Am I missing something?
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.
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.
I have often wished the upstream Warehouse data model was captured somewhere other than in the code for warehouse (e.g. an OpenAPI spec, some TypedDict
s, really anything...)
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.
Ah good catch! Thanks Nick 🙏
Wasn't thinking about fixtures for some reason 🤦♂️
Yeah was really hoping I could find some docs describing this somewhere, but was unable 😞
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.
all the "truth" is out there:
- https://github.com/pypi/warehouse/blob/main/warehouse/classifiers/models.py
- https://github.com/pypi/warehouse/blob/main/warehouse/packaging/models.py
There's an open issue for documenting it, but no spec as of yet.
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.
as far as I remember, pypi converts the _
to -
, but it does not work for all
packages that were initially specified as having the _
will just work with it. pypi api is a bit confusing
Also looks like |
I've found that an increasing number of packages' build chains will start spitting out |
Am ok with that. Mainly want to be consistent with whichever approach we choose |
Hi folks, sorry for my delay. |
I am a bit busy these days, I don't have much free time to take a proper look at this |
Toggling for CI |
is it still relevant? I remember that it is not using |
Yes as we are still handling That said, if we would rather inject the |
Description
Since
{{ name }}
is already templated elsewhere, template it in the filename of the archive too for consistency.Note: This behavior was observed in comment ( conda-forge/staged-recipes#22395 (comment) )