Skip to content

Commit c5a6e82

Browse files
authored
Merge pull request winpython#2101 from stonebig/changelog-name-carries-release-level
Put the release level in the changelog name
2 parents 35c2fb9 + 8bde06b commit c5a6e82

4 files changed

Lines changed: 32 additions & 6 deletions

File tree

‎.github/actions/publish-winpython/action.yml‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ inputs:
1313
required: true
1414
winpy_ver2:
1515
required: true
16+
release_level:
17+
required: false
18+
default: ""
19+
description: 'b1, rc2, ... appended to winpy_ver2 in the changelog name'
1620
dotwheelhouse:
1721
required: true
1822
winpy_requirements_whl:
@@ -51,8 +55,11 @@ runs:
5155
$env:PYTHONIOENCODING="utf-8"
5256
$pythonExe = Join-Path "${{ inputs.build_location }}" "python\python.exe"
5357
54-
# Markdown Metadata
55-
$destfile_md = "publish_output\WinPython${{ inputs.winpy_flavor }}-${{ inputs.winpy_arch }}bit-${{ inputs.winpy_ver2 }}.md"
58+
# Markdown Metadata. The release level is part of the name: a b1 and the
59+
# final it becomes share a winpy_ver2, so without it the beta's package
60+
# list occupies the final's file. 3.15.0.5b1 is a PEP 440 version, and
61+
# sorts where find_previous_version needs it to.
62+
$destfile_md = "publish_output\WinPython${{ inputs.winpy_flavor }}-${{ inputs.winpy_arch }}bit-${{ inputs.winpy_ver2 }}${{ inputs.release_level }}.md"
5663
& $pythonExe -m wppm -md | Out-File -FilePath $destfile_md -Encoding utf8
5764
gc $destfile_md
5865

‎.github/workflows/build_winpython_cycle.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
outputs:
5151
pandoc_source: ${{ steps.cfg.outputs.pandoc_source }}
5252
pandoc_sha256: ${{ steps.cfg.outputs.pandoc_sha256 }}
53+
release_level: ${{ steps.cfg.outputs.release_level }}
5354
release_tag: ${{ steps.cfg.outputs.release_tag }}
5455
matrix: ${{ steps.cfg.outputs.matrix }}
5556
steps:
@@ -158,6 +159,7 @@ jobs:
158159
winpy_arch: ${{ env.WINPYARCH }}
159160
winpy_ver: ${{ env.WINPYVER }}
160161
winpy_ver2: ${{ env.WINPYVER2 }}
162+
release_level: ${{ needs.config.outputs.release_level }}
161163
dotwheelhouse: ${{ env.dotwheelhouse }}
162164
winpy_requirements_whl: ${{ matrix.leg.requirements_wheels }}
163165
format_zip: ${{ matrix.leg.formats.zip }}

‎tests/test_cycle_config.py‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,19 @@ def test_publishing_is_gated_both_ways(self, workflow_text):
260260
assert "if: ${{ inputs.publish }}" in workflow_text
261261
assert "if: ${{ !inputs.publish }}" in workflow_text
262262

263+
def test_the_changelog_name_carries_the_release_level(self, workflow_text):
264+
"""A beta and the final it becomes share a ver2.
265+
266+
Without the level in the name, a b1's package list is written to the
267+
file the final release wants, and `changelogs/` briefly describes a
268+
beta under the final's name. The level has to reach the composite
269+
action for that, so both halves are checked.
270+
"""
271+
assert "release_level: ${{ needs.config.outputs.release_level }}" in workflow_text
272+
action = (REPO / ".github/actions/publish-winpython/action.yml").read_text(encoding="utf-8")
273+
assert re.search(r"^ release_level:$", action, re.MULTILINE), "action input is missing"
274+
assert "${{ inputs.winpy_ver2 }}${{ inputs.release_level }}.md" in action
275+
263276
def test_the_release_tag_is_never_taken_from_a_dispatch_input(self, workflow_text):
264277
"""One source of truth: the cycle file. An input would let them disagree."""
265278
assert "inputs.release_tag" not in workflow_text

‎winpython/build_winpython.py‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,13 @@ def main():
309309
generate_lockfiles(target_python, winpydirbase, args.constraints, args.find_links, file_postfix)
310310

311311

312-
log_section(f"🙏 Step 7: generate changelog")
313-
mdn = f"WinPython{args.flavor}-{args.arch}bit-{winpyver2}.md"
314-
out = f"WinPython{args.flavor}-{args.arch}bit-{winpyver2}_History.md"
312+
log_section(f"🙏 Step 7: generate changelog")
313+
# the release level belongs in the name: a b1 and the final it becomes share
314+
# a winpyver2, so without it the beta's package list occupies the final's
315+
# file. 3.15.0.5b1 is a PEP 440 version, and sorts where it should.
316+
changelog_version = f"{winpyver2}{args.release_level}"
317+
mdn = f"WinPython{args.flavor}-{args.arch}bit-{changelog_version}.md"
318+
out = f"WinPython{args.flavor}-{args.arch}bit-{changelog_version}_History.md"
315319
changelog_dir = log_dir.parent/ "changelogs"
316320

317321
cmd = ["set", f"WINPYVER2={winpyver2}&", "set", f"WINPYFLAVOR={args.flavor}&",
@@ -328,7 +332,7 @@ def main():
328332
cmd = [str(target_python), "-X", "utf8", "-c",
329333
(
330334
"from wppm import diff;"
331-
f"result = diff.compare_package_indexes('{winpyver2}', searchdir=r'{changelog_dir}', flavor=r'{args.flavor}', architecture={args.arch});"
335+
f"result = diff.compare_package_indexes('{changelog_version}', searchdir=r'{changelog_dir}', flavor=r'{args.flavor}', architecture={args.arch});"
332336
f"open(r'{winpydirbase.parent / out}', 'w', encoding='utf-8').write(result)"
333337
)]
334338
run_command(cmd, check=False)

0 commit comments

Comments
 (0)