macos 是否可以在 Mac App Store 上部署 Python 应用程序?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4940273/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 07:41:41  来源:igfitidea点击:

Is it possible to deploy a Python application on the Mac App Store?

pythonmacosapp-storepy2app

提问by FogleBird

Does Apple accept Python applications for distribution on the new Mac App Store?

Apple 是否接受 Python 应用程序在新的 Mac App Store 上分发?

If so, how should the application be packaged? Is py2app sufficient? Something else?

如果是这样,应用程序应该如何打包?py2app 够用吗?还有什么?

回答by lemnar

I packaged Pennywise, which is available on the Mac App Store. It's based on Virgil's moneyGuru, which uses Python, PyObjC, and py2app.

我打包了 Pennywise,它可以在 Mac App Store 上找到。它基于 Virgil 的 moneyGuru,它使用 Python、PyObjC 和 py2app。

You will have to follow Apple's process for preparing an application for submission to the Mac App Store. Most importantly, you will want to add the proper keys to your Info.plist, and remove any automatic updating mechanism, e.g. Sparkle. It's not strictly required, but you will probably also want to implement receipt checking. Using Xcode will make the submission process much easier. You can look at the moneyGuru source codefor an example of how to use Xcode as the final part of the build process.

您必须按照Apple 的流程来准备提交到 Mac App Store 的应用程序。最重要的是,您需要将正确的键添加到您的 Info.plist,并删除任何自动更新机制,例如 Sparkle。这不是严格要求的,但您可能还想实施收据检查。使用 Xcode 将使提交过程更加容易。您可以查看moneyGuru 源代码以了解如何使用 Xcode 作为构建过程的最后部分的示例。

Py2app embeds a copy of the Python framework in the bundle, so I don't know whether Apple would approve an application that only linked to the system framework. While the primary binary can't support PPC, Apple does not seem to check the architectures of binaries in embedded frameworks.

Py2app 在bundle 中嵌入了一份Python 框架的副本,所以不知道苹果是否会批准一个只链接到系统框架的应用程序。虽然主要二进制文件不能支持 PPC,但 Apple 似乎没有检查嵌入式框架中二进制文件的架构。

One final caveat: I wouldn't recommend this process for writing new applications. Using Python, PyObjC, and py2app seriously complicates the build process and introduces additional dependencies.

最后一个警告:我不推荐这个过程来编写新的应用程序。使用 Python、PyObjC 和 py2app 会使构建过程变得非常复杂并引入额外的依赖项。

回答by Virgil Dupras

I know it's possible because I know of at least one Python-based app that is in the app store ("Pennywise", which is based on my own app, moneyGuru, which uses Python + PyObjc + py2app). I didn't do it myself, so I'm not sure of the details.

我知道这是可能的,因为我知道应用程序商店中至少有一个基于 Python 的应用程序(“Pennywise”,它基于我自己的应用程序 moneyGuru,它使用 Python + PyObjc + py2app)。我不是自己做的,所以我不确定细节。

回答by David Foster

I wrote a comprehensive article explaining how to build and submit a Python app to the Mac App Store. It includes source code and build scripts for a barebones example app that I have successfully submitted.

我写了一篇综合文章,解释了如何构建 Python 应用程序并将其提交到 Mac App Store。它包括我已成功提交的准系统示例应用程序的源代码和构建脚本。

回答by blueberryfields

Yes, it is possible, as long as you adhere with the full set of approval guidelines. This means that the python interpreter will have to be bundled into your application, for example.

是的,这是可能的,只要您遵守全套批准指南。例如,这意味着必须将 Python 解释器捆绑到您的应用程序中。

See here for a full list of requirements:

请参阅此处以获取完整的要求列表:

https://developer.apple.com/appstore/mac/resources/approval/guidelines.html

https://developer.apple.com/appstore/mac/resources/approval/guidelines.html

回答by Kevin Walzer

It is quite possible. My app is currently listed:

这是很有可能。我的应用程序目前已列出:

http://itunes.apple.com/us/app/quickwho/id419483981?mt=12&ls=1#

http://itunes.apple.com/us/app/quickwho/id419483981?mt=12&ls=1#

Bundled up with py2app, no worries.

与py2app捆绑,无后顾之忧。

回答by Michael Shopsin

Apple provides the Build Applet tool for Python with Xcode so it should be supported by the App store. MacOS X 10.6.6 includes Python 2.5 and 2.6 as part of the default install, you can specify /usr/bin/python2.5and /usr/lib/python2.5.

Apple 使用 Xcode 为 Python 提供了 Build Applet 工具,因此 App Store 应该支持它。MacOS X 10.6.6 包含 Python 2.5 和 2.6 作为默认安装的一部分,您可以指定/usr/bin/python2.5/usr/lib/python2.5.