Skip to content
tox.ini 1.73 KiB
Newer Older
[tox]
envlist =
    {py35,py36,py37}-test
    lint
    sort
    format
    type
    docs
    changelog
    metadata-release
skip_missing_interpreters = True
isolated_build = True

[testenv]
description = run the unit tests
passenv = *
deps = 
  pytest
  pytest-cov
  pytest-mock
  requests-mock
commands = 
  pytest test/ --cov={toxinidir}/librehosters_cli/ --no-cov-on-fail {posargs}

[testenv:lint]
description = lint the source
skipsdist = True
commands = 
  flake8 {posargs} librehosters_cli/ test/

[testenv:sort]
description = sort the source
skipsdist = True
commands = 
  isort {posargs:-rc -c} -sp setup.cfg librehosters_cli/ test/

[testenv:format]
description = format the source
basepython = python3.6
skipsdist = True
commands = 
  black {posargs:--check} librehosters_cli/ test/

[testenv:type]
description = type check the source
basepython = python3.7
skipsdist = True
commands = 
  mypy librehosters_cli/ test/

[testenv:docs]
description = build the documentation
skipsdist = True
commands = 
  python -m setup build_sphinx
decentral1se's avatar
decentral1se committed

[testenv:changelog]
description = draft the changelog
skipsdist = True
decentral1se's avatar
decentral1se committed
deps = 
  towncrier
commands = 

[testenv:metadata-release]
description = validate the package metadata
commands =
  twine check .tox/dist/*

[testenv:test-release]
description = make a test release
deps =
  {[testenv:metadata-release]deps}
commands =
    python -m setup sdist bdist_wheel
    twine upload --repository-url https://test.pypi.org/legacy/ dist/*

[testenv:prod-release]
description = make a production release
deps =
  {[testenv:metadata-release]deps}
commands =
    python -m setup sdist bdist_wheel
    twine upload dist/*