MCPcopy Create free account
hub / github.com/numpy/numpy / write_release_task

Function write_release_task

pavement.py:168–233  ·  view source on GitHub ↗

Append hashes of release files to release notes. This appends file hashes to the release notes and creates four README files of the result in various formats: - README.rst - README.rst.gpg - README.md - README.md.gpg The md file are created using `pandoc` so that the l

(options, filename='README')

Source from the content-addressed store, hash-verified

166
167
168def write_release_task(options, filename='README'):
169 """Append hashes of release files to release notes.
170
171 This appends file hashes to the release notes and creates
172 four README files of the result in various formats:
173
174 - README.rst
175 - README.rst.gpg
176 - README.md
177 - README.md.gpg
178
179 The md file are created using `pandoc` so that the links are
180 properly updated. The gpg files are kept separate, so that
181 the unsigned files may be edited before signing if needed.
182
183 Parameters
184 ----------
185 options :
186 Set by ``task`` decorator.
187 filename : str
188 Filename of the modified notes. The file is written
189 in the release directory.
190
191 """
192 idirs = options.installers.installersdir
193 notes = paver.path.path(RELEASE_NOTES)
194 rst_readme = paver.path.path(filename + '.rst')
195 md_readme = paver.path.path(filename + '.md')
196
197 # append hashes
198 with open(rst_readme, 'w') as freadme:
199 with open(notes) as fnotes:
200 freadme.write(fnotes.read())
201
202 freadme.writelines(textwrap.dedent(
203 """
204 Checksums
205 =========
206
207 MD5
208 ---
209 ::
210
211 """))
212 freadme.writelines([f' {c}\n' for c in compute_md5(idirs)])
213
214 freadme.writelines(textwrap.dedent(
215 """
216 SHA256
217 ------
218 ::
219
220 """))
221 freadme.writelines([f' {c}\n' for c in compute_sha256(idirs)])
222
223 # generate md file using pandoc before signing
224 sh(f"pandoc -s -o {md_readme} {rst_readme}")
225

Callers 1

write_releaseFunction · 0.85

Calls 6

openFunction · 0.85
compute_md5Function · 0.85
compute_sha256Function · 0.85
writelinesMethod · 0.80
writeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected