From 1e0454c01258316538bb8aabf20772025830cf9e Mon Sep 17 00:00:00 2001 From: Karl Knechtel Date: Fri, 26 Jul 2024 16:47:21 -0400 Subject: [PATCH] Debugging Determined that the order of parameters in the Appendix A example code was wrong, and fixed it. This matters because `pyproject_hooks` passes them positionally, despite that both default to `None` and it's not at all obvious what order they "should" be in. I commented on https://github.com/python/peps/issues/2536, and cited https://github.com/pypa/packaging.python.org/pull/1111, to draw attention to the issue in the PEP. The corresponding documentation issue, https://github.com/pypa/packaging.python.org/issues/955, still appears not to be resolved. --- src/bbbb/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/bbbb/__init__.py b/src/bbbb/__init__.py index f7ddc67..97a2c0d 100644 --- a/src/bbbb/__init__.py +++ b/src/bbbb/__init__.py @@ -32,7 +32,12 @@ def build_sdist(sdist_directory, config_settings): def build_wheel( - wheel_directory, metadata_directory=None, config_settings=None + # This is the order specified in PEP 517, subsection "Mandatory hooks". + # The example build backend in Appendix A reverses the order of + # `config_settings` and `metadata_directory`. However, this does not + # actually work with standard tooling, because `pyproject_hooks` passes + # these arguments positionally and in this specific order. + wheel_directory, config_settings=None, metadata_directory=None ): wheel_name = f"{NAME}-{VERSION}-{PYTHON_TAG}-{ABI_TAG}-{PLATFORM_TAG}.whl" wheel_path = Path(wheel_directory) / wheel_name