From 7bc805ef089e518e5ddd195cd0eb9bd9ca2f20f8 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Thu, 8 Nov 2018 18:42:17 +0000 Subject: [PATCH] Fix package building failure due to empty description Adds descriptions and avoid twine check failure when the sdist package was build via python3. It seems that sdist command produce different packages in this unique case where Description field becomes False instead of UNKNOWN. This also adds new dist tox targets that tests that packaging works well. On CI we have diffent job that does almost the same thing. Change-Id: I93300e49b80fc170c1b73ffb5540cd42754e6a21 --- .gitignore | 2 ++ setup.cfg | 3 +++ test-requirements.txt | 2 ++ tox.ini | 11 ++++++++++- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2113079ed..f0eeb7d9a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ # Distribution / packaging *.egg* +build/ +dist/ # Testing .cache diff --git a/setup.cfg b/setup.cfg index 491f9d05c..99240e514 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,9 @@ [metadata] name = browbeat summary = OpenStack Performance Tooling +description-file = + README.rst +description-content-type = text/plain; charset=UTF-8 author = OpenStack author-email = openstack-dev@lists.openstack.org home-page = http://www.browbeatproject.org/ diff --git a/test-requirements.txt b/test-requirements.txt index b6f6cf95a..a6b35820a 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -9,6 +9,7 @@ pykwalify coverage>=3.6 pytest==3.2.1 python-subunit>=0.0.18 +readme_renderer[md] sphinx>=1.3,!=1.6.1 oslosphinx>=2.5.0 # Apache-2.0 oslotest>=1.10.0 # Apache-2.0 @@ -16,3 +17,4 @@ sphinx_rtd_theme testrepository>=0.0.18 testscenarios>=0.4 testtools>=1.4.0 +twine diff --git a/tox.ini b/tox.ini index 31f2e9838..74f6f956b 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 2.0 -envlist = py27,py35,py36,linters +envlist = py27,py35,py36,linters,dist skipsdist = True [testenv] @@ -26,6 +26,15 @@ commands = bash -c "set -e; for config in $(ls conf/); do \ echo conf/$config; pykwalify -d conf/$config -s browbeat/schema/browbeat.yml; done" +[testenv:dist] +basepython = python3 +# reuse linters environment to lower footprint on dev machines +envdir = {toxworkdir}/linters +# test that we can build a valid package +commands = + python setup.py sdist bdist_wheel + python -m twine check dist/* + [testenv:pep8] commands = flake8 {posargs}