Skip to content

Commit 72d35cf

Browse files
committed
Fix repo check: b1 is special and still made from main, not 3.x
1 parent 151ab2d commit 72d35cf

3 files changed

Lines changed: 14 additions & 4 deletions

File tree

release.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,10 @@ def normalized(self) -> str:
193193

194194
@property
195195
def branch(self) -> str:
196-
return "main" if self.is_alpha_release else f"{self.major}.{self.minor}"
196+
if self.is_alpha_release or self.is_feature_freeze_release:
197+
return "main"
198+
else:
199+
return f"{self.major}.{self.minor}"
197200

198201
@property
199202
def is_alpha_release(self) -> bool:

tests/test_release_tag.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,26 +41,31 @@ def test_tag_phase() -> None:
4141
assert alpha.is_feature_freeze_release is False
4242
assert alpha.is_release_candidate is False
4343
assert alpha.is_final is False
44+
assert alpha.branch == "main"
4445

4546
assert beta1.is_alpha_release is False
4647
assert beta1.is_feature_freeze_release is True
4748
assert beta1.is_release_candidate is False
4849
assert beta1.is_final is False
50+
assert beta1.branch == "main"
4951

5052
assert beta4.is_alpha_release is False
5153
assert beta4.is_feature_freeze_release is False
5254
assert beta4.is_release_candidate is False
5355
assert beta4.is_final is False
56+
assert beta4.branch == "3.13"
5457

5558
assert rc.is_alpha_release is False
5659
assert rc.is_feature_freeze_release is False
5760
assert rc.is_release_candidate is True
5861
assert rc.is_final is False
62+
assert rc.branch == "3.13"
5963

6064
assert final.is_alpha_release is False
6165
assert final.is_feature_freeze_release is False
6266
assert final.is_release_candidate is False
6367
assert final.is_final is True
68+
assert final.branch == "3.13"
6469

6570

6671
def test_tag_committed_at_not_found() -> None:

tests/test_run_release.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ def test_invalid_extract_github_owner() -> None:
5959
[
6060
# Success cases
6161
("3.15.0rc1", "3.15\n", does_not_raise()),
62-
("3.15.0b1", "3.15\n", does_not_raise()),
62+
("3.15.0b3", "3.15\n", does_not_raise()),
63+
("3.15.0b2", "3.15\n", does_not_raise()),
64+
("3.15.0b1", "main\n", does_not_raise()),
6365
("3.15.0a6", "main\n", does_not_raise()),
6466
("3.14.3", "3.14\n", does_not_raise()),
6567
("3.13.12", "3.13\n", does_not_raise()),
@@ -71,8 +73,8 @@ def test_invalid_extract_github_owner() -> None:
7173
),
7274
(
7375
"3.15.0b1",
74-
"main\n",
75-
pytest.raises(ReleaseException, match="on main branch, expected 3.15"),
76+
"3.15\n",
77+
pytest.raises(ReleaseException, match="on 3.15 branch, expected main"),
7678
),
7779
(
7880
"3.15.0a6",

0 commit comments

Comments
 (0)