This is the first in a series of articles about making python game distribution better.
With all the great work from lots of people pygame is often easily installable via pip – the standard python packaging system. We still have some issues, but it works quite well on major platforms. See “How we cobbled together a free Spectacularly Adequate Build Page.” for more details on how we package pygame for pip.
Now our games can be installed with pip too! Here’s an example game I started packaging up, now available on the python package index. Note, it will install pygame for you.
“ newbies to python often come in through game development ”
As a game developer why should I use pip? Firstly, there is a very large audience of people who can install python games – python developers. This is mainly your peers, but python also comes installed already on many platforms (linux, Mac, etc). You can manage dependencies more easily (so you don’t need to worry people don’t have one of your other libraries installed). You don’t need to worry about the platform issues of binaries so much. If they have pip on their platform, then they can install your game. Other benefits of publishing on pypi include syndication, since many people tweet and copy all the releases on pypi. Another benefit is all the infrastructure work that goes into pypi, CDN networks and such.
I suggest efforts should be applied to:
- updating tutorials, and spreading the idea of publishing python games to the cheeseshop (pyweek, pygame.org tutorials, external tutorials, books, youtube videos)
- base code for a pygame game in a standard structure (skellington, cookiecutter etc)
- contacting other python game communities to suggest pypi should be a priority
- making the cheeseshop/pypi itself a better platform for game publishing needs
- making python packaging easier, by fixing python packaging warts which stop newbies.
What pypi doesn’t do currently? It doesn’t do many things that a good game release system would do. Video/youtube links, and even screenshots aren’t available. Discussion has been disabled (they found it way too hard to moderate). Even ratings are not on there (which can help for discover-ability). Another issue is that closed source things aren’t really looked apon nicely there(but it is allowed). Finally, packaging in python still isn’t the easiest thing (it’s definitely not as easily as uploading a zip file, but it is waaaaaay nicer now than ever before).
Any work that goes into making the packaging better for games helps out with other python game communities as well. We can perhaps even gain allies from the other communities to help improve things for python games in general.
Here are where the pypi projects live.
- (current pypi) – https://github.com/pypa/pypi-legacy
- (next gen pypi) – https://github.com/pypa/warehouse
- (sampleproject) – https://github.com/pypa/sampleproject
The second part of this article series is about what else we can do to improve distribution. Topics coming up in this article series include – a new “skellington” (from pyweek) based on the “sampleproject” (from pypa) with everything setup, and using appveyor/travisci/etc to build binaries on mac/linux/windows/android for everyone, as well as a list of python packaging warts I’ve gathered from people trying to package their python modules.