@release.command()
def datestamp():
 dt = datetime.datetime.now()
 stamp = '({} {}, {})'.format(dt.strftime('%B'), dt.day, dt.year)
 marker = '(in development)'
 lines = []
 underline_length = None
 with open(CHANGELOG) as f:
  for line in f:
   if (marker in line):
    line = line.replace(marker, stamp)
    lines.append(line)
    underline_length = len(line.strip())
   elif underline_length:
    lines.append((('-' * underline_length) + '\n'))
    underline_length = None
   else:
    lines.append(line)
 with open(CHANGELOG, 'w') as f:
  for line in lines:
   f.write(line)

@ release . command ( ) def datestamp ( ) : dt = datetime . datetime . now ( ) stamp = '({} {}, {})' . format ( dt . strftime ( '%B' ) , dt . day , dt . year ) marker = '(in development)' lines = [ ] underline_length = None with open ( CHANGELOG ) as f : for line in f : if ( marker in line ) : line = line . replace ( marker , stamp ) lines . append ( line ) underline_length = len ( line . strip ( ) ) elif underline_length : lines . append ( ( ( '-' * underline_length ) + '\n' ) ) underline_length = None else : lines . append ( line ) with open ( CHANGELOG , 'w' ) as f : for line in lines : f . write ( line )
enter todays date as the release date in the changelog .