Ensure wheel exists for build-release-python

We need it to exist for building wheels. It should be
installed in a pre-playbook.

Change-Id: Ieaec3d21911decf11283e82fed97dd26b3a93ffa
This commit is contained in:
Sorin Sbarnea 2020-06-17 13:32:22 +01:00 committed by Monty Taylor
parent 07e0a5a6c4
commit 3f961ce202
9 changed files with 282 additions and 4 deletions

1
.gitignore vendored
View File

@ -12,3 +12,4 @@ doc/build
# pbr generates these # pbr generates these
AUTHORS AUTHORS
ChangeLog ChangeLog
dist

View File

@ -11,6 +11,7 @@ Python Roles
.. zuul:autorole:: ensure-tox .. zuul:autorole:: ensure-tox
.. zuul:autorole:: ensure-twine .. zuul:autorole:: ensure-twine
.. zuul:autorole:: ensure-virtualenv .. zuul:autorole:: ensure-virtualenv
.. zuul:autorole:: ensure-wheel
.. zuul:autorole:: fetch-coverage-output .. zuul:autorole:: fetch-coverage-output
.. zuul:autorole:: fetch-python-sdist-output .. zuul:autorole:: fetch-python-sdist-output
.. zuul:autorole:: fetch-sphinx-output .. zuul:autorole:: fetch-sphinx-output

View File

@ -0,0 +1,4 @@
- hosts: all
roles:
- role: ensure-wheel
wheel_python: "{{ release_python | default(python) }}"

View File

@ -5,8 +5,7 @@ Build sdist and wheel for Python projects.
.. zuul:rolevar:: release_python .. zuul:rolevar:: release_python
:default: python :default: python
The python interpreter to use. Set it to "python3" to use python 3, The python interpreter to use. Defaults to "python".
for example.
.. zuul:rolevar:: bdist_wheel_xargs .. zuul:rolevar:: bdist_wheel_xargs
:default: '' :default: ''

View File

@ -0,0 +1,9 @@
Ensure wheel exists for Python projects.
**Role Variables**
.. zuul:rolevar:: wheel_python
:default: python3
The python interpreter to use. Defaults to "python3".

View File

@ -0,0 +1 @@
wheel_python: python3

View File

@ -0,0 +1,15 @@
- name: Check for wheel
command: "{{ wheel_python }} -m wheel"
failed_when: false
register: wheel_exists
- name: Include ensure-pip
vars:
ensure_pip_from_upstream_interpreters: "{{ wheel_python }}"
include_role:
name: ensure-pip
when: wheel_exists.rc != 0
- name: Install wheel
command: "{{ wheel_python }} -m pip install --user wheel"
when: wheel_exists.rc != 0

View File

