From 23cd5f152668b41f8faf8c4cdae47acf77109a20 Mon Sep 17 00:00:00 2001 From: meejah Date: Mon, 27 Aug 2018 17:44:17 -0600 Subject: [PATCH 1/4] add a 'draftnews' tox environment --- towncrier.pyproject.toml | 6 ++++-- tox.ini | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/towncrier.pyproject.toml b/towncrier.pyproject.toml index 7f32c9599..266f81a3a 100644 --- a/towncrier.pyproject.toml +++ b/towncrier.pyproject.toml @@ -1,6 +1,8 @@ [tool.towncrier] - package = "allmydata" - package_dir = "src" +# towncrier requires python3.5+ but Tahoe-LAFS doesn't support that +# so we can't import it -- must specify --version to towncrier +# package = "allmydata" +# package_dir = "src" filename = "NEWS.rst" directory = "newsfragments" start_string = ".. towncrier start line" diff --git a/tox.ini b/tox.ini index 2271bd2ac..e1f39ed67 100644 --- a/tox.ini +++ b/tox.ini @@ -67,6 +67,40 @@ commands = # file. See pyproject.toml for legal values. python -m towncrier.check +[testenv:draftnews] +basepython=python3.6 +passenv = TAHOE_LAFS_* PIP_* SUBUNITREPORTER_* USERPROFILE HOMEDRIVE HOMEPATH +# Get "certifi" to avoid bug #2913. Basically if a `setup_requires=...` causes +# a package to be installed (with setuptools) then it'll fail on certain +# platforms (travis's OX-X 10.12, Slackware 14.2) because PyPI's TLS +# requirements (TLS >= 1.2) are incompatible with the old TLS clients +# available to those systems. Installing it ahead of time (with pip) avoids +# this problem. +whitelist_externals = mv +deps = + certifi + towncrier +skip_install = true +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 + + # this burns in another copy of the version -- but we can't + # import tahoe until it supports python3.5+ + python -m towncrier --draft --version 1.14.0 + + # put it back + mv pyproject.toml towncrier.pyproject.toml + + [testenv:deprecations] setenv = PYTHONWARNINGS=default::DeprecationWarning From 972f6eb8359a6b9cb71af666644dede59c1e3910 Mon Sep 17 00:00:00 2001 From: meejah Date: Wed, 29 Aug 2018 14:30:34 -0600 Subject: [PATCH 2/4] newfragment --- newsfragments/2942.feature | 1 + 1 file changed, 1 insertion(+) create mode 100644 newsfragments/2942.feature 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 From c731473d9efb49c78d142838710082b7c58faada Mon Sep 17 00:00:00 2001 From: meejah Date: Tue, 9 Apr 2019 15:33:55 -0600 Subject: [PATCH 3/4] newer towncrier works with py2.7 --- towncrier.pyproject.toml | 6 ++---- tox.ini | 9 +++------ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/towncrier.pyproject.toml b/towncrier.pyproject.toml index 266f81a3a..4f6afa710 100644 --- a/towncrier.pyproject.toml +++ b/towncrier.pyproject.toml @@ -1,8 +1,6 @@ [tool.towncrier] -# towncrier requires python3.5+ but Tahoe-LAFS doesn't support that -# so we can't import it -- must specify --version to towncrier -# package = "allmydata" -# package_dir = "src" + package_dir = "src" + package = "allmydata" filename = "NEWS.rst" directory = "newsfragments" start_string = ".. towncrier start line" diff --git a/tox.ini b/tox.ini index e1f39ed67..f5b83e390 100644 --- a/tox.ini +++ b/tox.ini @@ -68,7 +68,6 @@ commands = python -m towncrier.check [testenv:draftnews] -basepython=python3.6 passenv = TAHOE_LAFS_* PIP_* SUBUNITREPORTER_* USERPROFILE HOMEDRIVE HOMEPATH # Get "certifi" to avoid bug #2913. Basically if a `setup_requires=...` causes # a package to be installed (with setuptools) then it'll fail on certain @@ -79,8 +78,7 @@ passenv = TAHOE_LAFS_* PIP_* SUBUNITREPORTER_* USERPROFILE HOMEDRIVE HOMEPATH whitelist_externals = mv deps = certifi - towncrier -skip_install = true + towncrier >= 19.2 commands = # With pip >= 10 the existence of pyproject.toml (which we are # required to have to configure towncrier) triggers a "build @@ -93,9 +91,8 @@ commands = # https://github.com/pypa/pip/issues/5696 mv towncrier.pyproject.toml pyproject.toml - # this burns in another copy of the version -- but we can't - # import tahoe until it supports python3.5+ - python -m towncrier --draft --version 1.14.0 + # towncrier 19.2 + works with python2.7 + python -m towncrier --draft # put it back mv pyproject.toml towncrier.pyproject.toml From 1f5b647beee352ccf21b9b32ed5e5aa0b4dbd7c8 Mon Sep 17 00:00:00 2001 From: meejah Date: Tue, 9 Apr 2019 15:35:45 -0600 Subject: [PATCH 4/4] simplify comment (from review) --- tox.ini | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tox.ini b/tox.ini index f5b83e390..7cb1682b8 100644 --- a/tox.ini +++ b/tox.ini @@ -69,12 +69,7 @@ commands = [testenv:draftnews] passenv = TAHOE_LAFS_* PIP_* SUBUNITREPORTER_* USERPROFILE HOMEDRIVE HOMEPATH -# Get "certifi" to avoid bug #2913. Basically if a `setup_requires=...` causes -# a package to be installed (with setuptools) then it'll fail on certain -# platforms (travis's OX-X 10.12, Slackware 14.2) because PyPI's TLS -# requirements (TLS >= 1.2) are incompatible with the old TLS clients -# available to those systems. Installing it ahead of time (with pip) avoids -# this problem. +# see comment in [testenv] about "certifi" whitelist_externals = mv deps = certifi