Skip to content

Commit 1f4f44d

Browse files
authored
Merge pull request #1624 from beeware/autoupdates/pre-commit/black-pre-commit-mirror
Bump black-pre-commit-mirror from 23.12.1 to 24.1.1
2 parents cc73721 + d213a53 commit 1f4f44d

File tree

8 files changed

+49
-58
lines changed

8 files changed

+49
-58
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ repos:
2323
- id: docformatter
2424
args: [--in-place, --black]
2525
- repo: https://github.com/psf/black-pre-commit-mirror
26-
rev: 23.12.1
26+
rev: 24.1.1
2727
hooks:
2828
- id: black
2929
language_version: python3

changes/1624.misc.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The ``pre-commit`` hook for ``black-pre-commit-mirror`` was updated to its latest version.

src/briefcase/commands/new.py

+27-25
Original file line numberDiff line numberDiff line change
@@ -47,32 +47,34 @@ def titlecase(s):
4747
:returns: A capitalized string.
4848
"""
4949
return " ".join(
50-
word
51-
if (
52-
word.isupper()
53-
or word
54-
in {
55-
"a",
56-
"an",
57-
"and",
58-
"as",
59-
"at",
60-
"but",
61-
"by",
62-
"en",
63-
"for",
64-
"if",
65-
"in",
66-
"of",
67-
"on",
68-
"or",
69-
"the",
70-
"to",
71-
"via",
72-
"vs",
73-
}
50+
(
51+
word
52+
if (
53+
word.isupper()
54+
or word
55+
in {
56+
"a",
57+
"an",
58+
"and",
59+
"as",
60+
"at",
61+
"but",
62+
"by",
63+
"en",
64+
"for",
65+
"if",
66+
"in",
67+
"of",
68+
"on",
69+
"or",
70+
"the",
71+
"to",
72+
"via",
73+
"vs",
74+
}
75+
)
76+
else word.capitalize()
7477
)
75-
else word.capitalize()
7678
for word in s.split(" ")
7779
)
7880

tests/commands/create/test_install_app_requirements.py

+12-16
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,10 @@ def test_app_packages_invalid_requires(
201201
# Unfortunately, no way to tell the difference between "offline" and
202202
# "your requirements are invalid"; pip returns status code 1 for all
203203
# failures.
204-
create_command.tools[
205-
myapp
206-
].app_context.run.side_effect = subprocess.CalledProcessError(
207-
cmd=["python", "-u", "-m", "pip", "..."], returncode=1
204+
create_command.tools[myapp].app_context.run.side_effect = (
205+
subprocess.CalledProcessError(
206+
cmd=["python", "-u", "-m", "pip", "..."], returncode=1
207+
)
208208
)
209209

210210
with pytest.raises(RequirementsInstallError):
@@ -248,10 +248,10 @@ def test_app_packages_offline(
248248
# Unfortunately, no way to tell the difference between "offline" and
249249
# "your requirements are invalid"; pip returns status code 1 for all
250250
# failures.
251-
create_command.tools[
252-
myapp
253-
].app_context.run.side_effect = subprocess.CalledProcessError(
254-
cmd=["python", "-u", "-m", "pip", "..."], returncode=1
251+
create_command.tools[myapp].app_context.run.side_effect = (
252+
subprocess.CalledProcessError(
253+
cmd=["python", "-u", "-m", "pip", "..."], returncode=1
254+
)
255255
)
256256

257257
with pytest.raises(RequirementsInstallError):
@@ -297,10 +297,8 @@ def test_app_packages_install_requirements(
297297
myapp.requires = ["first", "second", "third"]
298298

299299
# The side effect of calling pip is creating installation artefacts
300-
create_command.tools[
301-
myapp
302-
].app_context.run.side_effect = create_installation_artefacts(
303-
app_packages_path, myapp.requires
300+
create_command.tools[myapp].app_context.run.side_effect = (
301+
create_installation_artefacts(app_packages_path, myapp.requires)
304302
)
305303

306304
# Install the requirements
@@ -356,10 +354,8 @@ def test_app_packages_replace_existing_requirements(
356354
myapp.requires = ["first", "second", "third"]
357355

358356
# The side effect of calling pip is creating installation artefacts
359-
create_command.tools[
360-
myapp
361-
].app_context.run.side_effect = create_installation_artefacts(
362-
app_packages_path, myapp.requires
357+
create_command.tools[myapp].app_context.run.side_effect = (
358+
create_installation_artefacts(app_packages_path, myapp.requires)
363359
)
364360

365361
# Install the requirements

tests/platforms/linux/system/test_build.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,8 @@ def test_build_app(build_command, first_app, tmp_path):
8686
def test_build_bootstrap_failed(build_command, first_app, tmp_path):
8787
"""If the bootstrap binary can't be compiled, an error is raised."""
8888
# Mock a build failure
89-
build_command.tools[
90-
first_app
91-
].app_context.run.side_effect = subprocess.CalledProcessError(
92-
cmd=["make ..."], returncode=-1
89+
build_command.tools[first_app].app_context.run.side_effect = (
90+
subprocess.CalledProcessError(cmd=["make ..."], returncode=-1)
9391
)
9492

9593
# Build the app; it will fail

tests/platforms/linux/system/test_package__deb.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -336,10 +336,8 @@ def test_deb_package_failure(package_command, first_app_deb, tmp_path):
336336
bundle_path = tmp_path / "base_path/build/first-app/somevendor/surprising"
337337

338338
# Mock a packaging failure
339-
package_command.tools.app_tools[
340-
first_app_deb
341-
].app_context.run.side_effect = subprocess.CalledProcessError(
342-
cmd="dpkg-deb ...", returncode=-1
339+
package_command.tools.app_tools[first_app_deb].app_context.run.side_effect = (
340+
subprocess.CalledProcessError(cmd="dpkg-deb ...", returncode=-1)
343341
)
344342

345343
# Package the app

tests/platforms/linux/system/test_package__pkg.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -430,10 +430,8 @@ def test_pkg_package_failure(package_command, first_app_pkg, tmp_path):
430430
bundle_path = tmp_path / "base_path/build/first-app/somevendor/surprising"
431431

432432
# Mock a packaging failure
433-
package_command.tools.app_tools[
434-
first_app_pkg
435-
].app_context.run.side_effect = subprocess.CalledProcessError(
436-
cmd="makepkg ...", returncode=-1
433+
package_command.tools.app_tools[first_app_pkg].app_context.run.side_effect = (
434+
subprocess.CalledProcessError(cmd="makepkg ...", returncode=-1)
437435
)
438436

439437
# Package the app; this will fail

tests/platforms/linux/system/test_package__rpm.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -579,10 +579,8 @@ def test_rpm_package_failure(package_command, first_app_rpm, tmp_path):
579579
bundle_path = tmp_path / "base_path/build/first-app/somevendor/surprising"
580580

581581
# Mock a packaging failure
582-
package_command.tools.app_tools[
583-
first_app_rpm
584-
].app_context.run.side_effect = subprocess.CalledProcessError(
585-
cmd="rpmbuild ...", returncode=-1
582+
package_command.tools.app_tools[first_app_rpm].app_context.run.side_effect = (
583+
subprocess.CalledProcessError(cmd="rpmbuild ...", returncode=-1)
586584
)
587585

588586
# Package the app; this will fail

0 commit comments

Comments
 (0)