Skip to content

Commit 140a37e

Browse files
committed
Added versioning file + Version in disclaimer
1 parent 47a4eb1 commit 140a37e

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v1.1.1

pydocteur/utils/state_actions.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import random
23
import time
34

@@ -22,9 +23,14 @@
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

2935
def 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

5460
def 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

Comments
 (0)