mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-11 17:56:18 +03:00
Append custom parameter to the end of sys.argv
This commit is contained in:
parent
d9076fa8ca
commit
e6fa5dff63
|
@ -11,14 +11,12 @@ backend_class = build_wheel.__self__.__class__
|
|||
class _CustomBuildMetaBackend(backend_class):
|
||||
def run_setup(self, setup_script="setup.py"):
|
||||
if self.config_settings:
|
||||
params = []
|
||||
for key, values in self.config_settings.items():
|
||||
if not isinstance(values, list):
|
||||
values = [values]
|
||||
for value in values:
|
||||
params.append(f"--pillow-configuration={key}={value}")
|
||||
sys.argv.append(f"--pillow-configuration={key}={value}")
|
||||
|
||||
sys.argv = sys.argv[:1] + params + sys.argv[1:]
|
||||
return super().run_setup(setup_script)
|
||||
|
||||
def build_wheel(
|
||||
|
|
5
setup.py
5
setup.py
|
@ -998,10 +998,9 @@ ext_modules = [
|
|||
|
||||
|
||||
# parse configuration from _custom_build/backend.py
|
||||
while len(sys.argv[1]) >= 2 and sys.argv[1].startswith("--pillow-configuration="):
|
||||
_, key, value = sys.argv[1].split("=", 2)
|
||||
while sys.argv[-1].startswith("--pillow-configuration="):
|
||||
_, key, value = sys.argv.pop().split("=", 2)
|
||||
configuration.setdefault(key, []).append(value)
|
||||
del sys.argv[1]
|
||||
|
||||
try:
|
||||
setup(
|
||||
|
|
Loading…
Reference in New Issue
Block a user