File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 22from functools import cache
33from pathlib import Path
44from tempfile import TemporaryDirectory
5+ from urllib .request import urlopen
56
67import git
78from 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
1920def 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
You can’t perform that action at this time.
0 commit comments