-
-
Notifications
You must be signed in to change notification settings - Fork 484
Add support for console apps #1781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
f1924d7
Add changenote.
freakboy3742 8031f94
Add an option to configure console apps.
freakboy3742 5b730bc
Disable log streaming when running console apps.
freakboy3742 f42099d
Add a wrapper class for describing macOS signing identities.
freakboy3742 1445a4f
Switch packaging code to use SigningIdentity.
freakboy3742 c28f51e
Initial implementation of .pkg format generation.
freakboy3742 b55182b
Add removal changenote for macOS app format.
freakboy3742 480e5a0
Restructure packaging tests to make format-specific test modules.
freakboy3742 000f312
Make the default packaging format for macOS dependent on the app type.
freakboy3742 a6b5f8a
Pass BRIEFCASE_DEBUG to the runtime environment if in verbose mode.
freakboy3742 9946967
Tweaked the execution of console apps.
freakboy3742 b84f2d8
Add tests for pkg building.
freakboy3742 bb1dabf
Improve spacing in multiline comments.
freakboy3742 5b6eb74
Correct handling of flatpak debug mode.
freakboy3742 0f3a490
Add a UUID5 template filter to generate GUIDs for Windows.
freakboy3742 03ce00d
Use a different executable name for Windows console apps.
freakboy3742 4715144
Rename/strip the stub binary as part of the build step.
freakboy3742 4f38437
Rename the windows stub binary in the build step.
freakboy3742 9969b4b
Add bootstrap and automation bootstrap for console apps.
freakboy3742 96eb010
Merge branch 'main' into cmdline-app
freakboy3742 aff0c97
Apply suggestions from code review
freakboy3742 b402e32
Clarify the effect of enabling console_app
freakboy3742 77fc7ed
Merge remote-tracking branch 'origin/main' into cmdline-app
mhsmith ee6eebd
Normalize the Xcode docs.
freakboy3742 232f902
Merge branch 'main' into cmdline-app
freakboy3742 9c0f09c
Ensure return status of subprocesses is checked.
freakboy3742 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| from automation.bootstraps import BRIEFCASE_EXIT_SUCCESS_SIGNAL, EXIT_SUCCESS_NOTIFY | ||
| from briefcase.bootstraps import ConsoleBootstrap | ||
|
|
||
|
|
||
| class ConsoleAutomationBootstrap(ConsoleBootstrap): | ||
| def app_source(self): | ||
| return f"""\ | ||
| import time | ||
|
|
||
|
|
||
| def main(): | ||
| time.sleep(2) | ||
| print("{EXIT_SUCCESS_NOTIFY}") | ||
| print("{BRIEFCASE_EXIT_SUCCESS_SIGNAL}") | ||
|
|
||
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| macOS now supports the generation of ``.pkg`` installers as a packaging format. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| If ``run`` is executed directly after a ``create`` when using an ``app`` template (macOS or Windows), the implied ``build`` step is now correctly identified. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| The macOS ``app`` packaging format has been renamed ``zip`` for consistency with Windows, and to reflect the format of the output artefact. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Briefcase can now package command line apps. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| from briefcase.bootstraps.base import BaseGuiBootstrap # noqa: F401 | ||
| from briefcase.bootstraps.console import ConsoleBootstrap # noqa: F401 | ||
| from briefcase.bootstraps.pygame import PygameGuiBootstrap # noqa: F401 | ||
| from briefcase.bootstraps.pyside6 import PySide6GuiBootstrap # noqa: F401 | ||
| from briefcase.bootstraps.toga import TogaGuiBootstrap # noqa: F401 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,119 @@ | ||
| from briefcase.bootstraps.base import BaseGuiBootstrap | ||
|
|
||
|
|
||
| class ConsoleBootstrap(BaseGuiBootstrap): | ||
| display_name_annotation = "does not support iOS/Android/Web deployment" | ||
|
|
||
| def app_source(self): | ||
| return """\ | ||
|
|
||
| def main(): | ||
| # Your app logic goes here | ||
| print("Hello, World.") | ||
|
|
||
| """ | ||
|
|
||
| def app_start_source(self): | ||
| return """\ | ||
| from {{ cookiecutter.module_name }}.app import main | ||
|
|
||
| if __name__ == "__main__": | ||
| main() | ||
| """ | ||
|
|
||
| def pyproject_table_briefcase_app_extra_content(self): | ||
| return """ | ||
| console_app = true | ||
| requires = [ | ||
| ] | ||
| test_requires = [ | ||
| {% if cookiecutter.test_framework == "pytest" %} | ||
| "pytest", | ||
| {% endif %} | ||
| ] | ||
| """ | ||
|
|
||
| def pyproject_table_macOS(self): | ||
| return """\ | ||
| universal_build = true | ||
| requires = [ | ||
| ] | ||
| """ | ||
|
|
||
| def pyproject_table_linux(self): | ||
| return """\ | ||
| requires = [ | ||
| ] | ||
| """ | ||
|
|
||
| def pyproject_table_linux_system_debian(self): | ||
| return """\ | ||
| system_requires = [ | ||
| # Add any system packages needed at build the app here | ||
| ] | ||
|
|
||
| system_runtime_requires = [ | ||
| # Add any system packages needed at runtime here | ||
| ] | ||
| """ | ||
|
|
||
| def pyproject_table_linux_system_rhel(self): | ||
| return """\ | ||
| system_requires = [ | ||
| # Add any system packages needed at build the app here | ||
| ] | ||
|
|
||
| system_runtime_requires = [ | ||
| # Add any system packages needed at runtime here | ||
| ] | ||
| """ | ||
|
|
||
| def pyproject_table_linux_system_suse(self): | ||
| return """\ | ||
| system_requires = [ | ||
| # Add any system packages needed at build the app here | ||
| ] | ||
|
|
||
| system_runtime_requires = [ | ||
| # Add any system packages needed at runtime here | ||
| ] | ||
| """ | ||
|
|
||
| def pyproject_table_linux_system_arch(self): | ||
| return """\ | ||
| system_requires = [ | ||
| # Add any system packages needed at build the app here | ||
| ] | ||
|
|
||
| system_runtime_requires = [ | ||
| # Add any system packages needed at runtime here | ||
| ] | ||
| """ | ||
|
|
||
| def pyproject_table_linux_flatpak(self): | ||
| return """\ | ||
| flatpak_runtime = "org.freedesktop.Platform" | ||
| flatpak_runtime_version = "23.08" | ||
| flatpak_sdk = "org.freedesktop.Sdk" | ||
| """ | ||
|
|
||
| def pyproject_table_windows(self): | ||
| return """\ | ||
| requires = [ | ||
| ] | ||
| """ | ||
|
|
||
| def pyproject_table_iOS(self): | ||
| return """\ | ||
| supported = false | ||
| """ | ||
|
|
||
| def pyproject_table_android(self): | ||
| return """\ | ||
| supported = false | ||
| """ | ||
|
|
||
| def pyproject_table_web(self): | ||
| return """\ | ||
| supported = false | ||
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.