Skip to content

Commit

Permalink
in pep517 build default compatibility to off instead of always specif…
Browse files Browse the repository at this point in the history
…ying (#1992)

* in pep517 build default compatibility to off instead of always specifying

* fix

* Update __init__.py

* Update Changelog.md

* Update maturin/__init__.py

---------

Co-authored-by: messense <messense@icloud.com>
  • Loading branch information
altendky and messense committed Mar 14, 2024
1 parent 1f276ce commit 1c4a4e6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
4 changes: 4 additions & 0 deletions 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.
Expand Down
16 changes: 10 additions & 6 deletions maturin/__init__.py
Expand Up @@ -63,22 +63,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 options and "--manylinux" not in options:
# default to off if not otherwise specified
options = ["--compatibility", "off", *options]

command = [*base_command, *options]

print("Running `{}`".format(" ".join(command)))
sys.stdout.flush()
Expand Down

0 comments on commit 1c4a4e6

Please sign in to comment.