Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6f913e3

Browse files
committed
Allow passing multiple branches build via CLI
1 parent67842fd commit6f913e3

File tree

3 files changed

+34
-8
lines changed

3 files changed

+34
-8
lines changed

‎README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ python3 ./build_docs.py --quick --build-root ./build_root --www-root ./www --log
1717
```
1818

1919
If you don't need to build all translations of all branches, add
20-
`--language en --branch main`.
20+
`--language en --branches main`.
2121

2222

2323
#Check current version

‎build_docs.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,16 +139,19 @@ def title(self):
139139
returnf"Python{self.name} ({self.status})"
140140

141141
@staticmethod
142-
deffilter(versions,branch=None):
142+
deffilter(versions,branches=None):
143143
"""Filter the given versions.
144144
145-
If *branch* is given, only *versions* matching *branch* are returned.
145+
If *branches* is given, only *versions* matching *branches* are returned.
146146
147147
Else all live versions are returned (this means no EOL and no
148148
security-fixes branches).
149149
"""
150-
ifbranch:
151-
return [vforvinversionsifbranchin (v.name,v.branch_or_tag)]
150+
ifbranches:
151+
return [
152+
vforvinversionsifv.nameinbranchesorv.branch_or_taginbranches
153+
]
154+
152155
return [vforvinversionsifv.statusnotin ("EOL","security-fixes")]
153156

154157
@staticmethod
@@ -518,9 +521,11 @@ def parse_args():
518521
)
519522
parser.add_argument(
520523
"-b",
521-
"--branch",
524+
"--branch",# Deprecated
525+
"--branches",
526+
nargs="*",
522527
metavar="3.12",
523-
help="Version to build (defaults to all maintained branches).",
528+
help="Versions to build (defaults to all maintained branches).",
524529
)
525530
parser.add_argument(
526531
"-r",

‎tests/test_build_docs_version.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,28 @@ def test_filter_one() -> None:
3535
]
3636

3737
# Act
38-
filtered=Version.filter(versions,"3.13")
38+
filtered=Version.filter(versions,["3.13"])
3939

4040
# Assert
4141
assertfiltered== [Version("3.13",status="security")]
42+
43+
44+
deftest_filter_multiple()->None:
45+
# Arrange
46+
versions= [
47+
Version("3.14",status="feature"),
48+
Version("3.13",status="bugfix"),
49+
Version("3.12",status="bugfix"),
50+
Version("3.11",status="security"),
51+
Version("3.10",status="security"),
52+
Version("3.9",status="security"),
53+
]
54+
55+
# Act
56+
filtered=Version.filter(versions, ["3.13","3.14"])
57+
58+
# Assert
59+
assertfiltered== [
60+
Version("3.14",status="feature"),
61+
Version("3.13",status="security"),
62+
]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp