changelog: update version number generation to actual usage (#41851)

This commit is contained in:
Frédéric Péters 2020-04-18 15:06:10 +02:00
parent 39d3112069
commit e15376e44e
1 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,7 @@
import datetime
import textwrap
import os
import re
import sys
import pytz
@ -71,8 +72,8 @@ def changelog_from_git(project, version_suffix, path,
continue
version = name.lstrip('v').replace('-', '.')
if is_pep0440:
# pep440 limit free-style version number after a +
version = version.replace('.g', '+g')
# use .postX+g form
version = re.sub('\.(\d+)\.g', r'.post\1+g', version)
if i == 0:
version += version_suffix
if epoch: