build-python-release: Add flag for whether to build a wheel or not

Default to true to preserve existing behavior.

Change-Id: I7d34fdce546fd37d13aeed78e45f119fc52fe2ef
This commit is contained in:
Tim Burke 2021-06-02 16:46:42 -07:00
parent 0a5decdc42
commit 500b4016eb
3 changed files with 12 additions and 0 deletions

View File

@ -8,6 +8,11 @@ Build sdist and wheel for Python projects.
The python interpreter to use. Set it to "python3" to use python 3, The python interpreter to use. Set it to "python3" to use python 3,
for example. for example.
.. zuul:rolevar:: build_wheel
:default: true
Whether to build a wheel. Set to false to just build an sdist tarball.
.. zuul:rolevar:: bdist_wheel_xargs .. zuul:rolevar:: bdist_wheel_xargs
:default: '' :default: ''

View File

@ -1,3 +1,4 @@
zuul_work_dir: "{{ zuul.project.src_dir }}" zuul_work_dir: "{{ zuul.project.src_dir }}"
release_python: "python" release_python: "python"
bdist_wheel_xargs: "" bdist_wheel_xargs: ""
build_wheel: true

View File

@ -2,3 +2,9 @@
command: "{{ release_python }} setup.py sdist bdist_wheel {{ bdist_wheel_xargs }}" command: "{{ release_python }} setup.py sdist bdist_wheel {{ bdist_wheel_xargs }}"
args: args:
chdir: "{{ zuul_work_dir }}" chdir: "{{ zuul_work_dir }}"
when: build_wheel
- name: Just build a tarball
command: "{{ release_python }} setup.py sdist"
args:
chdir: "{{ zuul_work_dir }}"
when: not build_wheel