3030
3131log = getLogger (__name__ )
3232log_dir = Path ("./log" )
33- log_dir .mkdir ()
33+ log_dir .mkdir (exist_ok = True )
3434
3535PR_BODY_TEMPLATE = """\
3636 `cookiecutter-scverse` released [{release.tag_name}]({release.html_url}).
@@ -161,7 +161,7 @@ def run_cruft(cwd: Path, git_tag: str, log_name: str) -> CompletedProcess:
161161# Due to exponential backoff, we’ll maximally wait 2⁹ sec, or 8.5 min
162162
163163
164- def cruft_update (con : GitHubConnection , release : GHRelease , repo : GHRepo , path : Path , pr : PR ) -> bool :
164+ def cruft_update (con : GitHubConnection , tag_name : str , repo : GHRepo , path : Path , pr : PR ) -> bool :
165165 clone = retry_with_backoff (
166166 lambda : Repo .clone_from (con .auth (repo .clone_url ), path ),
167167 retries = n_retries ,
@@ -170,7 +170,7 @@ def cruft_update(con: GitHubConnection, release: GHRelease, repo: GHRepo, path:
170170 branch = clone .create_head (pr .branch , clone .active_branch )
171171 branch .checkout ()
172172
173- run_cruft (path , release . tag_name , pr .branch )
173+ run_cruft (path , tag_name , pr .branch )
174174
175175 if not clone .is_dirty ():
176176 return False
@@ -209,7 +209,7 @@ def make_pr(con: GitHubConnection, release: GHRelease, repo_url: str) -> None:
209209 origin = con .gh .get_repo (repo_url .removeprefix ("https://github.com/" ))
210210 repo = get_fork (con , origin )
211211 with TemporaryDirectory () as td :
212- updated = cruft_update (con , release , repo , Path (td ), pr )
212+ updated = cruft_update (con , release . tag_name , repo , Path (td ), pr )
213213 if updated :
214214 if old_pr := next ((p for p in origin .get_pulls ("open" ) if pr .matches (p )), None ):
215215 old_pr .edit (state = "closed" )
0 commit comments