use Tox to build NEWS

This commit is contained in:
meejah 2020-03-11 10:52:26 -06:00
parent 602c6d1811
commit 241b5a3d36

31
tox.ini
View File

@ -115,6 +115,37 @@ commands =
# put it back
mv pyproject.toml towncrier.pyproject.toml
[testenv:news]
passenv = TAHOE_LAFS_* PIP_* SUBUNITREPORTER_* USERPROFILE HOMEDRIVE HOMEPATH
# see comment in [testenv] about "certifi"
whitelist_externals = mv
deps =
certifi
towncrier >= 19.2
commands =
# With pip >= 10 the existence of pyproject.toml (which we are
# required to have to configure towncrier) triggers a "build
# isolation" mode which prevents anything from working. Avoid
# triggering that pip behavior by keeping the towncrier configuration
# somewhere else and only bringing it in when it's actually needed
# (after pip is done).
#
# Some discussion is available at
# https://github.com/pypa/pip/issues/5696
#
# towncrier post 19.2 (unreleased as of this writing) adds a --config
# option that can be used instead of this file shuffling.
mv towncrier.pyproject.toml pyproject.toml
# towncrier 19.2 + works with python2.7
python -m towncrier --yes
# put it back
mv pyproject.toml towncrier.pyproject.toml
# commit the changes
git commit -m "update NEWS.txt for release"
[testenv:deprecations]
setenv =
PYTHONWARNINGS=default::DeprecationWarning