我有一个setup.py
使用 py2app,我想2to3
在构建应用程序之前运行将 python 脚本转换为 Python 3 兼容。我使用了选项setup(use_2to3=True)
,但它没有调用2to3
。所以现在我用 aMakefile
来解决这个问题。任何pythonic解决方案?setup.py 如下。请帮忙。
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,
)
谢谢。