From 836cc85eec1b85d7506716e4064eae0eb597612c Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Thu, 4 Oct 2018 06:55:23 -0400 Subject: [PATCH] support passing extra arguments to bdist_wheel in build-python-release Users of this role may want to pass extra arguments, such as the --universal flag. Those arguments need to come after the bdist_wheel argument to setup.py so that the command line processor understands them. Change-Id: I38a3ef28b2c78821ec81a3f1adf0cfeef946d98f Signed-off-by: Doug Hellmann --- roles/build-python-release/README.rst | 6 ++++++ roles/build-python-release/defaults/main.yaml | 1 + roles/build-python-release/tasks/main.yaml | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/roles/build-python-release/README.rst b/roles/build-python-release/README.rst index 3a2981c3b..452e197a8 100644 --- a/roles/build-python-release/README.rst +++ b/roles/build-python-release/README.rst @@ -7,3 +7,9 @@ Build sdist and wheel for Python projects. The python interpreter to use. Set it to "python3" to use python 3, for example. + +.. zuul:rolevar:: bdist_wheel_xargs + :default: '' + + Extra arguments to pass to the bdist_wheel command when building + packages. diff --git a/roles/build-python-release/defaults/main.yaml b/roles/build-python-release/defaults/main.yaml index 10203cd5f..9edcde0bc 100644 --- a/roles/build-python-release/defaults/main.yaml +++ b/roles/build-python-release/defaults/main.yaml @@ -1,2 +1,3 @@ zuul_work_dir: "{{ zuul.project.src_dir }}" release_python: "python" +bdist_wheel_xargs: "" diff --git a/roles/build-python-release/tasks/main.yaml b/roles/build-python-release/tasks/main.yaml index bd56cf798..fe8369e56 100644 --- a/roles/build-python-release/tasks/main.yaml +++ b/roles/build-python-release/tasks/main.yaml @@ -1,4 +1,4 @@ - name: Build a tarball and wheel - command: "{{release_python}} setup.py sdist bdist_wheel" + command: "{{release_python}} setup.py sdist bdist_wheel {{bdist_wheel_xargs}}" args: chdir: "{{ zuul_work_dir }}"