I want to create a simple Mac application bundle which calls a simple Python script. I want to do that in Python.
Is there an easy way?
I tried to use py2app but that fails somehow, e.g.:
from setuptools import setup
setup(app=["foo.py"], setup_requires=["py2app"])
gives:
---------------------------------------------------------------------------
SystemExit Traceback (most recent call last)
/Users/az/<ipython console> in <module>()
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.pyc in setup(**attrs)
138 ok = dist.parse_command_line()
139 except DistutilsArgError, msg:
--> 140 raise SystemExit, gen_usage(dist.script_name) + "\nerror: %s" % msg
141
142 if DEBUG:
SystemExit: usage: ipython [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: ipython --help [cmd1 cmd2 ...]
or: ipython --help-commands
or: ipython cmd --help
error: no commands supplied
Type %exit or %quit to exit IPython (%Exit or %Quit do so unconditionally).
I also tried:
import py2app.build_app
py2app.build_app.py2app("foo.py")
which also doesn't work (TypeError: dist must be a Distribution instance
) (I'm not really sure how to use py2app.build_app.py2app
and also haven't really found much examples / documentation about it).
Maybe setuptools/py2app or so are anyway overkill for my use case. I just want to create a simple empty app bundle, copy a Python script into it and configure its Info.plist in such a way that it calls the Python script.