A 'quickish' reply... which turned out to be too long. Sorry.

TLDR; yeah, templates are a great start, but APIs such as create-react-app
are better.




Some existing systems are interesting to look at.

love2d, renpy, phonegap, pandas 'deploy-ng', piwheels


panda3d: http://www.panda3d.org/manual/index.php/Using_Setuptools
(I feel pandas deploy-ng is trying to do it the love2d way with a bit more
automation)
One person has used it to make pygame executables (mac, linux, win) all
from one platform (from windows in their case but it should work for all).
Here are the instructions they made on how they did it.
https://pastebin.com/0zjTEgw3
If your app is a python package, it's only a few extra lines to be added to
your setup.py.
The Panda3d deploy-ng author doesn't have plans to make it a generic tool
yet, and it's not done,
but it should be usable for others anyway.
IMHO panda3d deploy-ng is a good project to help along.

Moral of the story - '*make your app as a python package*'.
(now if only making python packages wasn't hard)


love2d: does a 'here is an executable, modify and append your code'
https://love2d.org/wiki/Game_Distribution
There was an attempt at this for windows once, but it relied on py2exe
(which is now unmaintained).

kivy: https://kivy.org/doc/stable/guide/packaging.html

renpy: https://www.renpy.org/doc/html/build.html

phonegap: https://build.phonegap.com/
they have pretty good integration with the command line tools.

piwheels: https://www.piwheels.hostedpi.com/
piwheels is this awesome thing for making wheels for the rpi.
It just downloads all of the pypi and tries to make wheels. It's taken them
quite a long time to get where they are.
But even with one platform, they still don't have python 3.6... or python
3.7.
ps. piwheels is awesome, I mention this just to point out how much work it
is to keep things up to date.
Even if with one platform, and having a big organisation behind you.
Now, imagine if there was something which scanned github, or pypi and made
apps for you?


If you're on a Mac, you can make executables right now for windows, linux,
mac 'pretty easily'.
With pyinstaller and vagrant/virtualbox for linux, and wine (in homebrew)
for windows.


Unfortunately there is no free way that I know of to make a mac pygame
executable from windows or linux.
* except for the panda3d deploy-ng, but that is undocumented so far.
If your project is open source you can use circle CI or Travis CI to make
mac executable.




I'd hoped the solarwolf example game in the pygame repo could be such a
template.
But like all such templates (skellingtons in ludumdare lingo) they tend to
go out of date rather quickly it seems.
https://github.com/pygame/solarwolf

The solarwolf was updated to use all of these things (*marvel at how many
of them are now obsolete*):

   - mac - py2app is unmaintained,
   - windows - py2exe unmaintained too
   - pypi and pip have broken things several times
   - pygame subset for android is unmaintained.
   - The windows app requirements have changed,
   - so have the mac store guidelines
   - and iOS ones (several times).
   - The rpm and debian packaging inside solarwolf repo is out of date (but
   are fairly up to date in the various distros)


But I guess it could be updated to use current tooling with a bunch of
effort.

The react tooling has this stuff as a library rather than a template.
So rather than the template files being out of date when changes happen, it
works through an API.
So when changes need to be made to their config files,
thousands of apps don't break (which is the current situation with pypi and
pip).

This is sort of what I experimented with in pyrelease.
Rather than having the app files in a special place, with a special
setup.py with the appropriate config of the day...
it would generate the files needed for packaging in a temporary sub
directory.
This way, a stable API could be built.

The other pyrelease goals were to allow single files to be packaged, and
provide a UI for getting the required data.
For single files the meta data could be stored inside the file.py, or
stored in a central location.
    __author__
    __license__
    __description__
Then it has some UI to ask people the required meta data.

The end goal being someone could write their game, and type:
    python -m pyrelease myapp.py

(the tool could check these things...
(the package name is not available on pypi, so it can ask the user for an
alternative one)
(it doesn't see a version number, it could add one)
(it sees an `import pygame` at the top, it can add the trove classifiers
and could handle things like creating windows/linux/mac apps)
(maybe it finds a data/images folder, it can ask to include that in the
package)


pypa could use a sampleproject that recognizes the needs of apps.
https://github.com/pypa/sampleproject/

(But really an API would be better, because templates go out of date often)
Imagine you used the sampleproject as a template in several dozen projects
two years ago?
If it was an API or tool instead, you probably would just need to update
the tool.


Still getting apps into different platforms is hard, and a constantly
evolving beast.
Just think about icons, and the different system requirements. Some icons
now require thousands of pixels and vector art.
Then, how long can a 'short description' be (it's rather different on
different places). A long description? Is it html, markdown, or text?
Descriptions in several human languages.
Then there is all the admin work in signing up for various platforms(like
the app store), registering certificates for signing and such.
Now, what about screen shots, videos, gifs... all different sizes and
requirements.
Ones suitable for white backgrounds, for black backgrounds.






ps. in the original post I had added a link to your mu-editor CI config :)




On Monday, August 27, 2018, Nicholas H.Tollervey <nt...@ntoll.org> wrote:

> How hard would it be to automate this sort of thing (the distribution of
> games)?
>
> I mean, I've got the building of Mu automated for Windows and OSX and,
> rather than have others go through the pain I had to, I wonder if
> there's a way to be able to share this sort of thing so others can use a
> "no brainer" CI workflow to get them started. Perhaps a PyGame template
> that builds all this stuff in..?
>
> This probably would include:
>
> * Creating a Windows installer
> * Creating an OSX .app
> * An appimage for Linux.
> * Making a setup.py that allows them to distribute it via PyPI.
> * Android / iOS..? (Dunno about those)
>
> Thoughts..?
>
> N.
>
> On 27/08/18 18:15, René Dudfield wrote:
> > Hi,
> >
> > I'm trying to put together a guide on how to distribute pygame apps.
> >
> http://renesd.blogspot.com/2018/08/draft-of-how-to-port-and-market-games.html
> >
> > If you have any tips or links to relevant guides, please let me know
> > (either here or on the reddit post).
> >
> https://www.reddit.com/r/pygame/comments/9aodt7/collaborative_doc_lets_write_pygame_distribution/
> >
> >
> > cheers,
>
>

Reply via email to