You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What would be the most elegant way to store application version information assuming the application will be exported with Buildozer to Android and iOS?
I would like to keep application name and version in one place so it is then available to both Buildozer specification (to generate mobile application release) and application code (to display name and version for the user).
I know that buildozer.spec requires the application name and version variables.
Should I set my application name and version in Buildozer specification then import them into my application code?
Should I create global variables in my main.py with application name and version them import them somehow into Buildozer specification?
Should I create separate file then import it somehow to both buildozer and application code?
Is there any prefered way or this needs to be yet created?
Any hints welcome :-)
The text was updated successfully, but these errors were encountered:
You can either use version = 0.1 directly or search for __version__ = '0.1' variable value defined in a file specified by version.filename.
# version = 0.1
# EITHER ABOVE OR BELOW
version.regex = __version__ = ['"](.*)['"]
version.filename = %(source.dir)s/main.py
Long story short put __version__ = '0.1' in the main.py and it will be obtained by buildozer.spec when you select second method :-)
You can also use git module to append branch and commit hex to the version string that will be safe to read by default buildozer regex and will help in release identification when developing with git.
__version__ = '0.1.0'
# IF A GIT REPO APPEND BRANCH AND COMMIT TO VERSION STRING
try:
from git import Repo
repo = Repo(search_parent_directories=True)
__version__ = __version__ + '-' + repo.active_branch.name
__version__ = __version__ + '-' + repo.active_branch.commit.hexsha[:7]
del Repo
except:
pass
Versions
3.9.13
macOS 12.5
/FreeBSD 13-STABLE
1.4.0 / master
Description
Hello world of Kivy :-)
What would be the most elegant way to store application version information assuming the application will be exported with Buildozer to Android and iOS?
I would like to keep application name and version in one place so it is then available to both Buildozer specification (to generate mobile application release) and application code (to display name and version for the user).
I know that
buildozer.spec
requires the application name and version variables.Should I set my application name and version in Buildozer specification then import them into my application code?
Should I create global variables in my main.py with application name and version them import them somehow into Buildozer specification?
Should I create separate file then import it somehow to both buildozer and application code?
Is there any prefered way or this needs to be yet created?
Any hints welcome :-)
The text was updated successfully, but these errors were encountered: