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

[#614] add towncrier to manage changelog additions #615

Merged
merged 4 commits into from
Sep 9, 2017
Merged

[#614] add towncrier to manage changelog additions #615

merged 4 commits into from
Sep 9, 2017

Conversation

gaborbernat
Copy link
Member

@gaborbernat gaborbernat commented Sep 8, 2017

  • also moved Let skip_install override usedevelop instead of the other way around #571 documentation to news fragment as demonstration
  • extended the documentation build to automatically prepend the current new fragments to the changelog, this way news fragments are also subject to the CI operations, but otherwise when we do a release (and there are no news staged don't get in the way)

@gaborbernat gaborbernat added area:documentation level:medium rought estimate that this might be neither easy nor hard to implement labels Sep 8, 2017
Copy link
Member

@obestwalter obestwalter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM let's start using it :)

@codecov
Copy link

codecov bot commented Sep 8, 2017

Codecov Report

Merging #615 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #615   +/-   ##
=======================================
  Coverage   92.38%   92.38%           
=======================================
  Files          11       11           
  Lines        2391     2391           
=======================================
  Hits         2209     2209           
  Misses        182      182

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ac38ca4...1a8f7d5. Read the comment docs.

@gaborbernat
Copy link
Member Author

hmmm, still WIP, I need to elevate the header level first

@obestwalter
Copy link
Member

the whaddy what what? o.k. go ahead, I have no clue yet how it really works :)

@gaborbernat
Copy link
Member Author

gaborbernat commented Sep 8, 2017

Ok now should be fine; let's wait for the CI to confirm this.

The problem was that now we generate an additional level of headers by town crier, the four big groups. towncrier uses for this level 2 (-), but for us the version numbers were already level 2. So in order to have the correct hierarchy the version numbers in the changelog now are level 1, as it's done in pytest (see https://raw.githubusercontent.com/pytest-dev/pytest/master/CHANGELOG.rst).

@obestwalter
Copy link
Member

Great. I am really looking forward to start using this. The manual way was a major PITA.

... and it will look much nicer wherever we put this.

One thing I just thought of: the little helper I built to generate the long description is not needed anymore then:

tox/setup.py

Lines 41 to 63 in 952385a

def get_linked_changelog(here, n=5):
"""changelog containing last n releases with links to issues"""
repo_url = 'https://github.com/tox-dev/tox'
changelog_url = '%s/blob/master/CHANGELOG' % repo_url
with io.open(os.path.join(here, 'CHANGELOG'), encoding='utf-8') as f:
changelog = f.read()
header_matches = list(re.finditer('^-+$', changelog, re.MULTILINE))
lines = changelog[:header_matches[n].start()].splitlines()[:-1]
title = "Changelog (last %s releases - `full changelog <%s>`_)" % (
n, changelog_url)
changelog = '\n'.join([title, '=' * len(title), "\n", "\n".join(lines)])
issue_replacement = r'`#\1 <%s/issues/\1>`_' % repo_url
for pattern in [r'#(\d+)', r'issue(\d+)']:
changelog = re.sub(pattern, issue_replacement, changelog)
pull_replacement = r'`#p\1 <%s/pull/\1>`_' % repo_url
changelog = re.sub(r'#p(\d+)', pull_replacement, changelog)
return changelog
def get_long_description():
here = os.path.abspath('.')
with io.open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
return "%s\n\n%s" % (f.read(), get_linked_changelog(here))

We should get rid of that right away, before we forget that it' obsolete :)

@obestwalter
Copy link
Member

obestwalter commented Sep 8, 2017

would be something like that then:

def get_long_description(): 
     here = os.path.abspath('.') 
     with io.open(os.path.join(here, 'README.rst'), encoding='utf-8') as f: 
        with io.open(os.path.join(here, 'CHANGELOG.rst'), encoding='utf-8') as g: 
            return "%s\n\n%s" % (f.read(), g.read()) 

@gaborbernat
Copy link
Member Author

@obestwalter there's a filtering step in there, like taking last 5 releases which you removed; but otherwise true 👍

not needed anymore now we have towncrier.
@obestwalter
Copy link
Member

changed it in branch (hopefully did not mess it up, did it in web editor).

@obestwalter
Copy link
Member

full changelog is o.k. I guess.

@obestwalter
Copy link
Member

otherwise, we can readd it later, just want to makw sure we git rid of old busted stuff right away

tox.ini Outdated
@@ -24,6 +24,7 @@ commands = {posargs:py.test -s -x -f -v}
description = invoke sphinx-build and try to build the HTML page, and check that URIs are valid
basepython = python
deps = sphinx >= 1.6.3, < 2
towncrier >= 17.8.0, < 18

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

towncrier uses calver, so that version block is not sensible

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true, will remove it!

@obestwalter
Copy link
Member

mac is awfully slow these days. Anyway let's merge this.

@obestwalter obestwalter merged commit d60f3d0 into tox-dev:master Sep 9, 2017
@The-Compiler
Copy link
Member

Yeah, Travis had some issues: https://www.traviscistatus.com/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:documentation level:medium rought estimate that this might be neither easy nor hard to implement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants