Adds support for Resources! This allows users to take advantage of the --add-data command that pyinstaller utilizes.
This feature is currently in alpha.
...
from pymacapp import Resource
...
app.resource(Resource("./src/README.md"))
You can also create the Resource(...) directly in your application and then import to your build file.
Method 1: Preferred
in: main.py
from pymacapp import Resource
RESOURCES:list[Resource] = []
readme = Resource("./README.md")
RESOURCES.append(readme)
get path of the file and use the resource with the Resource.path() method
readme_path = readme.path()
in build.py
from main import RESOURCES
...
add all resources in RESOURCES to app
[app.resource(resource) for resource in RESOURCES]
Method 2: Individual/Granular Resource Management
in: main.py
from pymacapp import Resource
readme = Resource("./README.md")
get path of the file and use the resource with the Resource.path() method
readme_path = readme.path()
in build.py
from main import readme
...
app.resource(readme)