I have a setup.py
that use py2app, and I want to run 2to3
to convert python script to Python 3 compatible before build the app. I used option setup(use_2to3=True)
, but it did not call 2to3
. So now I use a Makefile
to work around this problem. Any pythonic solution? The setup.py is below. Please help.
import sys
from setuptools import setup
from plistlib import Plist
plist = Plist.fromFile('Info.plist')
OPTIONS = {
'iconfile': 'python.icns',
'plist': plist
}
if sys.version_info.major < 3:
app = "PyInterpreter.py"
else:
app = "build/PyInterpreter.py"
setup(
name="PyInterpreter",
app=[app],
data_files=["English.lproj"],
options={'py2app': OPTIONS},
setup_requires=["py2app"],
use_2to3=True,
)
Thanks.