Skip to content

Commit 707cd2c

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent ca5b2e9 commit 707cd2c

File tree

3 files changed

+17
-33
lines changed

3 files changed

+17
-33
lines changed

cherry_picker/cherry_picker.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,7 @@ def amend_commit_message(self, cherry_pick_branch):
398398
return updated_commit_message
399399

400400
def pause_after_committing(self, cherry_pick_branch):
401-
click.echo(
402-
f"""
401+
click.echo(f"""
403402
Finished cherry-pick {self.commit_sha1} into {cherry_pick_branch} \U0001f600
404403
--no-push option used.
405404
... Stopping here.
@@ -408,8 +407,7 @@ def pause_after_committing(self, cherry_pick_branch):
408407
409408
To abort the cherry-pick and cleanup:
410409
$ cherry_picker --abort
411-
"""
412-
)
410+
""")
413411
self.set_paused_state()
414412

415413
def push_to_remote(self, base_branch, head_branch, commit_message=""):

cherry_picker/test_cherry_picker.py

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -475,14 +475,12 @@ def test_find_config_not_git(tmpdir, cd):
475475

476476
def test_load_full_config(tmp_git_repo_dir, git_add, git_commit):
477477
relative_config_path = ".cherry_picker.toml"
478-
tmp_git_repo_dir.join(relative_config_path).write(
479-
"""\
478+
tmp_git_repo_dir.join(relative_config_path).write("""\
480479
team = "python"
481480
repo = "core-workfolow"
482481
check_sha = "5f007046b5d4766f971272a0cc99f8461215c1ec"
483482
default_branch = "devel"
484-
"""
485-
)
483+
""")
486484
git_add(relative_config_path)
487485
git_commit("Add config")
488486
scm_revision = get_sha1_from("HEAD")
@@ -503,11 +501,9 @@ def test_load_full_config(tmp_git_repo_dir, git_add, git_commit):
503501

504502
def test_load_partial_config(tmp_git_repo_dir, git_add, git_commit):
505503
relative_config_path = ".cherry_picker.toml"
506-
tmp_git_repo_dir.join(relative_config_path).write(
507-
"""\
504+
tmp_git_repo_dir.join(relative_config_path).write("""\
508505
repo = "core-workfolow"
509-
"""
510-
)
506+
""")
511507
git_add(relative_config_path)
512508
git_commit("Add config")
513509
scm_revision = get_sha1_from("HEAD")
@@ -528,14 +524,12 @@ def test_load_partial_config(tmp_git_repo_dir, git_add, git_commit):
528524

529525
def test_load_config_no_head_sha(tmp_git_repo_dir, git_add, git_commit):
530526
relative_config_path = ".cherry_picker.toml"
531-
tmp_git_repo_dir.join(relative_config_path).write(
532-
"""\
527+
tmp_git_repo_dir.join(relative_config_path).write("""\
533528
team = "python"
534529
repo = "core-workfolow"
535530
check_sha = "5f007046b5d4766f971272a0cc99f8461215c1ec"
536531
default_branch = "devel"
537-
"""
538-
)
532+
""")
539533
git_add(relative_config_path)
540534
git_commit(f"Add {relative_config_path}")
541535

@@ -572,8 +566,7 @@ def test_normalize_long_commit_message():
572566
title == "[3.6] Fix broken `Show Source` links on documentation pages (GH-3113)"
573567
)
574568
assert (
575-
body
576-
== """The `Show Source` was broken because of a change made in sphinx 1.5.1
569+
body == """The `Show Source` was broken because of a change made in sphinx 1.5.1
577570
In Sphinx 1.4.9, the sourcename was "index.txt".
578571
In Sphinx 1.5.1+, it is now "index.rst.txt".
579572
(cherry picked from commit b9ff498793611d1c6a9b99df464812931a1e2d69)
@@ -596,8 +589,7 @@ def test_normalize_short_commit_message():
596589
title == "[3.6] Fix broken `Show Source` links on documentation pages (GH-3113)"
597590
)
598591
assert (
599-
body
600-
== """(cherry picked from commit b9ff498793611d1c6a9b99df464812931a1e2d69)
592+
body == """(cherry picked from commit b9ff498793611d1c6a9b99df464812931a1e2d69)
601593
602594
603595
Co-authored-by: Elmar Ritsch <35851+elritsch@users.noreply.github.com>"""
@@ -775,12 +767,10 @@ def test_paused_flow(tmp_git_repo_dir, git_add, git_commit):
775767
initial_scm_revision = get_sha1_from("HEAD")
776768

777769
relative_file_path = "some.toml"
778-
tmp_git_repo_dir.join(relative_file_path).write(
779-
f"""\
770+
tmp_git_repo_dir.join(relative_file_path).write(f"""\
780771
check_sha = "{initial_scm_revision}"
781772
repo = "core-workfolow"
782-
"""
783-
)
773+
""")
784774
git_add(relative_file_path)
785775
git_commit("Add a config")
786776
config_scm_revision = get_sha1_from("HEAD")

pyproject.toml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,12 @@ optional-dependencies.dev = [
3939
urls.Homepage = "https://github.com/python/cherry-picker"
4040
scripts.cherry_picker = "cherry_picker.cherry_picker:cherry_pick_cli"
4141

42-
[tool.hatch.version]
43-
source = "vcs"
42+
[tool.hatch]
43+
build.hooks.vcs.version-file = "cherry_picker/_version.py"
44+
version.source = "vcs"
4445
# Change regex to match tags like "cherry-picker-v2.2.0".
45-
tag-pattern = '^cherry-picker-(?P<version>[vV]?\d+(?:\.\d+){0,2}[^\+]*)(?:\+.*)?$'
46-
47-
[tool.hatch.build.hooks.vcs]
48-
version-file = "cherry_picker/_version.py"
49-
50-
[tool.hatch.version.raw-options]
51-
local_scheme = "no-local-version"
46+
version.tag-pattern = "^cherry-picker-(?P<version>[vV]?\\d+(?:\\.\\d+){0,2}[^\\+]*)(?:\\+.*)?$"
47+
version.raw-options.local_scheme = "no-local-version"
5248

5349
[tool.ruff]
5450
fix = true

0 commit comments

Comments
 (0)