Merge "Use recommended twine check for README validation"

This commit is contained in:
Zuul 2019-04-08 09:09:44 +00:00 committed by Gerrit Code Review
commit c57395f0ee
3 changed files with 11 additions and 3 deletions

View File

@ -1774,8 +1774,9 @@ def main():
validate_model,
validate_release_type,
validate_pypi_permissions,
validate_pypi_readme,
validate_build_sdist,
# Check readme after sdist build to slightly optimize things
validate_pypi_readme,
validate_gitreview,
validate_release_sha_exists,
validate_existing_tags,

View File

@ -94,10 +94,16 @@ def check_readme_format(workdir, repo):
LOG.debug('did not find %s, maybe %s is not a python project',
setup_path, repo)
return None
# Check if the sdist build has been done
build_path = os.path.join(dest, 'dist')
if not os.path.exists(build_path):
build_sdist(workdir, repo)
# NOTE(dhellmann): This relies on validate being run via tox so
# that python3 is present and the docutils package is installed.
# that python3 is present and the twine package is installed.
processutils.check_call(
['python3', 'setup.py', 'check', '--restructuredtext', '--strict'],
['twine', 'check', os.path.join(build_path, '*')],
cwd=dest,
)

View File

@ -21,6 +21,7 @@ prompt_toolkit>=2.0.7
tqdm
mwclient==0.8.1
jsonschema>=2.6.0
twine>=1.13.0
# For release notes generation.
Jinja2>=2.6 # BSD License (3 clause)