diff --git a/newsfragments/2942.feature b/newsfragments/2942.feature new file mode 100644 index 000000000..1655a0330 --- /dev/null +++ b/newsfragments/2942.feature @@ -0,0 +1 @@ +Add a "tox -e draftnews" which runs towncrier in draft mode \ No newline at end of file diff --git a/towncrier.pyproject.toml b/towncrier.pyproject.toml index 7f32c9599..4f6afa710 100644 --- a/towncrier.pyproject.toml +++ b/towncrier.pyproject.toml @@ -1,6 +1,6 @@ [tool.towncrier] - package = "allmydata" package_dir = "src" + package = "allmydata" filename = "NEWS.rst" directory = "newsfragments" start_string = ".. towncrier start line" diff --git a/tox.ini b/tox.ini index fa2e41fe5..e5595a9d6 100644 --- a/tox.ini +++ b/tox.ini @@ -98,6 +98,32 @@ commands = # file. See pyproject.toml for legal 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