From b2410d9fe01369cd6602fb1459a60b3808cefb19 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Wed, 26 Sep 2018 20:18:21 +0100 Subject: [PATCH] tox: add envs to build sdist, pure/native wheels, and upload to pypi --- tox.ini | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/tox.ini b/tox.ini index f824da787..79216b1ee 100644 --- a/tox.ini +++ b/tox.ini @@ -55,3 +55,41 @@ deps = requests changedir = {toxinidir} commands = python tools/update_cython_shadow.py {posargs} + +[testenv:sdist] +deps = + setuptools + cython +changedir = {toxinidir} +commands = + python -c 'import shutil; shutil.rmtree("dist", ignore_errors=True)' + python setup.py --with-cython sdist --dist-dir dist + +[testenv:pure-wheel] +deps = + {[testenv:sdist]deps} + pip + wheel +setenv = CU2QU_WITH_CYTHON=0 +changedir = {toxinidir} +commands = + {[testenv:sdist]commands} + pip wheel --pre --no-deps --no-cache-dir --wheel-dir dist --find-links dist \ + --no-binary {[tox]package_name} {[tox]package_name} + +[testenv:native-wheel] +deps = {[testenv:pure-wheel]deps} +setenv = CU2QU_WITH_CYTHON=1 +changedir = {toxinidir} +commands = {[testenv:pure-wheel]commands} + +; we only upload the pure cu2qu-*-py2.py3-any.whl (for now) +[testenv:pypi] +deps = + {[testenv:pure-wheel]deps} + twine +passenv = TWINE_USERNAME TWINE_PASSWORD +changedir = {toxinidir} +commands = + {[testenv:pure-wheel]commands} + twine upload dist/*.whl dist/*.zip