Skip to content

Commit f9e4dfe

Browse files
authored
Fix some Liskov Substitution Principle crimes (#2422)
1 parent c7d24d9 commit f9e4dfe

13 files changed

Lines changed: 28 additions & 14 deletions

File tree

changes/2422.misc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Some Liskov substitution issues with typing were resolved.

src/briefcase/commands/convert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class ConvertCommand(NewCommand):
2727
cmd_line = "briefcase convert"
2828
command = "convert"
2929
platform = "all"
30-
output_format = None
30+
output_format = ""
3131
description = "Set up an existing project for Briefcase."
3232

3333
@cached_property

src/briefcase/commands/create.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,9 +631,10 @@ def _install_app_requirements(
631631
app: AppConfig,
632632
requires: list[str],
633633
app_packages_path: Path,
634+
*,
634635
progress_message: str = "Installing app requirements...",
635636
pip_args: list[str] | None = None,
636-
pip_kwargs: dict[str, str] | None = None,
637+
pip_kwargs: dict[str, dict[str, str | None]] | None = None,
637638
install_hint: str = "",
638639
):
639640
"""Install requirements for the app with pip.

src/briefcase/commands/dev.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
class DevCommand(RunAppMixin, BaseCommand):
1717
cmd_line = "briefcase dev"
1818
command = "dev"
19-
output_format = None
19+
output_format = ""
2020
description = "Run a Briefcase project in the dev environment."
2121

2222
# On macOS CoreFoundation/NSApplication will do its own independent parsing of argc/argv.

src/briefcase/commands/new.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class NewCommand(BaseCommand):
7676
cmd_line = "briefcase new"
7777
command = "new"
7878
platform = "all"
79-
output_format = None
79+
output_format = ""
8080
description = "Create a new Briefcase project."
8181

8282
def bundle_path(self, app):

src/briefcase/commands/run.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,13 @@ def _prepare_app_kwargs(self, app: AppConfig):
249249
return args
250250

251251
@abstractmethod
252-
def run_app(self, app: AppConfig, **options) -> dict | None:
252+
def run_app(
253+
self,
254+
app: AppConfig,
255+
*,
256+
passthrough: list[str],
257+
**options,
258+
) -> dict | None:
253259
"""Start an application.
254260
255261
:param app: The application to start

src/briefcase/commands/upgrade.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
class UpgradeCommand(BaseCommand):
1717
cmd_line = "briefcase upgrade"
1818
command = "upgrade"
19-
output_format = None
19+
output_format = ""
2020
description = "Upgrade Briefcase-managed tools."
2121

2222
@property

src/briefcase/platforms/iOS/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from briefcase.integrations.xcode import Xcode
24

35
DEFAULT_OUTPUT_FORMAT = "Xcode"
@@ -10,7 +12,7 @@ class iOSMixin:
1012
"iOS applications require Xcode, which is only available on macOS."
1113
)
1214
# 0.3.20 introduced PEP 730-style dynamic libraries.
13-
platform_target_version = "0.3.20"
15+
platform_target_version: str | None = "0.3.20"
1416

1517
def verify_tools(self):
1618
Xcode.verify(self.tools, min_version=(13, 0, 0))

src/briefcase/platforms/iOS/xcode.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ def _install_app_requirements(
320320
app: AppConfig,
321321
requires: list[str],
322322
app_packages_path: Path,
323+
**kwargs,
323324
):
324325
# Determine the min iOS version from the VERSIONS file in the support package.
325326
versions = dict(
@@ -493,10 +494,11 @@ def __init__(self, *args, **kwargs):
493494
def run_app(
494495
self,
495496
app: AppConfig,
497+
*,
496498
passthrough: list[str],
497499
udid=None,
498-
**kwargs,
499-
):
500+
**options,
501+
) -> dict | None:
500502
"""Start the application.
501503
502504
:param app: The config object for the app

src/briefcase/platforms/linux/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ def _install_app_requirements(
135135
app: AppConfig,
136136
requires: list[str],
137137
app_packages_path: Path,
138+
**kwargs,
138139
):
139140
"""Install requirements for the app with pip.
140141

0 commit comments

Comments
 (0)