Merge pull request #524 from meejah/2942.towncrier-draft

add a 'draftnews' tox environment
This commit is contained in:
meejah 2019-09-03 10:47:05 -06:00 committed by GitHub
commit e178d7d809
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 1 deletions

View File

@ -0,0 +1 @@
Add a "tox -e draftnews" which runs towncrier in draft mode

View File

@ -1,6 +1,6 @@
[tool.towncrier]
package = "allmydata"
package_dir = "src"
package = "allmydata"
filename = "NEWS.rst"
directory = "newsfragments"
start_string = ".. towncrier start line"

26
tox.ini
View File

@ -98,6 +98,32 @@ commands =
# file. See pyproject.toml for legal <change type> values.
python -m towncrier.check
[testenv:draftnews]
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
mv towncrier.pyproject.toml pyproject.toml
# towncrier 19.2 + works with python2.7
python -m towncrier --draft
# put it back
mv pyproject.toml towncrier.pyproject.toml
[testenv:deprecations]
setenv =
PYTHONWARNINGS=default::DeprecationWarning