Skip to main content

Pluggable Micro Packager

Project description

pup is (in the early stages of development and risks becoming) a packaging tool for GUI programs written in Python.

Fundamentally, its raison d’être is producing macOS and Windows native packages for distributing the Mu Editor to Python beginners around the world. As a by-product of that, it will very likely become effective at packaging generic Python written GUI programs. If that ever becomes the case, then great. Otherwise, that’s fine too.

The purpose, again, is to package Mu Editor for macOS and Windows distribution.

Capabilities

The current version of pup, while still very limited and somewhat exploratory, can package, at least, the Mu Editor and puppy into:

  • Native Windows applications, bundled in relocatable directories.

  • Native macOS relocatable .app application bundles, properly signed and notarized as required for distribution.

It might work with any Python GUI application that:

  • Runs on Python 3.7 or 3.8.

  • Is pip-installable (no need to be on PyPI, though).

  • Is launchable from the CLI with python -m <launch-module>.

Installation

pup is distributed via PyPI. Install it with:

$ pip install pup

Generic Usage

To package an application, run:

$ pup package <pip-installable-source>
  • Assumes that the application is launchable with python -m <name>, where <name> is extracted from the wheel metadata of a wheel created from <pip-installable-source>. If the name of the launch module does not match that, the --launch-module <launch-module-name> CLI option should be provided.

  • In the first run, pup will download a distributable Python Runtime from the Python Build Standalone project. Subsequent runs will use a locally cached version of that.

  • pup logs its progress to STDERR, with fewer per-event details when it’s a TTY. The logging level defaults to INFO and can be changed with either the --log-level CLI option, or by setting the PUP_LOG_LEVEL environment variable.

  • The resulting artifact will be under ./build/pup/.

Packaging the Mu Editor on Windows

Run:

> pup package --launch-module=mu <path-to-local-mu-git-repo-root>
  • The resulting packaged application will be the ./build/pup/<name>-<version>/ directory which contains a GUI-clickable script that launches the application.

  • Creating an ZIP archive of that directory and distributing it should work, up to a point, given that no code/package signing is implemented yet.

Packaging the Mu Editor on macOS

Requirements:

  • Must be running macOS 10.14.6 (Mojave) or later.

  • Must have XCode 10.3 or later installed – the Command Line Tools are not enough.

  • Must have an Apple Developer Certificate – see this article’s step 4, for guidance.

  • Must create an Application Specific Password – see this article, for guidance.

Run:

$ export PUP_SIGNING_IDENTITY=<signer>
$ export PUP_NOTARIZE_USER=<user>
$ export PUP_NOTARIZE_PASSWORD=<asp>

Where:

  • <signer> is the 10-digit identifier on your Apple Developer Certificate’s cname.

  • <user> is the email address associated to you Apple Developer Account.

  • <asp> is the Application Specific Password.

Then run:

$ pup package --launch-module=mu <path-to-local-mu-git-repo-root>

Note:

  • One of the last packaging stages is notarization.

  • It will take a while – no less than 3 minutes, IME, sometimes 10-15 minutes.

  • The logged messages should help understand that the “thing” is not “hung”.

  • Just be patient, I guess! :)

More

To learn more about pup refer to the online documentation: at this early stage, it is mostly a collection of thoughts and ideas around behaviour, requirements, and internal design. Development moves forward on GitHub at https://github.com/mu-editor/pup/.

Thanks

  • Nicholas Tollervey for the amazing Mu Editor.

  • The Mu contributors I’ve been having the privilege of working more directly with, Carlos Pereira Atencio, Martin Dybdal, and Tim Golden, as well as the others whom I haven’t met yet but whose contributions I highly respect.

  • To Russell Keith-Magee for the inspiring BeeWare project and, in particular, for briefcase that being used as the packaging tool for Mu on macOS as of this writing, serves as a great inspiration to pup.

  • To Gregory Szorc for the incredible Python Standalone Builds project, on top of which we plan to package redistributable Python GUI applications.

  • To Donald Stufft for letting us pick up the pup name in PyPI.

  • To Glyph Lefkowitz for the very useful, high quality Tips And Tricks for Shipping a PyGame App on the Mac article, and for his generous hands-on involvement in the first-steps of pup’s take on the subject in this issue.

About

pup is in the process of being created by Tiago Montes, with the wonderful support of the Mu development team.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pup-1.0.0a4.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pup-1.0.0a4-py3-none-any.whl (26.4 kB view details)

Uploaded Python 3

File details

Details for the file pup-1.0.0a4.tar.gz.

File metadata

  • Download URL: pup-1.0.0a4.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.9

File hashes

Hashes for pup-1.0.0a4.tar.gz
Algorithm Hash digest
SHA256 e0b142a14e579fd733ee7de311b9fda1a1c0e3b9693c15e5cef9f7caddcceec1
MD5 476ca141d985efa21d5e7d415dfca850
BLAKE2b-256 bd8ce513d17041cc8127adc66917f44cf4420eacda8d85de12c1e0d5bdcb10e6

See more details on using hashes here.

File details

Details for the file pup-1.0.0a4-py3-none-any.whl.

File metadata

  • Download URL: pup-1.0.0a4-py3-none-any.whl
  • Upload date:
  • Size: 26.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.9

File hashes

Hashes for pup-1.0.0a4-py3-none-any.whl
Algorithm Hash digest
SHA256 f5a3779e27f5c44b4e1c640b936b0151a65cfb05dda893d8cd7f756d63c90050
MD5 334df6565b2d22bdf8fd139b53cb61fc
BLAKE2b-256 5aed1747f36264b4c39d03368acdfb38187ae768c3a113feb842e2514c091e70

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page