@@ -47,7 +47,7 @@ def get_current_version(manifest_path=None):
4747 except (subprocess .CalledProcessError , IndexError , ValueError ):
4848 pass
4949 if manifest_path and os .path .exists (manifest_path ):
50- with open (manifest_path , "r" , encoding = "utf-8" ) as f :
50+ with open (manifest_path , encoding = "utf-8" ) as f :
5151 return json .load (f ).get ("version" , "1.0.0" )
5252 return "1.0.0"
5353
@@ -56,14 +56,14 @@ def write_version(v, manifest_path=None):
5656 if manifest_path is None :
5757 manifest_path = MANIFEST_FILE
5858 if manifest_path and os .path .exists (manifest_path ):
59- with open (manifest_path , "r" , encoding = "utf-8" ) as f :
59+ with open (manifest_path , encoding = "utf-8" ) as f :
6060 data = json .load (f )
6161 data ["version" ] = v
6262 with open (manifest_path , "w" , encoding = "utf-8" ) as f :
6363 json .dump (data , f , indent = 2 )
6464 f .write ("\n " )
6565 if os .path .exists ("pyproject.toml" ):
66- with open ("pyproject.toml" , "r" , encoding = "utf-8" ) as f :
66+ with open ("pyproject.toml" , encoding = "utf-8" ) as f :
6767 content = f .read ()
6868 content = re .sub (
6969 r'^version\s*=\s*".*?"' , f'version = "{ v } "' , content , flags = re .MULTILINE
0 commit comments