Skip to content

Commit e5b7dba

Browse files
hugovkm-aciek
authored andcommitted
Fetch bugfix and security branches from devguide
1 parent 13ec051 commit e5b7dba

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

completion.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,25 @@
33

44
import git
55
from potodo import potodo
6+
import requests
7+
8+
9+
def branches_from_devguide() -> list[str]:
10+
r = requests.get(
11+
"https://raw.githubusercontent.com/"
12+
"python/devguide/main/include/release-cycle.json",
13+
timeout=10,
14+
)
15+
data = r.json()
16+
return [
17+
branch for branch in data if data[branch]["status"] in ("bugfix", "security")
18+
]
619

720

821
def get_completion_and_branch(tmpdir: str, language: str) -> tuple[float, str]:
922
clone_path = pathlib.Path(tmpdir, language)
10-
for branch in ('3.13', '3.12', '3.11', '3.10', '3.9'):
23+
24+
for branch in branches_from_devguide():
1125
try:
1226
git.Repo.clone_from(f'https://github.com/python/python-docs-{language}.git', clone_path, depth=1, branch=branch)
1327
except git.GitCommandError:

0 commit comments

Comments
 (0)