-
-
Notifications
You must be signed in to change notification settings - Fork 294
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
Custom files under dist-info
as part of a build hook
#620
Comments
|
Is the "mapping" referenced in the documentation " [project]
...
[tool.my_tool.metadata]
uuid = "1234"
[tool.hatch.build.targets.wheel.extra_metadata]
"tool.my_tool.metadata.uuid" = "UUID" |
[tool.hatch.build.targets.wheel.extra-metadata]
"./UUID.txt" = "UUID" Your hook would need to write to the source location e.g. |
or just commit a file... |
You're the first to use this feature btw, hooray for premature optimization 😄 |
Well first off thanks for the quick replies! I do want the data to live in the https://discuss.python.org/t/add-custom-metadata-to-wheel-file/21410/2 No need to add support to |
Thanks for the context!
Since the option reads the sources from disk this implies your hook would write to a temporary file which is only known at build time which means I do need to add support to |
Hm okay, I believe you but I do not understand why more changes are necessary — of course, my understanding of Python packaging has a ton of room to grow, so that's not surprising. I can't do this because the Which step in this process requires the changes to |
To illustrate, please:
|
I've done so, and I think I understand. Right now, If so, I didn't post this issue to create work for you. I understand if this is a feature
|
Correct
I will, gimme a few hours |
No promises on a release timeline |
Thank you!!! |
Anytime! |
FWIW, the dist-info directory is supposed to be a flat set of files that is supposed to be modelled as a dictionary of "name": "text content" (at least, based off of my understanding from chats during the installer's API design discussions). |
Perhaps we can standardize a user-defined |
Perhaps -- but right now, that violates the designers' expectations for how files in dist-info are handled. I don't think any other backend allows injecting files in there directly, but it's probably worth disallowing folders to be cautious IMO. :) |
Directories already exist inside there as of PEP 639 with |
I'd also note that the use case I want (that motivates this issue) is just one more |
If directories are truly disallowed, perhaps user files could be placed at the top-level. Though as @ofek notes, the |
I will remind folks that PEP 639 is still in draft state. |
Sure, but nobody has expressed any disagreement with a dedicated directory for licenses. If you personally do then you might want to bring it up on Discourse |
Oh, I don't have a strong opinion but it's a thing we're changing and the design needs to consider/document the potential implications of that. I've already mentioned this, when I wrote the above comment, over on the discussion about designing the draft PEP: https://discuss.python.org/t/pep-639-round-2-improving-license-clarity-with-better-package-metadata/12622/86?u=pradyunsg |
I'm working on a package manager project that will add a unique identifier to each package. The
[project]
metadata is standardized, as are the contents under theMETADATA
file indist-info/
. I would like to include the UUID of each package under a new file calleddist-info/UUID
, or similar.Can this be done using a Hatchlings build hook? Reading through the documentation, I'm not sure if "metadata" refers to the
pyproject.toml
metadata, or the metadata as compiled by the build tool, and written todist-info
.The text was updated successfully, but these errors were encountered: