Skip to content

Finalize only the selected app#2659

Open
moondial-pal wants to merge 7 commits intobeeware:mainfrom
moondial-pal:finalized-change
Open

Finalize only the selected app#2659
moondial-pal wants to merge 7 commits intobeeware:mainfrom
moondial-pal:finalized-change

Conversation

@moondial-pal
Copy link
Contributor

When using the -a/--app options, Briefcase no longer finalizes all apps in a project.

This ensures that only the selected app is finalized, preventing configuration errors from unrelated apps.

Fixes #2654

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

Copy link
Member

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At a high level, this is doing the right thing. A couple of comments inline about the specific changes you've made - most notably, deleting previously existing documentation. Unless existing documentation is fundamentally wrong or misleading, you should be very hesitant to delete existing comments.

Also - this change can be applied more broadly than just the create command. The changes you've made for change look good; but every command will be invoking finalize(), and will need comparable changes.

Comment on lines 692 to 693
from collections.abc import Iterable

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This import definitely shouldn't be here - and it's redundant anyway because it's at the top of the file.

Suggested change
from collections.abc import Iterable

def finalize(
self,
app: AppConfig | None = None,
apps: AppConfig | Iterable[AppConfig] | None = None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be able to exclude None and a bare AppConfig from this list by changing the places where it is used.

:param debugger_host: The host to use for the debugger
:param debugger_port: The port to use for the debugger
"""
"""Finalize Briefcase configuration."""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have you deleted this docstring? It definitely needs to be updated, but the content is still useful.


if app.external_package_path:
# Package path is defined
if app.sources is not None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have you deleted these docstrings? They're still accurate and helpful.

@mhsmith mhsmith changed the title Finalized change Finalize only the selected app Feb 2, 2026
@moondial-pal
Copy link
Contributor Author

I’ve applied the finalize(apps=…) change consistently across all commands that invoke finalize().

All tests pass, and I’ve manually verified behavior with multiple apps in a local project (default invocation and -a / --app cases).

Copy link
Member

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks almost perfect - I picked up one small edge that looks incorrect.


# Confirm host compatibility, that all required tools are available,
# and that the app configuration is finalized.
self.finalize(apps=self.apps.values())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should only be finalizingthe apps being packaged:

Suggested change
self.finalize(apps=self.apps.values())
self.finalize(apps=apps_to_package.values())

("verify-tools",),
# App config has been finalized
("finalize-app-config", "first"),
("finalize-app-config", "second"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is likely the side effect of the change flagged in the package command. This test is explicitly packaging a single app; only one app should be finalized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Apps are finalized when they don't have to be=

2 participants