From 500b4016eb46f2510c914040e17d420d9c822235 Mon Sep 17 00:00:00 2001 From: Tim Burke Date: Wed, 2 Jun 2021 16:46:42 -0700 Subject: [PATCH] build-python-release: Add flag for whether to build a wheel or not Default to true to preserve existing behavior. Change-Id: I7d34fdce546fd37d13aeed78e45f119fc52fe2ef --- roles/build-python-release/README.rst | 5 +++++ roles/build-python-release/defaults/main.yaml | 1 + roles/build-python-release/tasks/main.yaml | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/roles/build-python-release/README.rst b/roles/build-python-release/README.rst index e67681d37..fc86259bd 100644 --- a/roles/build-python-release/README.rst +++ b/roles/build-python-release/README.rst @@ -8,6 +8,11 @@ Build sdist and wheel for Python projects. The python interpreter to use. Set it to "python3" to use python 3, 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 :default: '' diff --git a/roles/build-python-release/defaults/main.yaml b/roles/build-python-release/defaults/main.yaml index 9edcde0bc..5ad6efac9 100644 --- a/roles/build-python-release/defaults/main.yaml +++ b/roles/build-python-release/defaults/main.yaml @@ -1,3 +1,4 @@ zuul_work_dir: "{{ zuul.project.src_dir }}" release_python: "python" bdist_wheel_xargs: "" +build_wheel: true diff --git a/roles/build-python-release/tasks/main.yaml b/roles/build-python-release/tasks/main.yaml index fd7b7084d..9e6b8be18 100644 --- a/roles/build-python-release/tasks/main.yaml +++ b/roles/build-python-release/tasks/main.yaml @@ -2,3 +2,9 @@ command: "{{ release_python }} setup.py sdist bdist_wheel {{ bdist_wheel_xargs }}" args: 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