@@ -52,8 +52,7 @@ def compute_hash(wheel_dir, hash_func):
52
52
checksums = []
53
53
for fn in sorted (released ):
54
54
fn_path = Path (f"{ wheel_dir } /{ fn } " )
55
- with open (fn_path , 'rb' ) as f :
56
- m = hash_func (f .read ())
55
+ m = hash_func (fn_path .read_bytes ())
57
56
checksums .append (f"{ m .hexdigest ()} { fn } " )
58
57
return checksums
59
58
@@ -74,10 +73,10 @@ def write_release(version):
74
73
None.
75
74
76
75
"""
77
- notes = Path (f"{ NOTES_DIR } / { version } -notes.rst" )
78
- wheel_dir = Path (f" { OUTPUT_DIR } / installers")
79
- target_md = Path (f"{ OUTPUT_DIR } / { OUTPUT_FILE } .md" )
80
- target_rst = Path (f"{ OUTPUT_DIR } / { OUTPUT_FILE } .rst" )
76
+ notes = Path (NOTES_DIR ) / f"{ version } -notes.rst"
77
+ wheel_dir = Path (OUTPUT_DIR ) / " installers"
78
+ target_md = Path (OUTPUT_DIR ) / f"{ OUTPUT_FILE } .md"
79
+ target_rst = Path (OUTPUT_DIR ) / f"{ OUTPUT_FILE } .rst"
81
80
82
81
os .system (f"cp { notes } { target_rst } " )
83
82
@@ -104,12 +103,10 @@ def write_release(version):
104
103
f .writelines ([f' { c } \n ' for c in compute_hash (wheel_dir , sha256 )])
105
104
106
105
# translate README.rst to md for posting on GitHub
107
- rst_to_md = subprocess .Popen (
108
- ["pandoc" , "-s" , "-o" , f"{ target_md } " , f"{ target_rst } " , "--wrap=preserve" ],
109
- stdout = subprocess .PIPE , stderr = subprocess .PIPE )
110
- output , error = rst_to_md .communicate ()
111
- if not rst_to_md .returncode == 0 :
112
- raise RuntimeError (f"{ error } failed" )
106
+ subprocess .run (
107
+ ["pandoc" , "-s" , "-o" , str (target_md ), str (target_rst ), "--wrap=preserve" ],
108
+ check = True ,
109
+ )
113
110
114
111
if __name__ == '__main__' :
115
112
parser = argparse .ArgumentParser ()
0 commit comments