[Tutor] Putting a Bow on It

Oscar Benjamin oscar.j.benjamin at gmail.com
Mon Feb 18 08:27:12 EST 2019


On Mon, 11 Feb 2019 at 17:30, Alan Gauld via Tutor <tutor at python.org> wrote:
>
> Three is a lot of work going on in Python land but no universal
> solution. Some things work better on particular platforms.
> And building library packages is easier than complete applications.

I think this is the basic problem. There has been a lot of progress in
distributing libraries with pip, wheel etc. For an experienced
programmer it's easy to set something up with pip and venv that gets
you all the libraries you want. It's also pretty straight-forward to
write a setup.py and use setuptools to build the wheels that pop can
then install.

Distributing applications is still problematic though and that's what
Chip wants to do. In particular people often want to be able to do
this in a single file hence py2exe, pyinstaller etc.

But note that most professional software doesn't work that way.
Normally a user can download a single file but that file will be the
installer that then puts all the other files in position.

> But for now, if you have more than a pure Python application,
> you are pretty much stuck with building multiple solutions with
> multiple tools.

Chip is yours a pure Python application?

If it is then my suggestion would be to ask your users (if using
Windows) to install Python from the normal Python downloads page:
https://www.python.org/downloads/

Then you can give them a zipapp of your application:
https://docs.python.org/3/library/zipapp.html

I think if your zipapp has the .py extension and the shebang then it
should be possible to double-click the file to run it on Windows (it's
possible this depends on options ticked/unticked in the Windows
installer - might need to be installed for all users).

The advantage of this approach is that Python already has a
well-maintained installer so you don't have to bother with that part
yourself. It does mean that it's a two step-process for your users but
once they have done the first step you can send them as many zipapps
as you like and it should be fairly easy from there.

I haven't actually tested all of these steps together properly though
so there's a good chance if you try this that you will quickly
encounter some difficulty...

--
Oscar


More information about the Tutor mailing list