Skip to content

Commit

Permalink
pr_tool: use backport template from module
Browse files Browse the repository at this point in the history
This was previously taken from the backport-branch, which is probably
not what we want.
  • Loading branch information
arogge committed Feb 27, 2024
1 parent c41a3c3 commit 8d06f37
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions devtools/pip-tools/pr_tool/backport.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from sys import stdout, stderr
from subprocess import run
from tempfile import NamedTemporaryFile
from importlib import resources
from git import RemoteReference
from git.exc import GitCommandError
from .github import Gh, InvokationError, whoami
Expand Down Expand Up @@ -296,9 +297,9 @@ def publish(*, repo, dry_run=False):
original_data = get_pr_info(str(original_pr), ["title", "labels"])
labels = munge_labels(original_data["labels"], base_branch)

template_file = f"{repo.working_tree_dir}/.github/backport_pr_template.md"
template_file = resources.files(__package__).joinpath('backport_pr_template.md')
template_vars = {"original_pr": original_pr, "base_branch": base_branch}
with open(template_file, "r", encoding="utf-8") as template_fp:
with template_file.open('r', encoding="utf-8") as template_fp:
with NamedTemporaryFile("r+", suffix=".md") as body_fp:
_fill_template(template_fp, body_fp, template_vars)
if not git_editor(repo, body_fp.name):
Expand Down
File renamed without changes.

0 comments on commit 8d06f37

Please sign in to comment.