-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: add extra metadata files while building wheels #329
feat: add extra metadata files while building wheels #329
Conversation
172ebe2
to
563a967
Compare
src/fromager/wheels.py
Outdated
tomlkit.dumps(ctx.settings.get_package_settings(req.name)) | ||
) | ||
if data_to_add: | ||
build_file.write_text(tomlkit.dumps(data_to_add)) |
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.
Does this over-write the file, or append to it? Maybe what we really want to do is add the extra data from the plugin to the other settings as a key in the other dict. Something like custom-metadata-extensions
? It's a long name, so something shorter that captures the meaning might be better.
Does TOML impose any restrictions on the syntax for keys? (no spaces, case-insensitive, etc.)
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.
okay I can either add the custom metadata in some key or another option is that i make the settings data as the default function. If a plugin is specified then all the data is added only from there?
TOML does have some restrictions: https://github.com/toml-lang/toml/blob/main/toml.md#keys
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.
How likely is it that data we are pulling from YAML or other places won't be compatible with TOML?
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 think the tomlkit handles it for us. It was able to successfully convert this yaml without an error:
packages:
stevedore:
download_source:
url: https://files.pythonhosted.org/packages/e7/c1/b210bf1071c96ecfcd24c2eeb4c828a2a24bf74b38af13896d02203b1eec/stevedore-${version}.tar.gz
destination_filename: stevedore-custom-${version}.tar.gz
resolver_dist:
sdist_server_url: "https://pypi.org/simple"
include_sdist: false
include_wheels: true
changelog:
"1.0.0 hahaha":
- test hello world
563a967
to
025b8c3
Compare
025b8c3
to
962d95b
Compare
fixes #319
We will create a
BUILD
file in the.dist-info
directory of the wheel. This file is of TOML format and contains the entire settings of the package by default. There is an option for the user to include more data in this file by defining a plugin.Additionally, I added the build system, build backend and build sdist requirements file (hope is that we can use this later to speedup bootstrapping)