py2app standalone app generation

Sun, 21 Jan 2018 01:14:06 +0000

author
Tuomo Valkonen <tuomov@iki.fi>
date
Sun, 21 Jan 2018 01:14:06 +0000
changeset 22
c3e95212e3f0
parent 21
c36e549a7f12
child 23
86b42610d5a8

py2app standalone app generation

README.md file | annotate | diff | comparison | revisions
config.py file | annotate | diff | comparison | revisions
setup.py file | annotate | diff | comparison | revisions
--- a/README.md	Sun Jan 21 00:58:06 2018 +0000
+++ b/README.md	Sun Jan 21 01:14:06 2018 +0000
@@ -11,6 +11,16 @@
  - [rumps](https://github.com/jaredks/rumps) (Ridiculously Uncomplicated macOS Python Statusbar apps)
  - [keyring](https://pypi.python.org/pypi/keyring)
 
+To create a standalone app, you can
+
+    pip install py2app
+
+(for alternatives see [py2app documentation](https://py2app.readthedocs.io/en/latest/install.html#installing-with-pip)), and then
+
+    python3 setup.py py2app
+
+This will place the app under `dist/`.
+
 ## Usage
 
 ### Passphrases
--- a/config.py	Sun Jan 21 00:58:06 2018 +0000
+++ b/config.py	Sun Jan 21 01:14:06 2018 +0000
@@ -119,7 +119,7 @@
 logging.info("Reading configuration file %s" % cfgfile)
 
 if not (os.path.exists(cfgfile) and os.path.isfile(cfgfile)):
-    raise SystemExit(f'Configuration file required: {cfgfile}')
+    raise SystemExit('Configuration file required: {cfgfile}')
 
 with io.open(cfgfile, 'r') as file:
     settings=expand_env(yaml.load(file), os.environ);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/setup.py	Sun Jan 21 01:14:06 2018 +0000
@@ -0,0 +1,18 @@
+from setuptools import setup
+
+APP = ['borgend.py']
+DATA_FILES = []
+OPTIONS = {
+    'argv_emulation': True,
+    'plist': {
+        'LSUIElement': True,
+    },
+    'packages': ['rumps', 'keyring'],
+}
+
+setup(
+    app=APP,
+    data_files=DATA_FILES,
+    options={'py2app': OPTIONS},
+    setup_requires=['py2app'],
+)

mercurial