Packaging, distribution and installation good practice (for entries and libraries)

This thread comes about for a couple of reasons.

  1. A statement in a thread on discarding Python 2 that Skellington did not work in Python 3. I haven't checked that, so I don't know if it remains the case.
  2. A slight tangent during discussing what qualifies as library code which prompted tizilogic to suggest some more information on Namespace Packages.

Now is the right time to consider this subject. Python 3.7 and above does packaging and virtual environments with much less burden on the user than has previously been the case. Declaring Python 2 end of line means waving goodbye to eggs, pyenv and all that old stuff.

A point of terminology. A package is your game or library, when properly organised and declared as such.
There are two species of Python package:

  • A simple package
  • A namespace package

A distribution is an installable, versioned release of that package. That release can come in at least three formats I can think of:

  • As  a .zip bundle
  • As a source archive (.tar.gz or .zip)
  • As a Wheel (.whl)
The point of this thread is to construct some guidance on how best to package and distribute both games and libraries to permit easy installation on all common target platforms (and we should probably define what we think those are).

One more input to this. A while back I wrote a step-by-step tutorial on namespace packages, and in what circumstances they can be useful. If someone can check it still works, I'd happily donate it to any documentation we come up with.