Skip to content

Conversation

@LecrisUT
Copy link
Collaborator

Related to #992 formatter, I think it would be good to have a common place where to define all the format variables. Not sure on the implementation though if it should be a TypedDict, simple Mapping wrapper or anything else.

@LecrisUT LecrisUT requested a review from henryiii February 20, 2025 13:56
@henryiii
Copy link
Collaborator

I think it could be a simple function that returns a (typed) dict? Putting it in one place is a good idea though.

@LecrisUT
Copy link
Collaborator Author

If we're ok with a function input with a lot of kwargs, then yeah it will have the same interface with less boilerplate.

I was thinking if it was possible to save it somewhere, but each component needed is calculated somewhere noncentral, like the wheel tags.

@LecrisUT
Copy link
Collaborator Author

I was hoping to include version as part of the formatter, but it is actually quite tricky when setupools_scm is part of the dynamic_metadata that is being evaluated there 🤷

@henryiii
Copy link
Collaborator

@LecrisUT There's a community meeting currently if you'd like to join.

Have a central location to view and evaluate all format variables used in the evaluation of the `pyproject.toml`

Signed-off-by: Cristian Le <[email protected]>

```{eval-rst}
.. autoattribute:: scikit_build_core.format.PyprojectFormatter.build_type
:no-index:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to generate this section, but maybe in a later PR

@@ -0,0 +1,27 @@
# Formattable fields

The following configure keys are formatted as Python f-strings:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not good at naming these.

@LecrisUT LecrisUT added this to the v0.11.0 milestone Feb 21, 2025
@henryiii henryiii merged commit 8f79c17 into scikit-build:main Feb 24, 2025
60 checks passed
@henryiii henryiii changed the title Add a format module that is used in the expansion of pyproject.toml refactor: add a format module that is used in the expansion of pyproject.toml Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants