@@ -110,7 +110,9 @@ def latest_version() -> str:
110110 print ('retry ({}/5)' .format (i + 1 ))
111111 sleep (1 )
112112 continue
113- raise CmdStanRetrieveError ('Cannot connect to CmdStan github repo.' ) from e
113+ raise CmdStanRetrieveError (
114+ 'Cannot connect to CmdStan github repo.'
115+ ) from e
114116 content = json .loads (response .decode ('utf-8' ))
115117 tag = content ['tag_name' ]
116118 match = re .search (r'v?(.+)' , tag )
@@ -286,18 +288,26 @@ def build(verbose: bool = False, progress: bool = True, cores: int = 1) -> None:
286288 raise CmdStanInstallError (f'Command "make build" failed\n { str (e )} ' )
287289 if not os .path .exists (os .path .join ('bin' , 'stansummary' + EXTENSION )):
288290 raise CmdStanInstallError (
289- f'bin/stansummary{ EXTENSION } not found, please rebuild or report a bug!'
291+ f'bin/stansummary{ EXTENSION } not found, please rebuild or '
292+ 'report a bug!'
290293 )
291294 if not os .path .exists (os .path .join ('bin' , 'diagnose' + EXTENSION )):
292295 raise CmdStanInstallError (
293- f'bin/stansummary{ EXTENSION } not found, please rebuild or report a bug!'
296+ f'bin/stansummary{ EXTENSION } not found, please rebuild or '
297+ 'report a bug!'
294298 )
295299
296300 if is_windows ():
297301 # Add tbb to the $PATH on Windows
298- libtbb = os .path .join (os .getcwd (), 'stan' , 'lib' , 'stan_math' , 'lib' , 'tbb' )
302+ libtbb = os .path .join (
303+ os .getcwd (), 'stan' , 'lib' , 'stan_math' , 'lib' , 'tbb'
304+ )
299305 os .environ ['PATH' ] = ';' .join (
300- list (OrderedDict .fromkeys ([libtbb ] + os .environ .get ('PATH' , '' ).split (';' )))
306+ list (
307+ OrderedDict .fromkeys (
308+ [libtbb ] + os .environ .get ('PATH' , '' ).split (';' )
309+ )
310+ )
301311 )
302312
303313
@@ -408,9 +418,8 @@ def install_version(
408418 )
409419 if overwrite and os .path .exists ('.' ):
410420 print (
411- 'Overwrite requested, remove existing build of version {}' .format (
412- cmdstan_version
413- )
421+ 'Overwrite requested, remove existing build '
422+ 'of version {}' .format (cmdstan_version )
414423 )
415424 clean_all (verbose )
416425 print ('Rebuilding version {}' .format (cmdstan_version ))
@@ -477,9 +486,9 @@ def retrieve_version(version: str, progress: bool = True) -> None:
477486 for i in range (6 ): # always retry to allow for transient URLErrors
478487 try :
479488 if progress and progbar .allow_show_progress ():
480- progress_hook : Optional [Callable [[ int , int , int ], None ]] = (
481- wrap_url_progress_hook ()
482- )
489+ progress_hook : Optional [
490+ Callable [[ int , int , int ], None ]
491+ ] = wrap_url_progress_hook ( )
483492 else :
484493 progress_hook = None
485494 file_tmp , _ = urllib .request .urlretrieve (
@@ -488,13 +497,14 @@ def retrieve_version(version: str, progress: bool = True) -> None:
488497 break
489498 except urllib .error .HTTPError as e :
490499 raise CmdStanRetrieveError (
491- 'HTTPError: {}\n Version {} not available from github.com.' .format (
492- e .code , version
493- )
500+ 'HTTPError: {}\n Version {} not available from '
501+ 'github.com.' .format (e .code , version )
494502 ) from e
495503 except urllib .error .URLError as e :
496504 print (
497- 'Failed to download CmdStan version {} from github.com' .format (version )
505+ 'Failed to download CmdStan version {} from github.com' .format (
506+ version
507+ )
498508 )
499509 print (e )
500510 if i < 5 :
@@ -640,7 +650,8 @@ def parse_cmdline_args() -> dict[str, Any]:
640650 '--interactive' ,
641651 '-i' ,
642652 action = 'store_true' ,
643- help = "Ignore other arguments and run the installation in " + "interactive mode" ,
653+ help = "Ignore other arguments and run the installation in "
654+ + "interactive mode" ,
644655 )
645656 parser .add_argument (
646657 '--version' ,
0 commit comments