Skip to content

PEP 9999: building (draft; do not merge) - #44

Draft
mgorny wants to merge 11 commits into
mainfrom
pep-building
Draft

mgorny wants to merge 11 commits into
mainfrom
pep-building

Conversation

@mgorny

@mgorny mgorny commented Mar 2, 2026 •

Copy link
Copy Markdown

Here's an early draft, mostly as context to #40.


📚 Documentation preview 📚: https://wheelnext-peps--44.org.readthedocs.build/

@read-the-docs-community

read-the-docs-community Bot commented Mar 2, 2026 •

Copy link
Copy Markdown

@mgorny
mgorny force-pushed the pep-building branch 3 times, most recently from 2fed7a0 to 96c81fc Compare March 9, 2026 13:16

@rgommers rgommers left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This looks pretty good to me, thanks @mgorny! I only have a handful of comments at the moment.

Comment thread peps/pep-9998.rst Outdated
For consistency, it is RECOMMENDED that build backends implement the
following interface for building variant wheels:

- variant metadata seed is stored in ``pyproject.toml`` file, as

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The word "seed" here and in the next section isn't too helpful. It seems to imply that changes may occur, it's only a starting point (a la "random seed"). That isn't the case - the metadata in pyproject.toml and in variants.json should actually be 100% consistent. And as for PEP 621, if both exist, I'd expect the pyproject.toml version to be authoritative.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I'm not opposed to replacing or removing "seed", but there are some differences:

  1. variants will only include the selected variant.
  2. providers.{namespace}.static-properties may be filled from a plugin.
  3. default-priorities.feature.{namespace} may be filled from a plugin.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@mgorny I still don't like "seed" at all. I suggest "variant configuration" instead.

Comment thread peps/pep-9998.rst Outdated
Comment thread peps/pep-9998.rst Outdated
Comment thread peps/pep-9998.rst Outdated
Comment thread peps/pep-9998.rst Outdated
@rgommers

rgommers commented Jul 10, 2026 •

Copy link
Copy Markdown

I just remembered that I had made a diagram early on in wheelnext/pep_817_wheel_variants#9. Here's the latest version:

image

Needs some tweaks to align with the final version of this PEP, but we may want to consider including it - a lot easier to grasp than lots of text and numbered lists of steps.

EDIT: or better, include into the reworked PEP 817 as an Informational PEP, since it looks like we're going that way.

@mgorny
mgorny force-pushed the pep-providers branch 3 times, most recently from 93b34f5 to 8a445ad Compare August 17, 2026 14:26
@mgorny
mgorny force-pushed the pep-building branch 2 times, most recently from 0ff098b to 405bcb6 Compare September 9, 2026 17:33
@mgorny
mgorny force-pushed the pep-providers branch 2 times, most recently from e4f3057 to 1e4b442 Compare September 21, 2026 17:00

@rgommers rgommers left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This probably is still in flux at the moment, but I had a look. Overall looks good, and all of the main decisions still make sense to me. The main comment I have right now is that default-priorities.feature is still used in some places.

Comment thread peps/pep-9998.rst Outdated
Comment thread peps/pep-9998.rst Outdated
@mgorny
mgorny force-pushed the pep-building branch 2 times, most recently from eda6717 to df2b8e4 Compare September 28, 2026 16:14
@mgorny
mgorny force-pushed the pep-building branch 2 times, most recently from 6255877 to b9060ff Compare October 13, 2026 16:01
@mgorny
mgorny force-pushed the pep-providers branch 3 times, most recently from c0c345d to 24ec08c Compare October 19, 2026 12:20
@mgorny mgorny changed the title PEP 9998: building (draft; do not merge) PEP 9999: building (draft; do not merge) Oct 20, 2026
@rgommers

Copy link
Copy Markdown

@mgorny the diff is quite large, how about rebasing or merging in the main branch of python/peps so we get all the latest changes to 817, 825 and 850 as a baseline?. Also, this PR should probably be retargeted to a new integration branch for just the Building PEP.

@mgorny

mgorny commented Oct 26, 2026

Copy link
Copy Markdown
Author

Oh, sorry, I thought I've rebased it already.

Signed-off-by: Michał Górny <mgorny@quansight.com>
Signed-off-by: Michał Górny <mgorny@quansight.com>
Signed-off-by: Michał Górny <mgorny@quansight.com>
Signed-off-by: Michał Górny <mgorny@quansight.com>
Signed-off-by: Michał Górny <mgorny@quansight.com>
Signed-off-by: Michał Górny <mgorny@quansight.com>
@mgorny
mgorny changed the base branch from pep-providers to main October 26, 2026 12:15
@mgorny

mgorny commented Oct 26, 2026

Copy link
Copy Markdown
Author

Oh, I needed to change base here.

Signed-off-by: Michał Górny <mgorny@quansight.com>

@rgommers rgommers left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Here is a first set of comments - I'm about halfway through, more coming later today or tomorrow.

