50

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

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

FogleBird
  • 74,300
  • 25
  • 125
  • 131

6 Answers6

59

I packaged Pennywise, which is available on the Mac App Store. It's based on Virgil's moneyGuru, which uses Python, PyObjC, and 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 code for an example of how to use Xcode as the final part of the build process.

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.

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.

lemnar
  • 4,063
  • 1
  • 32
  • 44
9

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.

Virgil Dupras
  • 2,634
  • 20
  • 22
6

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.

David Foster
  • 6,931
  • 4
  • 41
  • 42
  • I find it funny that you wrote a shell script, instead of a python script, to automate the various parts of the process for uploading a python script to the App Store. – ArtOfWarfare Apr 14 '15 at 14:40
  • Yeah I suppose that is a bit funny. Since most of the process is just running other CLI tools and there isn't much heavy validation or abstraction, shell scripts work okay as-is. -- More complex shell scripts I've written in other projects were eventually promoted to Python scripts. – David Foster Apr 15 '15 at 15:18
5

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.

See here for a full list of requirements:

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

blueberryfields
  • 45,910
  • 28
  • 89
  • 168
  • This helps, but doesn't really cover exactly how to package a successful submission (the second part of my question). – FogleBird Feb 09 '11 at 01:37
  • The instructions say to use XCode and the associated packaging tools, I thought. – blueberryfields Feb 09 '11 at 03:10
  • 2
    "This means that the python interpreter will have to be bundled into your application, for example." Where are you getting that requirement from? There's a perfectly good interpreter at `/System/Library/Frameworks/Python.framework` – Miles Feb 09 '11 at 08:31
  • 1
    @Miles The rules indicate applications are not allowed to do auto-updates or to force updates of external components. I combined that with my assumption that most people would want to control the version of python that runs with their application. – blueberryfields Feb 09 '11 at 15:50
  • 2
    Py2App embeds the interpreter into the application package. – Kenneth Reitz Feb 15 '11 at 18:52
3

It is quite possible. My app is currently listed:

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

Bundled up with py2app, no worries.

Kevin Walzer
  • 538
  • 4
  • 14
1

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.5 and /usr/lib/python2.5.

Michael Shopsin
  • 2,055
  • 2
  • 24
  • 43