Skip to content

Commit 9804c79

Browse files
committed
Update release-cycle.json URL
1 parent afdc452 commit 9804c79

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

completion.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,24 @@
22
from functools import cache
33
from pathlib import Path
44
from tempfile import TemporaryDirectory
5+
from urllib.request import urlopen
56

67
import git
78
from potodo import potodo
89

910

1011
@cache
11-
def branches_from_devguide(devguide_dir: Path) -> list[str]:
12-
p = devguide_dir.joinpath('include/release-cycle.json')
13-
data = json.loads(p.read_text())
12+
def branches_from_peps() -> list[str]:
13+
with urlopen('https://peps.python.org/api/release-cycle.json') as in_file:
14+
data = json.loads(in_file.read().decode('utf-8'))
1415
return [
1516
branch for branch in data if data[branch]['status'] in ('bugfix', 'security')
1617
]
1718

1819

1920
def get_completion(clones_dir: str, repo: str) -> tuple[float, str, float]:
2021
clone_path = Path(clones_dir, 'translations', repo)
21-
for branch in branches_from_devguide(Path(clones_dir, 'devguide')) + [
22-
'master',
23-
'main',
24-
]:
22+
for branch in branches_from_peps() + ['master', 'main']:
2523
try:
2624
clone_repo = git.Repo.clone_from(
2725
f'https://github.com/{repo}.git', clone_path, branch=branch

0 commit comments

Comments
 (0)