Comment thread peps/pep-9999.rst Outdated
Comment thread peps/pep-9999.rst Outdated
Comment thread peps/pep-9999.rst Outdated
Comment thread peps/pep-9999.rst Outdated
Comment thread peps/pep-9999.rst Outdated
Comment thread peps/pep-9999.rst Outdated
Comment thread peps/pep-9999.rst
list of variant feature names and their values that are valid
according to the provider plugin. The ordering of the lists is
insignificant. A particular plugin version MUST always return the same
lists (modulo ordering), irrespective of any runtime conditions.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It would be good to state in the Rationale that the ordering of get_all_configs is insignificant because the interface is meant only for validating that properties/features are valid. And that it's useful to leave the list unordered because (reason: I think so that only features that are actually used need to be specified in feature-order).

Comment thread peps/pep-9999.rst

The ``build-requires`` key is only valid in the ``pyproject.toml`` file.
In a variant wheel built from that file, the ``build-requires`` and
``plugin-api`` keys MUST be removed, and ``static-properties`` MUST be

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

static-properties MUST be added -> that seems to imply that it must always be added, even when building a null variant.

It's a little hard to work this out in my head, but this juggling between required/optional and what metadata must be retained in the built wheel feels like it has room for corner cases.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

That's actually a good question. I suppose it must be added, because otherwise you'd end up with a provider entry that has none of the required keys.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Now I wonder if we should make it explicit in PEP 850 that it may be empty.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Wait a minute, I've gotten confused here. These are the lists of all supported properties, so they should always be filled, as we expect them to be the same across all variants. I suppose a tool may remove a provider if the variant doesn't use it, but it definitely mustn't output build-requires or incorrect static-properties.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Hmm, but no, that will break PEP 850 schema. We can't remove the provider information without removing it from namespace order, and if we removed it there, we couldn't guarantee consistency.

Comment thread peps/pep-9999.rst
.. code:: toml

[variant]
"$schema" = "https://variants-schema.wheelnext.dev/peps/850/v0.2.0.json"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This schema must be bumped right? PEP 850 has v0.2.0, and we're adding to it here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

No, the JSON schema is not being changed. We've decided against having a separate TOML schema, so the extensions here don't affect the schema. This is probably something that should be mentioned in the rationale.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ah, okay - then yes, let's add that prominently in Rationale.

Comment thread peps/pep-9999.rst Outdated
mgorny and others added 4 commits October 26, 2026 16:53
Co-authored-by: Ralf Gommers <ralf.gommers@gmail.com>
Signed-off-by: Michał Górny <mgorny@quansight.com>
Signed-off-by: Michał Górny <mgorny@quansight.com>
Signed-off-by: Michał Górny <mgorny@quansight.com>

@rgommers rgommers left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Some more comments on the text, nothing too dramatic.

Comment thread peps/pep-9999.rst
Type: Standards Track
Topic: Packaging
Requires: 825, 850
Created: 02-Mar-2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
Created: 02-Mar-2026
Created: 26-Oct-2026

Comment thread peps/pep-9999.rst
Comment on lines +42 to +46
backends. All of this is given as a recommendation to make documentation
universal, build backends interchangeable and therefore improve user
experience. At the same, build backends are permitted to follow a
different implementation path as necessary to fit their specific use
cases.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'm not so sure about this part, it feels like an unnecessary disclaimer. This can be said of many PEPs "feel free to ignore and use tool.xxx to do your own thing".

I'll need to think about this some more, but I'm currently inclined to suggest leaving out these sentences.

Comment thread peps/pep-9999.rst

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in :rfc:`2119`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can we remove this? It's just boilerplate.

Comment thread peps/pep-9998.rst Outdated
For consistency, it is RECOMMENDED that build backends implement the
following interface for building variant wheels:

- variant metadata seed is stored in ``pyproject.toml`` file, as

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@mgorny I still don't like "seed" at all. I suggest "variant configuration" instead.

Comment thread peps/pep-9999.rst
.. code:: toml

[variant]
"$schema" = "https://variants-schema.wheelnext.dev/peps/850/v0.2.0.json"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This doesn't look right to me. It'd be very unusual to point at an actual JSON schema here. I think all we want is the version number. There will only ever be one authoritative place for a schema; we don't want to indicate that one can make up their own.

Comment thread peps/pep-9999.rst

When using build backends, using ``get_requires*()`` hooks for exposing
provider plugin dependencies as regular build dependencies is
recommended. This permits reusing the existing frontend logic for

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why "recommended"? I don't think that build backends should be making their own choices here, this should be mandatory.

Comment thread peps/pep-9999.rst
integration`_) follows from :pep:`518` specifying that such tables are
"reserved for future use by other PEPs". Therefore, introducing the
``[variant]`` table is backwards compatible.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I'd state explicitly here that hence there are no additional backwards compatibility implications beyond those listed in PEP 825.

Comment thread peps/pep-9999.rst
There are no new security implications beyond what is already noted in
:pep:`850`. In particular, the use of provider plugins during build time
is not seen as an additional risk, given that the dependencies are
provided by the user directly (for example, in ``pyproject.toml``) and

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
provided by the user directly (for example, in ``pyproject.toml``) and
specified by the package author directly (in ``pyproject.toml``) and

This branch has not been deployed

No deployments
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