5 from datetime import datetime, timedelta
9 def feedback_deadline(final_date: datetime) -> datetime:
10 return final_date - timedelta(days=2)
13 def call_for_testing_contents(args) -> str:
14 jinja2_env = jinja2.Environment( # nosec jinja2_autoescape_false
15 loader=jinja2.FileSystemLoader('config/release_management/templates'))
17 return (jinja2_env.get_template('call_for_testing.mdwn').render(
18 date=email.utils.format_datetime(datetime.fromisoformat(args.date)),
21 final_date=datetime.fromisoformat(args.final_date).strftime("%B %d"),
22 final_version=args.final_version,
23 deadline=feedback_deadline(datetime.fromisoformat(
24 args.final_date)).strftime("%B %d")))
27 if __name__ == '__main__':
29 parser = argparse.ArgumentParser()
30 parser.add_argument('--version', required=True)
31 parser.add_argument('--tag', required=True)
32 parser.add_argument('--date', required=True)
33 parser.add_argument('--final-version', required=True)
34 parser.add_argument('--final-date', required=True)
35 args = parser.parse_args()
37 print(call_for_testing_contents(args))