Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Towncrier stopped to render a title in version 21.3.0 #340

Closed
YevheniiSemendiak opened this issue Apr 12, 2021 · 5 comments
Closed

Towncrier stopped to render a title in version 21.3.0 #340

YevheniiSemendiak opened this issue Apr 12, 2021 · 5 comments

Comments

@YevheniiSemendiak
Copy link

Hey there! After installing the latest Towncrier version, it stopped generating a release title (simply proceeding with the release details):
image

The config file is following:

[tool.towncrier]
    directory = "CHANGELOG.D"
    filename = "CHANGELOG.md"
    template = "CHANGELOG.D/towncrier_template.md"
    issue_format = "[#{issue}](https://github.com/neuro-inc/cookiecutter-neuro-project/issues/{issue})"
    start_string = "[comment]: # (towncrier release notes start)\n"

    [[tool.towncrier.type]]
        directory = "feature"
        name = "Features"
        showcontent = true

    [[tool.towncrier.type]]
        directory = "bugfix"
        name = "Bugfixes"
        showcontent = true

    [[tool.towncrier.type]]
        directory = "doc"
        name = "Improved Documentation"
        showcontent = true

    [[tool.towncrier.type]]
        directory = "removal"
        name = "Deprecations and Removals"
        showcontent = true

    [[tool.towncrier.type]]
        directory = "misc"
        name = "Misc"
        showcontent = false
@altendky
Copy link
Member

Looks like this changed in 41781d9. The non-draft output also lacks the title. Noted below, this doesn't happen for the same command in the towncrier repository itself so it seems to be triggered by a configuration between the two. I'm going to guess this is attributable to #147. As noted at https://github.com/twisted/towncrier/blob/b8a34900476ab218b297f4c876e75ac65eac1738/NEWS.rst#features-1:

I think you may want this from the default template.

{{ versiondata.name }} {{ versiondata.version }} ({{ versiondata.date }})
{{ top_underline * ((versiondata.name + versiondata.version + versiondata.date)|length + 4)}}

Please let me know if this addresses the issue or not. Sorry for the trouble.

maybe-not-needed details
$ git remote -v
origin  https://github.com/neuro-inc/cookiecutter-neuro-project (fetch)
origin  https://github.com/neuro-inc/cookiecutter-neuro-project (push)
$ git rev-parse HEAD
f3385ddb4c8a5d017de061cfc6967ed38b480509
$ git -C ../towncrier rev-parse HEAD
41781d96a7774304962b08a9b49aab0404a75516
$ venv/bin/pip install -e ../towncrier
Obtaining file:///home/altendky/repos/towncrier
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
    Preparing wheel metadata ... done
Requirement already satisfied: jinja2 in ./venv/lib/python3.9/site-packages (from towncrier==19.2.0) (2.11.3)
Requirement already satisfied: toml in ./venv/lib/python3.9/site-packages (from towncrier==19.2.0) (0.10.2)
Requirement already satisfied: incremental in ./venv/lib/python3.9/site-packages (from towncrier==19.2.0) (21.3.0)
Requirement already satisfied: Click in ./venv/lib/python3.9/site-packages (from towncrier==19.2.0) (7.1.2)
Requirement already satisfied: MarkupSafe>=0.23 in ./venv/lib/python3.9/site-packages (from jinja2->towncrier==19.2.0) (1.1.1)
Installing collected packages: towncrier
  Attempting uninstall: towncrier
    Found existing installation: towncrier 19.2.0
    Uninstalling towncrier-19.2.0:
      Successfully uninstalled towncrier-19.2.0
  Running setup.py develop for towncrier
Successfully installed towncrier
WARNING: You are using pip version 20.2.3; however, version 21.0.1 is available.
You should consider upgrading via the '/home/altendky/repos/cookiecutter-neuro-project/venv/bin/python3 -m pip install --upgrade pip' command.                                                                                                  
$ venv/bin/towncrier --draft --name "Neuro Platform Project Template" --version 21.04.12                   
Loading template...
Finding news fragments...
Rendering news fragments...
Draft only -- nothing has been written.
What is seen below is what would be written.


No significant changes.
$ venv/bin/towncrier --name "Neuro Platform Project Template" --version 21.04.12
Loading template...
Finding news fragments...
Rendering news fragments...
Writing to newsfile...
Staging newsfile...
Removing news fragments...
Done!
$ git diff --cached
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 885e988..9ce5d34 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,10 @@
 
 [comment]: # (towncrier release notes start)
 
+
+No significant changes.
+
+
 Neuro Platform Project Template v21.04.12 (2021-04-12)
 ======================================================
 

