@@ -154,8 +154,8 @@ def load_readme_description(path_dir: str, homepage: str, version: str) -> str:
154154
155155 """
156156 path_readme = os .path .join (path_dir , "README.md" )
157- with open (path_readme , encoding = "utf-8" ) as fo :
158- text = fo .read ()
157+ with open (path_readme , encoding = "utf-8" ) as fopen :
158+ text = fopen .read ()
159159
160160 # drop images from readme
161161 text = text .replace (
@@ -308,17 +308,17 @@ def copy_replace_imports(
308308 if ext in (".pyc" ,):
309309 continue
310310 # Try to parse everything else
311- with open (fp , encoding = "utf-8" ) as fo :
311+ with open (fp , encoding = "utf-8" ) as fopen :
312312 try :
313- lines = fo .readlines ()
313+ lines = fopen .readlines ()
314314 except UnicodeDecodeError :
315315 # a binary file, skip
316316 print (f"Skipped replacing imports for { fp } " )
317317 continue
318318 lines = _replace_imports (lines , list (zip (source_imports , target_imports )), lightning_by = lightning_by )
319319 os .makedirs (os .path .dirname (fp_new ), exist_ok = True )
320- with open (fp_new , "w" , encoding = "utf-8" ) as fo :
321- fo .writelines (lines )
320+ with open (fp_new , "w" , encoding = "utf-8" ) as fopen :
321+ fopen .writelines (lines )
322322
323323
324324def create_mirror_package (source_dir : str , package_mapping : dict [str , str ]) -> None :
@@ -370,10 +370,10 @@ def _prune_packages(req_file: str, packages: Sequence[str]) -> None:
370370
371371 @staticmethod
372372 def _replace_min (fname : str ) -> None :
373- with open (fname , encoding = "utf-8" ) as fo :
374- req = fo .read ().replace (">=" , "==" )
375- with open (fname , "w" , encoding = "utf-8" ) as fw :
376- fw .write (req )
373+ with open (fname , encoding = "utf-8" ) as fopen :
374+ req = fopen .read ().replace (">=" , "==" )
375+ with open (fname , "w" , encoding = "utf-8" ) as fwrite :
376+ fwrite .write (req )
377377
378378 @staticmethod
379379 def replace_oldest_ver (requirement_fnames : Sequence [str ] = REQUIREMENT_FILES_ALL ) -> None :
@@ -471,15 +471,15 @@ def convert_version2nightly(ver_file: str = "src/version.info") -> None:
471471 """Load the actual version and convert it to the nightly version."""
472472 from datetime import datetime
473473
474- with open (ver_file ) as fo :
475- version = fo .read ().strip ()
474+ with open (ver_file ) as fopen :
475+ version = fopen .read ().strip ()
476476 # parse X.Y.Z version and prune any suffix
477477 vers = re .match (r"(\d+)\.(\d+)\.(\d+).*" , version )
478478 # create timestamp YYYYMMDD
479479 timestamp = datetime .now ().strftime ("%Y%m%d" )
480480 version = f"{ '.' .join (vers .groups ())} .dev{ timestamp } "
481- with open (ver_file , "w" ) as fo :
482- fo .write (version + os .linesep )
481+ with open (ver_file , "w" ) as fopen :
482+ fopen .write (version + os .linesep )
483483
484484 @staticmethod
485485 def generate_docker_tags (
0 commit comments