1+ import os
12import random
23import time
34
2223[Source code](https://github.com/afpy/pydocteur)
2324
2425(state: {state})
26+ `PyDocTeur {version}`
27+
2528</details>
2629"""
2730
31+ with open (os .path .join (os .path .dirname (__file__ ), "../../VERSION" ), "r" ) as handle :
32+ VERSION = handle .read ()
33+
2834
2935def replace_body_variables (pr : PullRequest , body : str ):
3036 print ("Replacing variables" )
@@ -48,7 +54,7 @@ def comment_pr(pr: PullRequest, state: str):
4854 body = random .choice (bodies )
4955 # TODO: Add replacement of variables from selected body
5056 body = replace_body_variables (pr , body )
51- pr .create_issue_comment (body + END_OF_BODY .format (state = state ))
57+ pr .create_issue_comment (body + END_OF_BODY .format (state = state , version = VERSION ))
5258
5359
5460def merge_and_thank_contributors (pr : PullRequest , state : str ):
@@ -58,7 +64,7 @@ def merge_and_thank_contributors(pr: PullRequest, state: str):
5864 print ("MERGING: Sending warning" )
5965 warning_body = random .choice (warnings )
6066 warning_body = replace_body_variables (pr , warning_body )
61- pr .create_issue_comment (warning_body + END_OF_BODY .format (state = state ))
67+ pr .create_issue_comment (warning_body + END_OF_BODY .format (state = state , version = VERSION ))
6268
6369 print ("MERGING: Sleeping 1s" )
6470 time .sleep (1 )
@@ -70,4 +76,4 @@ def merge_and_thank_contributors(pr: PullRequest, state: str):
7076 print ("MERGING: Sending thanks" )
7177 thanks_body = random .choice (thanks )
7278 thanks_body = replace_body_variables (pr , thanks_body )
73- pr .create_issue_comment (thanks_body + END_OF_BODY .format (state = state ))
79+ pr .create_issue_comment (thanks_body + END_OF_BODY .format (state = state , version = VERSION ))
0 commit comments