Skip to content
Snippets Groups Projects
Commit ae26149e authored by Eric Engestrom's avatar Eric Engestrom Committed by Marge Bot
Browse files

post_version.py: invert `is_point` into `is_first_release` to make its purpose clearer

parent 5fba85bc
No related branches found
No related tags found
Loading
...@@ -33,8 +33,8 @@ from lxml import ( ...@@ -33,8 +33,8 @@ from lxml import (
) )
def is_point_release(version: str) -> bool: def is_first_release(version: str) -> bool:
return not version.endswith('.0') return version.endswith('.0')
def is_release_candidate(version: str) -> bool: def is_release_candidate(version: str) -> bool:
...@@ -48,7 +48,7 @@ def branch_name(version: str) -> str: ...@@ -48,7 +48,7 @@ def branch_name(version: str) -> str:
return f'{major}.{minor}' return f'{major}.{minor}'
def update_index(is_point: bool, version: str) -> None: def update_index(version: str) -> None:
p = pathlib.Path(__file__).parent.parent / 'docs' / 'index.html' p = pathlib.Path(__file__).parent.parent / 'docs' / 'index.html'
with p.open('rt') as f: with p.open('rt') as f:
tree = html.parse(f) tree = html.parse(f)
...@@ -64,11 +64,11 @@ def update_index(is_point: bool, version: str) -> None: ...@@ -64,11 +64,11 @@ def update_index(is_point: bool, version: str) -> None:
a = etree.SubElement( a = etree.SubElement(
body, 'a', attrib={'href': f'relnotes/{version}.html'}) body, 'a', attrib={'href': f'relnotes/{version}.html'})
a.text = f"Mesa {version}" a.text = f"Mesa {version}"
if is_point: if is_first_release(version):
a.tail = " is released. This is a bug fix release."
else:
a.tail = (" is released. This is a new development release. " a.tail = (" is released. This is a new development release. "
"See the release notes for more information about this release.") "See the release notes for more information about this release.")
else:
a.tail = " is released. This is a bug fix release."
root = news.getparent() root = news.getparent()
index = root.index(news) + 1 index = root.index(news) + 1
...@@ -134,9 +134,7 @@ def main() -> None: ...@@ -134,9 +134,7 @@ def main() -> None:
parser.add_argument('version', help="The released version.") parser.add_argument('version', help="The released version.")
args = parser.parse_args() args = parser.parse_args()
is_point = is_point_release(args.version) update_index(args.version)
update_index(is_point, args.version)
update_release_notes(args.version) update_release_notes(args.version)
update_calendar(args.version) update_calendar(args.version)
subprocess.run(['git', 'commit', '-m', subprocess.run(['git', 'commit', '-m',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment