From 4d21a0adbf4280315ba69eb6ae5e159bf02e87aa Mon Sep 17 00:00:00 2001 From: messense Date: Tue, 10 Aug 2021 14:02:49 +0800 Subject: [PATCH] Remove `[tool.maturin]` options from Python PEP 517 side --- maturin/__init__.py | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/maturin/__init__.py b/maturin/__init__.py index dc2da449d..3d7a11834 100644 --- a/maturin/__init__.py +++ b/maturin/__init__.py @@ -14,25 +14,10 @@ import subprocess import sys from subprocess import SubprocessError -from typing import List, Dict +from typing import Dict import toml -# these are only used when creating the sdist, not when building it -create_only_options = [ - "sdist-include", -] - -available_options = [ - "bindings", - "cargo-extra-args", - "compatibility", - "manylinux", - "rustc-extra-args", - "skip-auditwheel", - "strip", -] - def get_config() -> Dict[str, str]: with open("pyproject.toml", encoding="utf-8") as fp: @@ -40,25 +25,11 @@ def get_config() -> Dict[str, str]: return pyproject_toml.get("tool", {}).get("maturin", {}) -def get_config_options() -> List[str]: - config = get_config() - options = [] - for key, value in config.items(): - if key in create_only_options: - continue - if key not in available_options: - # attempt to install even if keys from newer or older versions are present - sys.stderr.write(f"WARNING: {key} is not a recognized option for maturin\n") - options.append("--{}={}".format(key, value)) - return options - - # noinspection PyUnusedLocal def build_wheel(wheel_directory, config_settings=None, metadata_directory=None): # PEP 517 specifies that only `sys.executable` points to the correct # python interpreter command = ["maturin", "pep517", "build-wheel", "-i", sys.executable] - command.extend(get_config_options()) print("Running `{}`".format(" ".join(command))) sys.stdout.flush() @@ -140,7 +111,6 @@ def prepare_metadata_for_build_wheel(metadata_directory, config_settings=None): "--interpreter", sys.executable, ] - command.extend(get_config_options()) print("Running `{}`".format(" ".join(command))) try: