Pyzzer installs an executable pyz script but no library code

Issue #2 new
Paul Moore created an issue

The setup.py for pyzzer installs no library code, but rather just installs the pyzzer.pyz and pyzzerw.pyz scripts. The pyz extension is non-standard and may not be executable on a user machine (depending on user config). Also, in order to run setup.py the build.sh script must be run first (this is a Unix shell script, although it's trivially easy to run the commands on Windows so portability isn't a huge problem).

As an alternative, setup.py could install the "pyzzer" package and specify an entry point for pyzzer:main. This would give a more standard install experience.

Would a pull request to this effect be acceptable? I could develop something that preserved the existing functionality, but also accepted a flag (something like --install-library) to request installation of the more conventional library + entry point layout.

I will probably develop a "conventional" setup.py in any case, but if it's not wanted in the core distribution, I'll maintain it as a private fork of the project and skip the dual-format installation complexity.

Comments (3)

  1. Vinay Sajip repo owner

    But the premise behind pyzzer is to use an alternative to the "standard install experience", which is why I didn't do a conventional setup.py. A conventional install seems like "not eating one's own dog food", and pyzzer should be useful not only for packaging up software for one's own use, but also distributing it to others in an easy-to-use way.

    Go ahead and build the alternative, but don't worry about sending a PR just yet as I'm not sure I want a conventional setup.py - but ping me when you're done and I'll take a look in your repo.

  2. Paul Moore reporter

    OK, thanks. That's a fair point, but if that's how you want to distribute pyzzer, I'd say you shouldn't have a setup.py at all. After all, setup.py is for installing Python distributions, not for creating executable applications. I'd argue that you should have a setup.py that installs as a library (that maybe no-one would normally use) and a separate script/process to build the standalone version.

    And I'd rather have an exe on Windows than a pyz (I've been converted!), so shipping pyz files just adds an extra step for me of building my own exe.

  3. Paul Moore reporter

    See https://bitbucket.org/pmoore/pyzzer (specifically commit https://bitbucket.org/pmoore/pyzzer/commits/b8b2460dfe8e385969112aa027c33d133d14feab)

    What I've done is add a --library option to setup.py. If present, pyzzer will be built as a library (conventional style site-packages install, with a pyzzer entry point). Otherwise the current behaviour will remain unchanged. The --library option needs setuptools for entry point support, and I also added a setup.cfg to denote that this will be a universal wheel in that case.

  4. Log in to comment