From 1c8dd5f41c64a9b7547548a4bb31fa80de20f2c9 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 12 Mar 2024 16:25:05 -0400 Subject: [PATCH 1/5] in pep517 build default compatibility to off instead of always specifying --- maturin/__init__.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/maturin/__init__.py b/maturin/__init__.py index 07753679f..7814595d8 100644 --- a/maturin/__init__.py +++ b/maturin/__init__.py @@ -62,22 +62,26 @@ def _build_wheel( ) -> str: # PEP 517 specifies that only `sys.executable` points to the correct # python interpreter - command = [ + base_command = [ "maturin", "pep517", "build-wheel", "-i", sys.executable, - "--compatibility", - "off", ] - command.extend(_additional_pep517_args()) + options = _additional_pep517_args() if editable: - command.append("--editable") + options.append("--editable") pep517_args = get_maturin_pep517_args(config_settings) if pep517_args: - command.extend(pep517_args) + options.extend(pep517_args) + + if "--compatibility" not in command: + # default to off if not otherwise specified + options = ["--compatibility", "off", *options] + + command = [base_command, *options] print("Running `{}`".format(" ".join(command))) sys.stdout.flush() From 9a1782678ee794548ea2999364f7836b48851df2 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 12 Mar 2024 16:31:09 -0400 Subject: [PATCH 2/5] fix --- maturin/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maturin/__init__.py b/maturin/__init__.py index 7814595d8..4df57f3e0 100644 --- a/maturin/__init__.py +++ b/maturin/__init__.py @@ -77,7 +77,7 @@ def _build_wheel( if pep517_args: options.extend(pep517_args) - if "--compatibility" not in command: + if "--compatibility" not in options: # default to off if not otherwise specified options = ["--compatibility", "off", *options] From 62f4989bdc10c0265a0c7ab220c09ed5ed15215e Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Tue, 12 Mar 2024 16:32:20 -0400 Subject: [PATCH 3/5] Update __init__.py --- maturin/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maturin/__init__.py b/maturin/__init__.py index 4df57f3e0..64f0e52f2 100644 --- a/maturin/__init__.py +++ b/maturin/__init__.py @@ -81,7 +81,7 @@ def _build_wheel( # default to off if not otherwise specified options = ["--compatibility", "off", *options] - command = [base_command, *options] + command = [*base_command, *options] print("Running `{}`".format(" ".join(command))) sys.stdout.flush() From 472d7ea029b738f1eb17a7177e2d255ff7971a26 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 13 Mar 2024 15:14:13 -0400 Subject: [PATCH 4/5] Update Changelog.md --- Changelog.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Changelog.md b/Changelog.md index 65e5d0539..55c3c0db9 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,9 @@ # Changelog +## [Unreleased] + +* Fix usage of `--compatibility` when run as a PEP517 backend in [#1992](https://github.com/PyO3/maturin/pull/1992) + ## [1.5.0] - 2024-03-05 * Bump metadata version from 2.1 to 2.3 in [#1965](https://github.com/PyO3/maturin/pull/1965). Source distributions created by maturin now have reliable metadata, meaning tool such as pip, uv and poetry could skip building them for version resolution. From 3abbad7ed5274c156ef56a60775df79aab4ca341 Mon Sep 17 00:00:00 2001 From: messense Date: Thu, 14 Mar 2024 09:04:57 +0800 Subject: [PATCH 5/5] Update maturin/__init__.py --- maturin/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maturin/__init__.py b/maturin/__init__.py index 64f0e52f2..30eda1329 100644 --- a/maturin/__init__.py +++ b/maturin/__init__.py @@ -77,7 +77,7 @@ def _build_wheel( if pep517_args: options.extend(pep517_args) - if "--compatibility" not in options: + if "--compatibility" not in options and "--manylinux" not in options: # default to off if not otherwise specified options = ["--compatibility", "off", *options]