summaryrefslogtreecommitdiff
path: root/ci
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2019-05-27 09:32:53 -0400
committerNed Batchelder <ned@nedbatchelder.com>2019-05-27 09:32:53 -0400
commit9f20af81df965b1f0c3e2c11614ea4e44dc4268f (patch)
tree84f3b0938046cd2b15699a5d7dce0d55561b0477 /ci
parenta812a86b5b20afb595d2a4c0101ec2eb86a2ebe4 (diff)
downloadpython-coveragepy-git-9f20af81df965b1f0c3e2c11614ea4e44dc4268f.tar.gz
More flexible version number finding
Diffstat (limited to 'ci')
-rw-r--r--ci/upload_relnotes.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/ci/upload_relnotes.py b/ci/upload_relnotes.py
index 1cc89013..a5dd7fe5 100644
--- a/ci/upload_relnotes.py
+++ b/ci/upload_relnotes.py
@@ -13,6 +13,9 @@ Run with two arguments: the .rst file to parse, and the Tidelift package name:
python upload_relnotes.py CHANGES.rst pypi/coverage
+Every section that has something that looks like a version number in it will
+be uploaded as the release notes for that version.
+
"""
import os.path
@@ -85,12 +88,13 @@ def relnotes(mdlines):
Each tuple is a separate version mentioned in the release notes.
- A version is an h2 that starts with "Version ".
+ A version is any section with \d\.\d in the header text.
"""
- for hlevel, htext, text in sections(parse_md(mdlines)):
- if hlevel == 'h2' and htext.startswith('Version '):
- version = htext.split()[1]
+ for _, htext, text in sections(parse_md(mdlines)):
+ m_version = re.search(r"\d+\.\d[^ ]*", htext)
+ if m_version:
+ version = m_version.group()
yield version, text
def convert_rst_file_to_markdown(rst_filename):