Skip to content

Commit 837111c

Browse files
authored
Merge pull request #1271 from moreati/prep-0.3.25a1
Prepare v0.3.25a1
2 parents 9dee946 + dd4b575 commit 837111c

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

docs/changelog.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ To avail of fixes in an unreleased version, please download a ZIP file
2121
In progress (unreleased)
2222
------------------------
2323

24+
25+
26+
v0.3.25a1 (2025-06-05)
27+
----------------------
28+
2429
* :gh:issue:`1258` Initial Ansible 12 (ansible-core 2.19) support
2530
* :gh:issue:`1258` :mod:`ansible_mitogen`: Initial Ansible datatag support
2631
(:gh:anspull:`84621`)

docs/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66

77
def changelog_version(path, encoding='utf-8'):
8+
"Return the 1st *stable* (not pre, dev) version in the changelog"
9+
# See also grep_version() in setup.py
810
version_pattern = re.compile(
911
r'^v(?P<version>[0-9]+\.[0-9]+\.[0-9]+)',
1012
re.MULTILINE,

setup.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,34 @@
3333

3434

3535
def grep_version():
36+
# See also changlelog_version() in docs.conf.py
3637
path = os.path.join(os.path.dirname(__file__), 'mitogen/__init__.py')
38+
39+
# Based on https://packaging.python.org/en/latest/specifications/version-specifiers/#appendix-parsing-version-strings-with-regular-expressions
40+
# e.g. "__version__ = (0, 1, 2)", "__version__ = (0, 1, 3, 'dev')",
41+
# "__version__ = (0, 1, 4, 'a', 1)"
3742
version_pattern = re.compile(
38-
r"__version__ = \((\d+), (\d+), (\d+)(?:, '(dev)')?\)",
43+
r'''
44+
^__version__\s=\s\(
45+
(?P<major>\d+)
46+
,\s
47+
(?P<minor>\d+)
48+
,\s
49+
(?P<patch>\d+)
50+
(?:
51+
(?:,\s '(?P<dev_l>dev)')
52+
| (?:,\s '(?P<pre_l>a|b)' ,\s (?P<pre_n>\d+))
53+
)?
54+
\)
55+
$
56+
''',
57+
re.MULTILINE | re.VERBOSE,
3958
)
4059
with open(path) as fp:
4160
match = version_pattern.search(fp.read())
4261
if match is None:
4362
raise ValueError('Could not find __version__ string in %s', path)
44-
# E.g. '0.1.2', '0.1.3dev'
63+
# e.g. '0.1.2', '0.1.3dev', '0.1.4a1'
4564
return '.'.join(str(part) for part in match.groups() if part)
4665

4766

0 commit comments

Comments
 (0)