[Tutor] Putting a Bow on It

boB Stepp robertvstepp at gmail.com
Sun Feb 10 00:51:11 EST 2019


On Fri, Feb 8, 2019 at 12:35 PM Chip Wachob <wachobc at gmail.com> wrote:
>
> Hello,
>
> I've been off working on other projects, but I'm finally back to the
> project that so many here have helped me work through.  Thank you to the
> group at large.
>
> So, this leads me to my question for today.
>
> I'm not sure what the "correct" term is for this, but I want to create what
> I'll call a Package.

I have not looked into this topic, but your term is very close to the
mark as I understand it.

> I want to bundle all my scripts, extra libraries, etc into one file.  If I
> can include a copy of Python with it that would be even better.
>
> I'm looking for the simplest approach for the user to install.  Eg:
> libraries will install themselves in the correct directories, etc, so that
> there is minimal pain on the part of the user.

Searching for "python packaging tutorials" a sampling of what I get is:

1)  Packaging Python Projects:
https://packaging.python.org/tutorials/packaging-projects/

2)  A Simple Guide for Python Packaging:
https://medium.com/small-things-about-python/lets-talk-about-python-packaging-6d84b81f1bb5

Etc.

There are also ways to create frozen binaries.

I just bought a book today that I have been flipping through tonight,
"Serious Python" by Julien Danjou.  His chapter 5 is entitled
"Distributing Your Software".  He discusses the history of Python
packaging and says that setuptools is "... the standard for advanced
package installations, was at first deprecated but is now back in
active development and the de facto standard."  This book has just
been released this year and is written around Python 3.7 being the
latest version, so hopefully his comment is accurate for 2019.

> I would need to do this for both Windows and Linux so something that is
> platform agnostic would be great.

In the book's chapter I mentioned, the author gives a warning about
portability (from page 63):

"If the Wheel you build contains binary programs or libraries (like a
Python extension written in C), the binary Wheel might not be as
portable as you imagine.  It will work by default on some platforms,
such as Darwin (macOS) or Microsoft Windows, but it might not work on
all Linux distributions.  The PEP 513
(https://www.python.org/dev/peps/pep-0513) targets this Linux problem
by defining a new platform tag named manylinux1 and a minimal set of
libraries that are guaranteed to be available on that platform."

So apparently there is not yet a platform agnostic panacea for program
installations with all of their possible dependencies.

Sorry I know so little about this, but perhaps this might get you
pointed in a helpful direction.  Hopefully the professionals will
weigh in on your questions soon.

-- 
boB


More information about the Tutor mailing list