add a job to check the metadata for python packages

Change-Id: I4900089d36b114c5a70d8598a9be90a2ab6a73af
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2018-06-12 14:08:28 -04:00
parent dbcfcaaaa6
commit 60d1cd0808
5 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,4 @@
- hosts: all
roles:
- check-python-release
- build-python-release

View File

@ -0,0 +1,10 @@
Test building sdist and wheel for Python projects and verify their
metadata.
** Role Variables **
.. zuul:rolevar:: release_python
:default: python
The python interpreter to use. Set it to "python3" to use python 3,
for example.

View File

@ -0,0 +1,2 @@
zuul_work_dir: "{{ zuul.project.src_dir }}"
release_python: "python"

View File

@ -0,0 +1,13 @@
- name: Install docutils for the README check
# NOTE(dhellmann): We install this unconstrained because we expect
# setuptools to expect the most recent version anyway. We use a
# virtualenv to avoid conflicts with system packages due to pip10
# and later.
pip:
name: docutils
virtualenv: "{{ zuul_work_dir }}/venv"
virtualenv_python: "{{ release_python }}"
- name: Check the package metadata and README format
command: "{{ zuul_work_dir }}/venv/bin/{{ release_python }} setup.py check --restructuredtext --strict"
args:
chdir: "{{ zuul_work_dir }}"

View File

@ -224,6 +224,22 @@
vars:
release_python: python3
- job:
name: test-release-openstack-python3
parent: base
description: |
Test building python tarballs / wheels and the packaging metadata.
pre-run: playbooks/pti-python-tarball/pre.yaml
run: playbooks/pti-python-tarball/check.yaml
post-run:
- playbooks/pti-python-tarball/post.yaml
vars:
release_python: python3
files:
- setup.cfg
- setup.py
- README.rst
- job:
name: publish-openstack-sphinx-docs-base
description: |