@ -1,11 +1,225 @@
- job:
name: zuul-jobs-test-build-python-release-jobs
description: Test the build-python-release-jobs role
files:
- roles/build-python-release/.*
- setup.cfg
- setup.py
vars:
role_name: build-python-release
release_python: python3
pre-run: playbooks/python/release-pre.yaml
run: test-playbooks/simple-role-test.yaml
tags: all-platforms
- job:
name: zuul-jobs-test-build-python-release-jobs-centos-7
description: Test the build-python-release-jobs role on centos-7
parent: zuul-jobs-test-build-python-release-jobs
tags: auto-generated
nodeset:
nodes:
- name: centos-7
label: centos-7
- job:
name: zuul-jobs-test-build-python-release-jobs-centos-8
description: Test the build-python-release-jobs role on centos-8
parent: zuul-jobs-test-build-python-release-jobs
tags: auto-generated
nodeset:
nodes:
- name: centos-8
label: centos-8
- job:
name: zuul-jobs-test-build-python-release-jobs-debian-stretch
description: Test the build-python-release-jobs role on debian-stretch
parent: zuul-jobs-test-build-python-release-jobs
tags: auto-generated
nodeset:
nodes:
- name: debian-stretch
label: debian-stretch
- job:
name: zuul-jobs-test-build-python-release-jobs-fedora-31
description: Test the build-python-release-jobs role on fedora-31
parent: zuul-jobs-test-build-python-release-jobs
tags: auto-generated
nodeset:
nodes:
- name: fedora-31
label: fedora-31
- job:
name: zuul-jobs-test-build-python-release-jobs-gentoo-17-0-systemd
description: Test the build-python-release-jobs role on gentoo-17-0-systemd
parent: zuul-jobs-test-build-python-release-jobs
tags: auto-generated
nodeset:
nodes:
- name: gentoo-17-0-systemd
label: gentoo-17-0-systemd
- job:
name: zuul-jobs-test-build-python-release-jobs-opensuse-15
description: Test the build-python-release-jobs role on opensuse-15
parent: zuul-jobs-test-build-python-release-jobs
tags: auto-generated
nodeset:
nodes:
- name: opensuse-15
label: opensuse-15
- job:
name: zuul-jobs-test-build-python-release-jobs-opensuse-tumbleweed-nv
voting: false
description: Test the build-python-release-jobs role on opensuse-tumbleweed
parent: zuul-jobs-test-build-python-release-jobs
tags: auto-generated
nodeset:
nodes:
- name: opensuse-tumbleweed
label: opensuse-tumbleweed
- job:
name: zuul-jobs-test-build-python-release-jobs-ubuntu-bionic
description: Test the build-python-release-jobs role on ubuntu-bionic
parent: zuul-jobs-test-build-python-release-jobs
tags: auto-generated
nodeset:
nodes:
- name: ubuntu-bionic
label: ubuntu-bionic
- job:
name: zuul-jobs-test-build-python-release-jobs-ubuntu-xenial
description: Test the build-python-release-jobs role on ubuntu-xenial
parent: zuul-jobs-test-build-python-release-jobs
tags: auto-generated
nodeset:
nodes:
- name: ubuntu-xenial
label: ubuntu-xenial
- job:
name: zuul-jobs-test-ensure-wheel-jobs
description: Test the ensure-wheel role
files:
- roles/ensure-wheel/.*
- setup.cfg
- setup.py
vars:
role_name: ensure-wheel
run: test-playbooks/simple-role-test.yaml
tags: all-platforms
- job:
name: zuul-jobs-test-ensure-wheel-jobs-centos-7
description: Test the ensure-wheel role on centos-7
parent: zuul-jobs-test-ensure-wheel-jobs
tags: auto-generated
nodeset:
nodes:
- name: centos-7
label: centos-7
- job:
name: zuul-jobs-test-ensure-wheel-jobs-centos-8
description: Test the ensure-wheel role on centos-8
parent: zuul-jobs-test-ensure-wheel-jobs
tags: auto-generated
nodeset:
nodes:
- name: centos-8
label: centos-8
- job:
name: zuul-jobs-test-ensure-wheel-jobs-debian-stretch
description: Test the ensure-wheel role on debian-stretch
parent: zuul-jobs-test-ensure-wheel-jobs
tags: auto-generated
nodeset:
nodes:
- name: debian-stretch
label: debian-stretch
- job:
name: zuul-jobs-test-ensure-wheel-jobs-fedora-31
description: Test the ensure-wheel role on fedora-31
parent: zuul-jobs-test-ensure-wheel-jobs
tags: auto-generated
nodeset:
nodes:
- name: fedora-31
label: fedora-31
- job:
name: zuul-jobs-test-ensure-wheel-jobs-gentoo-17-0-systemd
description: Test the ensure-wheel role on gentoo-17-0-systemd
parent: zuul-jobs-test-ensure-wheel-jobs
tags: auto-generated
nodeset:
nodes:
- name: gentoo-17-0-systemd
label: gentoo-17-0-systemd
- job:
name: zuul-jobs-test-ensure-wheel-jobs-opensuse-15
description: Test the ensure-wheel role on opensuse-15
parent: zuul-jobs-test-ensure-wheel-jobs
tags: auto-generated
nodeset:
nodes:
- name: opensuse-15
label: opensuse-15
- job:
name: zuul-jobs-test-ensure-wheel-jobs-opensuse-tumbleweed-nv
voting: false
description: Test the ensure-wheel role on opensuse-tumbleweed
parent: zuul-jobs-test-ensure-wheel-jobs
tags: auto-generated
nodeset:
nodes:
- name: opensuse-tumbleweed
label: opensuse-tumbleweed
- job:
name: zuul-jobs-test-ensure-wheel-jobs-ubuntu-bionic
description: Test the ensure-wheel role on ubuntu-bionic
parent: zuul-jobs-test-ensure-wheel-jobs
tags: auto-generated
nodeset:
nodes:
- name: ubuntu-bionic
label: ubuntu-bionic
- job:
name: zuul-jobs-test-ensure-wheel-jobs-ubuntu-xenial
description: Test the ensure-wheel role on ubuntu-xenial
parent: zuul-jobs-test-ensure-wheel-jobs
tags: auto-generated
nodeset:
nodes:
- name: ubuntu-xenial
label: ubuntu-xenial
- job: - job:
name: zuul-jobs-test-ensure-python-pyenv name: zuul-jobs-test-ensure-python-pyenv
description: Test the ensure-python role with pyenv description: Test the ensure-python role with pyenv
files: files:
- zuul-tests.d/python-roles-jobs.yaml - roles/ensure-python/.*
- test-playbooks/ensure-python-pyenv.yaml
run: test-playbooks/ensure-python-pyenv.yaml run: test-playbooks/ensure-python-pyenv.yaml
tags: all-platforms tags: all-platforms
# -* AUTOGENERATED *-
# The following project section is autogenerated by
# tools/update-test-platforms.py
# Please re-run to generate new job lists
- job: - job:
name: zuul-jobs-test-ensure-python-pyenv-centos-7 name: zuul-jobs-test-ensure-python-pyenv-centos-7
description: Test the ensure-python role with pyenv on centos-7 description: Test the ensure-python role with pyenv on centos-7
@ -100,6 +314,24 @@
- project: - project:
check: check:
jobs: jobs:
- zuul-jobs-test-build-python-release-jobs-centos-7
- zuul-jobs-test-build-python-release-jobs-centos-8
- zuul-jobs-test-build-python-release-jobs-debian-stretch
- zuul-jobs-test-build-python-release-jobs-fedora-31
- zuul-jobs-test-build-python-release-jobs-gentoo-17-0-systemd
- zuul-jobs-test-build-python-release-jobs-opensuse-15
- zuul-jobs-test-build-python-release-jobs-opensuse-tumbleweed-nv
- zuul-jobs-test-build-python-release-jobs-ubuntu-bionic
- zuul-jobs-test-build-python-release-jobs-ubuntu-xenial
- zuul-jobs-test-ensure-wheel-jobs-centos-7
- zuul-jobs-test-ensure-wheel-jobs-centos-8
- zuul-jobs-test-ensure-wheel-jobs-debian-stretch
- zuul-jobs-test-ensure-wheel-jobs-fedora-31
- zuul-jobs-test-ensure-wheel-jobs-gentoo-17-0-systemd
- zuul-jobs-test-ensure-wheel-jobs-opensuse-15
- zuul-jobs-test-ensure-wheel-jobs-opensuse-tumbleweed-nv
- zuul-jobs-test-ensure-wheel-jobs-ubuntu-bionic
- zuul-jobs-test-ensure-wheel-jobs-ubuntu-xenial
- zuul-jobs-test-ensure-python-pyenv-centos-7 - zuul-jobs-test-ensure-python-pyenv-centos-7
- zuul-jobs-test-ensure-python-pyenv-centos-8 - zuul-jobs-test-ensure-python-pyenv-centos-8
- zuul-jobs-test-ensure-python-pyenv-debian-stretch - zuul-jobs-test-ensure-python-pyenv-debian-stretch
@ -111,6 +343,22 @@
- zuul-jobs-test-ensure-python-pyenv-ubuntu-xenial - zuul-jobs-test-ensure-python-pyenv-ubuntu-xenial
gate: gate:
jobs: jobs:
- zuul-jobs-test-build-python-release-jobs-centos-7
- zuul-jobs-test-build-python-release-jobs-centos-8
- zuul-jobs-test-build-python-release-jobs-debian-stretch
- zuul-jobs-test-build-python-release-jobs-fedora-31
- zuul-jobs-test-build-python-release-jobs-gentoo-17-0-systemd
- zuul-jobs-test-build-python-release-jobs-opensuse-15
- zuul-jobs-test-build-python-release-jobs-ubuntu-bionic
- zuul-jobs-test-build-python-release-jobs-ubuntu-xenial
- zuul-jobs-test-ensure-wheel-jobs-centos-7
- zuul-jobs-test-ensure-wheel-jobs-centos-8
- zuul-jobs-test-ensure-wheel-jobs-debian-stretch
- zuul-jobs-test-ensure-wheel-jobs-fedora-31
- zuul-jobs-test-ensure-wheel-jobs-gentoo-17-0-systemd
- zuul-jobs-test-ensure-wheel-jobs-opensuse-15
- zuul-jobs-test-ensure-wheel-jobs-ubuntu-bionic
- zuul-jobs-test-ensure-wheel-jobs-ubuntu-xenial
- zuul-jobs-test-ensure-python-pyenv-centos-7 - zuul-jobs-test-ensure-python-pyenv-centos-7
- zuul-jobs-test-ensure-python-pyenv-centos-8 - zuul-jobs-test-ensure-python-pyenv-centos-8
- zuul-jobs-test-ensure-python-pyenv-debian-stretch - zuul-jobs-test-ensure-python-pyenv-debian-stretch

View File

@ -249,7 +249,7 @@
name: build-python-release name: build-python-release
description: | description: |
Build a source tarball and a bdist wheel for uploading. Build a source tarball and a bdist wheel for uploading.
pre-run: playbooks/python/pre.yaml pre-run: playbooks/python/release-pre.yaml
run: playbooks/python/release.yaml run: playbooks/python/release.yaml
post-run: playbooks/python/tarball-post.yaml post-run: playbooks/python/tarball-post.yaml