forked from h5py/h5py
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rever.xsh
48 lines (40 loc) · 1.41 KB
/
rever.xsh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import re
$PROJECT = $GITHUB_ORG = $GITHUB_REPO = 'h5py'
$ACTIVITIES = ['authors', 'version_bump', 'changelog',
'tag', 'push_tag', 'ghrelease', 'pypi',
]
#
# Version bumping
#
version_re = re.compile(r"(?P<major>\d+)\.(?P<minor>\d+)\.(?P<bugfix>\d+)"
r"(\.(?P<pre>(?!post|dev)[^.]+))?"
r"(.post(?P<post>\d+))?(.dev(?P<dev>\d+))?")
def replace_version_tuple(ver):
parts = version_re.match(ver).groupdict()
ver_tup = ("version_tuple = _H5PY_VERSION_CLS({major}, {minor}, {bugfix}, "
"{pre!r}, {post}, {dev})")
return ver_tup.format(**parts)
$VERSION_BUMP_PATTERNS = [
('setup.py', r'VERSION\s*=.*', "VERSION = '$VERSION'"),
('docs/conf.py', r'release\s*=.*', "release = '$VERSION'"),
('h5py/version.py', r'version_tuple\s*=.*', replace_version_tuple),
]
#
# Changelog
#
$CHANGELOG_FILENAME = 'docs/whatsnew/index.rst'
$CHANGELOG_LATEST = 'docs/whatsnew/$VERSION.rst'
$CHANGELOG_TEMPLATE = 'TEMPLATE.rst'
$CHANGELOG_PATTERN = '.. toctree::\n\n'
$CHANGELOG_HEADER = '.. toctree::\n\n $VERSION\n'
$CHANGELOG_CATEGORIES = (
'New features',
'Deprecations',
'Exposing HDF5 functions',
'Bug fixes',
'Building h5py',
'Development',
)
def format_changelog_category(category):
return category + "\n" + "-" * len(category) + "\n\n"
$CHANGELOG_CATEGORY_TITLE_FORMAT = format_changelog_category