*: initial commit
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
d67b2b8ab4
commit
adc0f86b92
15 changed files with 359 additions and 6 deletions
63
.gitignore
vendored
63
.gitignore
vendored
|
@ -160,3 +160,66 @@ cython_debug/
|
|||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||
#.idea/
|
||||
|
||||
||||||| (empty tree)
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
# OSX useful to ignore
|
||||
*.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
|
||||
# Thumbnails
|
||||
._*
|
||||
|
||||
# Files that might appear in the root of a volume
|
||||
.DocumentRevisions-V100
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
.VolumeIcon.icns
|
||||
.com.apple.timemachine.donotpresent
|
||||
|
||||
# Directories potentially created on remote AFP share
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
|
||||
# C extensions
|
||||
*.so
|
||||
|
||||
# Distribution / packaging
|
||||
.Python
|
||||
env/
|
||||
build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
downloads/
|
||||
eggs/
|
||||
.eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
var/
|
||||
*.dist-info/
|
||||
*.egg-info/
|
||||
.installed.cfg
|
||||
*.egg
|
||||
|
||||
# IntelliJ Idea family of suites
|
||||
.idea
|
||||
*.iml
|
||||
## File-based project format:
|
||||
*.ipr
|
||||
*.iws
|
||||
## mpeltonen/sbt-idea plugin
|
||||
.idea_modules/
|
||||
|
||||
# Briefcase log files
|
||||
logs/
|
||||
|
|
5
CHANGELOG
Normal file
5
CHANGELOG
Normal file
|
@ -0,0 +1,5 @@
|
|||
# Hello World Release Notes
|
||||
|
||||
## 0.0.1 (02 Apr 2024)
|
||||
|
||||
* Initial release
|
22
LICENSE
22
LICENSE
|
@ -1,9 +1,19 @@
|
|||
MIT License
|
||||
Copyright (c) 2024, Vincent Batts
|
||||
|
||||
Copyright (c) 2024 vbatts
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
|
12
README.rst
Normal file
12
README.rst
Normal file
|
@ -0,0 +1,12 @@
|
|||
Hello World
|
||||
===========
|
||||
|
||||
**This cross-platform app was generated by** `Briefcase`_ **- part of**
|
||||
`The BeeWare Project`_. **If you want to see more tools like Briefcase, please
|
||||
consider** `becoming a financial member of BeeWare`_.
|
||||
|
||||
My first application
|
||||
|
||||
.. _`Briefcase`: https://briefcase.readthedocs.io/
|
||||
.. _`The BeeWare Project`: https://beeware.org/
|
||||
.. _`becoming a financial member of BeeWare`: https://beeware.org/contributing/membership
|
195
pyproject.toml
Normal file
195
pyproject.toml
Normal file
|
@ -0,0 +1,195 @@
|
|||
# This project was generated with 0.3.17 using template: https://github.com/beeware/briefcase-template@v0.3.17
|
||||
[tool.briefcase]
|
||||
project_name = "Hello World"
|
||||
bundle = "com.example"
|
||||
version = "0.0.1"
|
||||
url = "https://example.com/helloworld"
|
||||
license = "MIT license"
|
||||
author = "Vincent Batts"
|
||||
author_email = "vbatts@hashbangbash.com"
|
||||
|
||||
[tool.briefcase.app.helloworld]
|
||||
formal_name = "Hello World"
|
||||
description = "My first application"
|
||||
long_description = """More details about the app should go here.
|
||||
"""
|
||||
icon = "src/helloworld/resources/helloworld"
|
||||
sources = [
|
||||
"src/helloworld",
|
||||
]
|
||||
test_sources = [
|
||||
"tests",
|
||||
]
|
||||
|
||||
requires = [
|
||||
]
|
||||
test_requires = [ "pytest",]
|
||||
|
||||
|
||||
[tool.briefcase.app.helloworld.macOS]
|
||||
universal_build = true
|
||||
requires = [
|
||||
"toga-cocoa~=0.4.0",
|
||||
"std-nslog~=1.0.0",
|
||||
]
|
||||
|
||||
|
||||
[tool.briefcase.app.helloworld.linux]
|
||||
requires = [
|
||||
"toga-gtk~=0.4.0",
|
||||
]
|
||||
|
||||
|
||||
[tool.briefcase.app.helloworld.linux.system.debian]
|
||||
system_requires = [
|
||||
# Needed to compile pycairo wheel
|
||||
"libcairo2-dev",
|
||||
# Needed to compile PyGObject wheel
|
||||
"libgirepository1.0-dev",
|
||||
]
|
||||
|
||||
system_runtime_requires = [
|
||||
# Needed to provide GTK and its GI bindings
|
||||
"gir1.2-gtk-3.0",
|
||||
"libgirepository-1.0-1",
|
||||
# Dependencies that GTK looks for at runtime
|
||||
"libcanberra-gtk3-module",
|
||||
# Needed to provide WebKit2 at runtime
|
||||
# "gir1.2-webkit2-4.0",
|
||||
]
|
||||
|
||||
|
||||
[tool.briefcase.app.helloworld.linux.system.rhel]
|
||||
system_requires = [
|
||||
# Needed to compile pycairo wheel
|
||||
"cairo-gobject-devel",
|
||||
# Needed to compile PyGObject wheel
|
||||
"gobject-introspection-devel",
|
||||
]
|
||||
|
||||
system_runtime_requires = [
|
||||
# Needed to support Python bindings to GTK
|
||||
"gobject-introspection",
|
||||
# Needed to provide GTK
|
||||
"gtk3",
|
||||
# Dependencies that GTK looks for at runtime
|
||||
"libcanberra-gtk3",
|
||||
# Needed to provide WebKit2 at runtime
|
||||
# "webkit2gtk3",
|
||||
]
|
||||
|
||||
|
||||
[tool.briefcase.app.helloworld.linux.system.suse]
|
||||
system_requires = [
|
||||
# Needed to compile pycairo wheel
|
||||
"cairo-devel",
|
||||
# Needed to compile PyGObject wheel
|
||||
"gobject-introspection-devel",
|
||||
]
|
||||
|
||||
system_runtime_requires = [
|
||||
# Needed to provide GTK
|
||||
"gtk3",
|
||||
# Needed to support Python bindings to GTK
|
||||
"gobject-introspection", "typelib(Gtk) = 3.0",
|
||||
# Dependencies that GTK looks for at runtime
|
||||
"libcanberra-gtk3-0",
|
||||
# Needed to provide WebKit2 at runtime
|
||||
# "libwebkit2gtk3",
|
||||
# "typelib(WebKit2)",
|
||||
]
|
||||
|
||||
|
||||
[tool.briefcase.app.helloworld.linux.system.arch]
|
||||
system_requires = [
|
||||
# Needed to compile pycairo wheel
|
||||
"cairo",
|
||||
# Needed to compile PyGObject wheel
|
||||
"gobject-introspection",
|
||||
# Runtime dependencies that need to exist so that the
|
||||
# Arch package passes final validation.
|
||||
# Needed to provide GTK
|
||||
"gtk3",
|
||||
# Dependencies that GTK looks for at runtime
|
||||
"libcanberra",
|
||||
# Needed to provide WebKit2
|
||||
# "webkit2gtk",
|
||||
]
|
||||
|
||||
system_runtime_requires = [
|
||||
# Needed to provide GTK
|
||||
"gtk3",
|
||||
# Needed to provide PyGObject bindings
|
||||
"gobject-introspection-runtime",
|
||||
# Dependencies that GTK looks for at runtime
|
||||
"libcanberra",
|
||||
# Needed to provide WebKit2 at runtime
|
||||
# "webkit2gtk",
|
||||
]
|
||||
|
||||
|
||||
[tool.briefcase.app.helloworld.linux.appimage]
|
||||
manylinux = "manylinux_2_28"
|
||||
|
||||
system_requires = [
|
||||
# Needed to compile pycairo wheel
|
||||
"cairo-gobject-devel",
|
||||
# Needed to compile PyGObject wheel
|
||||
"gobject-introspection-devel",
|
||||
# Needed to provide GTK
|
||||
"gtk3-devel",
|
||||
# Dependencies that GTK looks for at runtime, that need to be
|
||||
# in the build environment to be picked up by linuxdeploy
|
||||
"libcanberra-gtk3",
|
||||
"PackageKit-gtk3-module",
|
||||
"gvfs-client",
|
||||
]
|
||||
|
||||
linuxdeploy_plugins = [
|
||||
"DEPLOY_GTK_VERSION=3 gtk",
|
||||
]
|
||||
|
||||
|
||||
[tool.briefcase.app.helloworld.linux.flatpak]
|
||||
flatpak_runtime = "org.gnome.Platform"
|
||||
flatpak_runtime_version = "45"
|
||||
flatpak_sdk = "org.gnome.Sdk"
|
||||
|
||||
|
||||
[tool.briefcase.app.helloworld.windows]
|
||||
requires = [
|
||||
"toga-winforms~=0.4.0",
|
||||
]
|
||||
|
||||
|
||||
# Mobile deployments
|
||||
[tool.briefcase.app.helloworld.iOS]
|
||||
requires = [
|
||||
"toga-iOS~=0.4.0",
|
||||
"std-nslog~=1.0.0",
|
||||
]
|
||||
|
||||
|
||||
[tool.briefcase.app.helloworld.android]
|
||||
requires = [
|
||||
"toga-android~=0.4.0",
|
||||
]
|
||||
|
||||
base_theme = "Theme.MaterialComponents.Light.DarkActionBar"
|
||||
|
||||
build_gradle_dependencies = [
|
||||
"androidx.appcompat:appcompat:1.6.1",
|
||||
"com.google.android.material:material:1.11.0",
|
||||
# Needed for DetailedList
|
||||
"androidx.swiperefreshlayout:swiperefreshlayout:1.1.0",
|
||||
]
|
||||
|
||||
|
||||
# Web deployments
|
||||
[tool.briefcase.app.helloworld.web]
|
||||
requires = [
|
||||
"toga-web~=0.4.0",
|
||||
]
|
||||
style_framework = "Shoelace v2.3"
|
||||
|
||||
|
0
src/helloworld/__init__.py
Normal file
0
src/helloworld/__init__.py
Normal file
5
src/helloworld/__main__.py
Normal file
5
src/helloworld/__main__.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
from helloworld.app import main
|
||||
|
||||
if __name__ == "__main__":
|
||||
main().main_loop()
|
||||
|
25
src/helloworld/app.py
Normal file
25
src/helloworld/app.py
Normal file
|
@ -0,0 +1,25 @@
|
|||
"""
|
||||
My first application
|
||||
"""
|
||||
import toga
|
||||
from toga.style import Pack
|
||||
from toga.style.pack import COLUMN, ROW
|
||||
|
||||
|
||||
class HelloWorld(toga.App):
|
||||
def startup(self):
|
||||
"""Construct and show the Toga application.
|
||||
|
||||
Usually, you would add your application to a main content box.
|
||||
We then create a main window (with a name matching the app), and
|
||||
show the main window.
|
||||
"""
|
||||
main_box = toga.Box()
|
||||
|
||||
self.main_window = toga.MainWindow(title=self.formal_name)
|
||||
self.main_window.content = main_box
|
||||
self.main_window.show()
|
||||
|
||||
|
||||
def main():
|
||||
return HelloWorld()
|
0
src/helloworld/resources/__init__.py
Normal file
0
src/helloworld/resources/__init__.py
Normal file
BIN
src/helloworld/resources/helloworld.icns
Normal file
BIN
src/helloworld/resources/helloworld.icns
Normal file
Binary file not shown.
BIN
src/helloworld/resources/helloworld.ico
Normal file
BIN
src/helloworld/resources/helloworld.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
BIN
src/helloworld/resources/helloworld.png
Normal file
BIN
src/helloworld/resources/helloworld.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
0
tests/__init__.py
Normal file
0
tests/__init__.py
Normal file
35
tests/helloworld.py
Normal file
35
tests/helloworld.py
Normal file
|
@ -0,0 +1,35 @@
|
|||
import os
|
||||
import sys
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
def run_tests():
|
||||
project_path = Path(__file__).parent.parent
|
||||
os.chdir(project_path)
|
||||
|
||||
# Determine any args to pass to pytest. If there aren't any,
|
||||
# default to running the whole test suite.
|
||||
args = sys.argv[1:]
|
||||
if len(args) == 0:
|
||||
args = ["tests"]
|
||||
|
||||
returncode = pytest.main(
|
||||
[
|
||||
# Turn up verbosity
|
||||
"-vv",
|
||||
# Disable color
|
||||
"--color=no",
|
||||
# Overwrite the cache directory to somewhere writable
|
||||
"-o",
|
||||
f"cache_dir={tempfile.gettempdir()}/.pytest_cache",
|
||||
] + args
|
||||
)
|
||||
|
||||
print(f">>>>>>>>>> EXIT {returncode} <<<<<<<<<<")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
run_tests()
|
3
tests/test_app.py
Normal file
3
tests/test_app.py
Normal file
|
@ -0,0 +1,3 @@
|
|||
def test_first():
|
||||
"""An initial test for the app."""
|
||||
assert 1 + 1 == 2
|
Loading…
Reference in a new issue