Skip to content

Commit cb08709

Browse files
authored
Merge branch 'master' into uncommitted
2 parents 482cbea + a0a34d3 commit cb08709

16 files changed

+202
-38
lines changed

.github/workflows/ci.yml

-7
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,6 @@ jobs:
7373
- name: CPython 3.5
7474
tox: py35
7575
action: 3.5
76-
- name: CPython 3.6
77-
tox: py36
78-
action: 3.6
7976
- name: CPython 3.7
8077
tox: py37
8178
action: 3.7
@@ -88,9 +85,6 @@ jobs:
8885
- name: PyPy 2.7
8986
tox: pypy27
9087
action: pypy-2.7
91-
- name: PyPy 3.6
92-
tox: pypy36
93-
action: pypy-3.6
9488
- name: PyPy 3.7
9589
tox: pypy37
9690
action: pypy-3.7
@@ -176,7 +170,6 @@ jobs:
176170
needs:
177171
- build
178172
- test
179-
- check
180173
steps:
181174
- uses: actions/checkout@v2
182175

CONTRIBUTING.rst

+12-2
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,19 @@ Step-by-step
7575

7676
- Edit ``src/towncrier/_version.py`` such as ``__version__ = Version('towncrier', 19, 9, 0)`` to remove the release candidate indication.
7777

78-
- Return to the towncrier build step and continue.
78+
- Manually update the NEWS.rst by removing the `.rcN` version and update the release date.
7979

80-
- If the final release has been completed, continue below.
80+
- Disable the actual check for `tox -e check-newsfragment` so that you will have a green test run.
81+
82+
- Commit and push the changes to trigger the CI tests and make sure all are green.
83+
84+
- Tag as ``19.9.0`` and push the tag to the primary repository.
85+
86+
- This will result in another build which will publish to PyPI for the final release.
87+
88+
- Confirm the presence of the release on PyPI.
89+
90+
- If the final release has been completed, re-enable `tox -e check-newsfragment`.
8191

8292
- Increment the patch version by one and set to a development version.
8393

NEWS.rst

+23
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,29 @@
22

33
.. towncrier release notes start
44
5+
towncrier 21.9.0 (2022-02-04)
6+
=============================
7+
8+
Features
9+
--------
10+
11+
- towncrier --version` was added to the command line interface to show the product version. (`#339 <https://github.com/hawkowl/towncrier/issues/339>`_)
12+
- Support Toml v1 syntax with tomli on Python 3.6+ (`#354 <https://github.com/hawkowl/towncrier/issues/354>`_)
13+
14+
15+
Bugfixes
16+
--------
17+
18+
- Stop writing title twice when ``title_format`` is specified. (`#346 <https://github.com/hawkowl/towncrier/issues/346>`_)
19+
- Disable universal newlines when reading TOML (`#359 <https://github.com/hawkowl/towncrier/issues/359>`_)
20+
21+
22+
Misc
23+
----
24+
25+
- `#332 <https://github.com/hawkowl/towncrier/issues/332>`_, `#333 <https://github.com/hawkowl/towncrier/issues/333>`_, `#334 <https://github.com/hawkowl/towncrier/issues/334>`_, `#338 <https://github.com/hawkowl/towncrier/issues/338>`_
26+
27+
528
towncrier 21.3.0 (2021-04-02)
629
=============================
730

README.rst

+14
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,17 @@ Furthermore, you can add your own fragment types using:
163163
directory = "deprecation"
164164
name = "Deprecations"
165165
showcontent = true
166+
167+
168+
Automatic pull request checks
169+
-----------------------------
170+
171+
To check if a feature branch adds at least one news fragment, run::
172+
173+
towncrier check
174+
175+
By default this compares the current branch against ``origin/master``. You can use ``--compare-with`` if the trunk is named differently::
176+
177+
towncrier check --compare-with origin/main
178+
179+
The check is automatically skipped when the main news file is modified inside the branch as this signals a release branch that is expected to not have news fragments.

src/towncrier/_settings.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
import pkg_resources
88

99
if sys.version_info >= (3, 6):
10-
from tomli import load as _toml_load
10+
import tomli
1111
else:
12-
from toml import load as _toml_load
12+
tomli = None
13+
import toml
1314

1415
from collections import OrderedDict
1516

@@ -74,9 +75,12 @@ def load_config(directory):
7475

7576

7677
def load_config_from_file(directory, config_file):
77-
78-
with io.open(config_file, "r", encoding="utf8") as conffile:
79-
config = _toml_load(conffile)
78+
if tomli:
79+
with io.open(config_file, "rb") as conffile:
80+
config = tomli.load(conffile)
81+
else:
82+
with io.open(config_file, "r", encoding="utf8", newline="") as conffile:
83+
config = toml.load(conffile)
8084

8185
return parse_toml(directory, config)
8286

src/towncrier/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77

88
from incremental import Version
99

10-
__version__ = Version("towncrier", 21, 3, 1, dev=0)
10+
__version__ = Version("towncrier", 21, 9, 1, dev=0)
1111
__all__ = ["__version__"]

src/towncrier/_writer.py

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ def append_to_newsfile(
3838
if start_string:
3939
f.write((u"\n\n" + start_string + u"\n").encode("utf8"))
4040

41-
f.write(top_line.encode("utf8"))
4241
f.write(content.encode("utf8"))
4342
if existing_content:
4443
if existing_content[0]:

src/towncrier/check.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def __main(comparewith, directory, config):
3838
raise
3939

4040
if not files_changed:
41-
click.echo("On trunk, or no diffs, so no newsfragment required.")
41+
click.echo("On {} branch, or no diffs, so no newsfragment required.".format(comparewith))
4242
sys.exit(0)
4343

4444
files = {
@@ -52,6 +52,11 @@ def __main(comparewith, directory, config):
5252
click.echo("{}. {}".format(n, change))
5353
click.echo("----")
5454

55+
news_file = os.path.normpath(os.path.join(base_directory, config["filename"]))
56+
if news_file in files:
57+
click.echo("Checks SKIPPED: news file changes detected.")
58+
sys.exit(0)
59+
5560
if config.get("directory"):
5661
fragment_base_directory = os.path.abspath(config["directory"])
5762
fragment_directory = None

src/towncrier/newsfragments/332.misc

Whitespace-only changes.

src/towncrier/newsfragments/333.misc.rst

-1
This file was deleted.

src/towncrier/newsfragments/334.misc.rst

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Make the check subcommand succeed for branches that change the news file
2+
3+
This should enable the ``check`` subcommand to be used as a CI lint step and
4+
not fail when a pull request only modifies the configured news file (i.e. when
5+
the news file is being assembled for the next release).

src/towncrier/newsfragments/338.misc.rst

-1
This file was deleted.

src/towncrier/newsfragments/339.feature.rst

-1
This file was deleted.

src/towncrier/newsfragments/354.feature.rst

-1
This file was deleted.

0 commit comments

Comments
 (0)