tox: add envs to build sdist, pure/native wheels, and upload to pypi

This commit is contained in:
Cosimo Lupo 2018-09-26 20:18:21 +01:00
parent c0a9b3689c
commit b2410d9fe0
No known key found for this signature in database
GPG Key ID: 59D54DB0C9976482

38
tox.ini
View File

@ -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