The same applies to 21.3.0

$ git -C ../towncrier rev-parse HEAD
eab34611b93a4ba6e3805cd546a674d88dbd43cf
$ venv/bin/towncrier --draft --name "Neuro Platform Project Template" --version 21.04.12
Loading template...
Finding news fragments...
Rendering news fragments...
Draft only -- nothing has been written.
What is seen below is what would be written.


No significant changes.
$ venv/bin/towncrier --name "Neuro Platform Project Template" --version 21.04.12
Loading template...
Finding news fragments...
Rendering news fragments...
Writing to newsfile...
Staging newsfile...
Removing news fragments...
Done!
$ git diff --cached
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 885e988..9ce5d34 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,10 @@
 
 [comment]: # (towncrier release notes start)
 
+
+No significant changes.
+
+
 Neuro Platform Project Template v21.04.12 (2021-04-12)
 ======================================================
 

This does not happen in the Towncrier repository with the same commands.

$ git rev-parse HEAD
eab34611b93a4ba6e3805cd546a674d88dbd43cf
$ venv/bin/towncrier --draft --name "Neuro Platform Project Template" --version 21.04.12
Loading template...
Finding news fragments...
Rendering news fragments...
Draft only -- nothing has been written.
What is seen below is what would be written.

Neuro Platform Project Template 21.04.12 (2021-04-13)
=====================================================

Misc
----

- `#332 <https://github.com/hawkowl/towncrier/issues/332>`_
$ venv/bin/towncrier --name "Neuro Platform Project Template" --version 21.04.12
Loading template...
Finding news fragments...
Rendering news fragments...
Writing to newsfile...
Staging newsfile...
Removing news fragments...
I want to remove the following files:
/home/altendky/repos/towncrier/src/towncrier/newsfragments/332.misc
Is it okay if I remove those files? [Y/n]: n
Done!
$ git diff --cached
diff --git a/NEWS.rst b/NEWS.rst
index 68b4446..4bc558c 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -2,6 +2,15 @@
 
 .. towncrier release notes start
 
+Neuro Platform Project Template 21.04.12 (2021-04-13)
+=====================================================
+
+Misc
+----
+
+- `#332 <https://github.com/hawkowl/towncrier/issues/332>`_
+
+
 towncrier 21.3.0 (2021-04-02)
 =============================
 

@asottile
Copy link

asottile commented May 4, 2021

@asottile
Copy link

asottile commented May 4, 2021

at the very least the changelog should mention that this version of towncrier includes a breaking change

@hynek
Copy link
Member

hynek commented May 6, 2021

If I add the title to my template, I get two headers as described in #346 so I'm not sure what to do except to pin to <21.3.

hynek added a commit to python-attrs/attrs that referenced this issue May 6, 2021
Currently the title is either not rendered at all, or rendered twice

cf.

- twisted/towncrier#346
- twisted/towncrier#340
@YevheniiSemendiak
Copy link
Author

@altendky, your suggestion helped, thanks!

The-Compiler added a commit to The-Compiler/pytest that referenced this issue Aug 27, 2021
bwoodsend added a commit to bwoodsend/pyinstaller that referenced this issue Oct 4, 2021
Said version made a breaking change - to move the version headings into the
jinja2 template so that anyone using a custom template (like us) is short of a
title. This commit adds the title to our own custom template and pins the
towncrier verion to >= 21.3.0 so that we don't accidently get two titles.

See twisted/towncrier#147 and
twisted/towncrier#340 for details.
bwoodsend added a commit to pyinstaller/pyinstaller that referenced this issue Oct 6, 2021
Said version made a breaking change - to move the version headings into the
jinja2 template so that anyone using a custom template (like us) is short of a
title. This commit adds the title to our own custom template and pins the
towncrier verion to >= 21.3.0 so that we don't accidently get two titles.

See twisted/towncrier#147 and
twisted/towncrier#340 for details.
bwoodsend added a commit to pyinstaller/pyinstaller that referenced this issue Oct 9, 2021
Said version made a breaking change - to move the version headings into the
jinja2 template so that anyone using a custom template (like us) is short of a
title. This commit adds the title to our own custom template and pins the
towncrier verion to >= 21.3.0 so that we don't accidently get two titles.

See twisted/towncrier#147 and
twisted/towncrier#340 for details.
shinevue added a commit to shinevue/python-starter that referenced this issue Jul 10, 2023
shinevue added a commit to shinevue/python-starter that referenced this issue Jul 10, 2023
Currently the title is either not rendered at all, or rendered twice

cf.

- twisted/towncrier#346
- twisted/towncrier#340
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants