Skip to content

Commit

Permalink
MAINT: Update pavement.py
Browse files Browse the repository at this point in the history
- Add README signing from scipy.
- Change NOTES.txt to README.

[ci skip]
  • Loading branch information
charris committed Nov 5, 2016
1 parent 740bca9 commit 704bf37
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions pavement.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,9 +597,12 @@ def write_release_task(options, filename='NOTES.txt'):
target = paver.path.path(filename)
if target.exists():
target.remove()
source.copy(target)
ftarget = open(str(target), 'a')
ftarget.writelines("""

tmp_target = paver.path.path(filename + '.tmp')
source.copy(tmp_target)

with open(str(tmp_target), 'a') as ftarget:
ftarget.writelines("""
Checksums
=========
Expand All @@ -615,6 +618,16 @@ def write_release_task(options, filename='NOTES.txt'):
""")
ftarget.writelines(['%s\n' % c for c in compute_sha256(idirs)])

# Sign release
cmd = ['gpg', '--clearsign', '--armor']
if hasattr(options, 'gpg_key'):
cmd += ['--default-key', options.gpg_key]
cmd += ['--output', str(target), str(tmp_target)]
subprocess.check_call(cmd)
print("signed %s" % (target,))
tmp_target.remove()


def write_log_task(options, filename='Changelog'):
st = subprocess.Popen(
['git', 'log', '--no-merges', '--use-mailmap',
Expand All @@ -626,16 +639,19 @@ def write_log_task(options, filename='Changelog'):
a.writelines(out)
a.close()


@task
def write_release(options):
write_release_task(options)


@task
def write_log(options):
write_log_task(options)


@task
def write_release_and_log(options):
rdir = options.installers.releasedir
write_release_task(options, os.path.join(rdir, 'NOTES.txt'))
write_release_task(options, os.path.join(rdir, 'README'))
write_log_task(options, os.path.join(rdir, 'Changelog'))

0 comments on commit 704bf37

Please sign in to comment.