-
-
Notifications
You must be signed in to change notification settings - Fork 372
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1781 from freakboy3742/cmdline-app
Add support for console apps
- Loading branch information
Showing
53 changed files
with
3,404 additions
and
1,380 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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.