@@ -154,8 +154,8 @@ def load_readme_description(path_dir: str, homepage: str, version: str) -> str:
154
154
155
155
"""
156
156
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 ()
159
159
160
160
# drop images from readme
161
161
text = text .replace (
@@ -308,17 +308,17 @@ def copy_replace_imports(
308
308
if ext in (".pyc" ,):
309
309
continue
310
310
# Try to parse everything else
311
- with open (fp , encoding = "utf-8" ) as fo :
311
+ with open (fp , encoding = "utf-8" ) as fopen :
312
312
try :
313
- lines = fo .readlines ()
313
+ lines = fopen .readlines ()
314
314
except UnicodeDecodeError :
315
315
# a binary file, skip
316
316
print (f"Skipped replacing imports for { fp } " )
317
317
continue
318
318
lines = _replace_imports (lines , list (zip (source_imports , target_imports )), lightning_by = lightning_by )
319
319
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 )
322
322
323
323
324
324
def 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:
370
370
371
371
@staticmethod
372
372
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 )
377
377
378
378
@staticmethod
379
379
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:
471
471
"""Load the actual version and convert it to the nightly version."""
472
472
from datetime import datetime
473
473
474
- with open (ver_file ) as fo :
475
- version = fo .read ().strip ()
474
+ with open (ver_file ) as fopen :
475
+ version = fopen .read ().strip ()
476
476
# parse X.Y.Z version and prune any suffix
477
477
vers = re .match (r"(\d+)\.(\d+)\.(\d+).*" , version )
478
478
# create timestamp YYYYMMDD
479
479
timestamp = datetime .now ().strftime ("%Y%m%d" )
480
480
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 )
483
483
484
484
@staticmethod
485
485
def generate_docker_tags (
0 commit comments