Skip to main content

Generate Python executable zip archive for each entry point from a wheel package.

Project description

whl2pyz

Generate Python executable zip archive for each entry point from wheel packages.

Installation

python3 -m pip install whl2pyz

Usage and Examples

Print usage:

$ whl2pyz --help
usage: whl2pyz [-h] [-w [WHEELS ...]] [-o OUTDIR] [-p PYTHON] [-c] [-x] [pip_args ...]

Generate Python executable zip archive for each entry point from wheel packages (requires pip module).

positional arguments:
  pip_args              Extra pip install arguments.

options:
  -h, --help            show this help message and exit
  -w [WHEELS ...], --wheels [WHEELS ...]
                        Install given wheels to the Python executable zip archive and use only entry points from [WHEEL].dist-info/entry_points.txt.
  -o OUTDIR, --outdir OUTDIR
                        The output directory where Python executable zip archives (.pyz) are generated (default is ./bin).
  -p PYTHON, --python PYTHON
                        The name of the Python interpreter to use (default: no shebang line). Use "/usr/bin/env python3" to make the application directly executable on POSIX
  -c, --compress        Compress files with the deflate method. Files are stored uncompressed by default.
  -x, --auto-extract    The Python executable zip archive will be extracted into a temporary directory and run on the file system to allow execution of binary packages including a C
                        extension.

Packaging nvitop in zip app:

$ whl2pyz -x -p "/usr/bin/env python3" -- nvitop
...
$ ./bin/nvitop.pyz
...

Packaging standalone (no backend) PyVISA in zip app:

$ whl2pyz -p "/usr/bin/env python3" -- pyvisa
...
$ ./bin/pyvisa-info.pyz 
Machine Details:
   Platform ID:    Linux-6.8.0-58-generic-x86_64-with-glibc2.35
   Processor:      x86_64

Python:
   Implementation: CPython
   Executable:     python3
   Version:        3.10.12
   Compiler:       GCC 11.4.0
   Architecture:   ('x86', 64)
   Build:          Feb  4 2025 14:57:36 (#main)
   Unicode:        UCS4

PyVISA Version: 1.15.0

Backends:
   ivi:
      Version: 1.15.0 (bundled with PyVISA)
      Binary library: Not found
$ ./bin/pyvisa-shell.pyz
...

Packaging PyVISA with PyVISA-py backend in zip app:

$ whl2pyz -p "/usr/bin/env python3" -- pyvisa pyvisa-py
...
$ ./bin/pyvisa-info.pyz 
Machine Details:
   Platform ID:    Linux-6.8.0-58-generic-x86_64-with-glibc2.35
   Processor:      x86_64

Python:
   Implementation: CPython
   Executable:     python3
   Version:        3.10.12
   Compiler:       GCC 11.4.0
   Architecture:   ('x86', 64)
   Build:          Feb  4 2025 14:57:36 (#main)
   Unicode:        UCS4

PyVISA Version: 1.15.0

Backends:
   ivi:
      Version: 1.15.0 (bundled with PyVISA)
      Binary library: Not found
   py:
      Version: 0.8.0
      TCPIP INSTR: Available 
         Resource discovery:
         - VXI-11: partial (psutil not installed)
         - hislip: disabled (zeroconf not installed)
      TCPIP SOCKET: Available 
      PRLGX_TCPIP INTFC: Available 
      GPIB INSTR: Available 
      ASRL INSTR:
         Please install PySerial (>=3.0) to use this resource type.
         No module named 'serial'
      USB INSTR:
         Please install PyUSB to use this resource type.
         No module named 'usb'
      USB RAW:
         Please install PyUSB to use this resource type.
         No module named 'usb'
      VICP INSTR:
         Please install PyVICP to use this resource type.
      PRLGX_ASRL INTFC:
         Please install PySerial (>=3.0) to use this resource type.
         No module named 'serial'
      GPIB INTFC:
         Please install linux-gpib (Linux) or gpib-ctypes (Windows, Linux) to use this resource type. Note that installing gpib-ctypes will give you access to a broader range of functionalities.
         No module named 'gpib'
$ ./bin/pyvisa-shell.pyz
...

Packaging PyVISA with PyVISA-py backend including optional dependencies in zip app:

$ whl2pyz -x -p "/usr/bin/env python3" -- pyvisa pyvisa-py[serial,usb,psutil,hislip-discovery]
...
$ ./bin/pyvisa-info.pyz 
Machine Details:
   Platform ID:    Linux-6.8.0-58-generic-x86_64-with-glibc2.35
   Processor:      x86_64

Python:
   Implementation: CPython
   Executable:     python3
   Version:        3.10.12
   Compiler:       GCC 11.4.0
   Architecture:   ('x86', 64)
   Build:          Feb  4 2025 14:57:36 (#main)
   Unicode:        UCS4

PyVISA Version: 1.15.0

Backends:
   ivi:
      Version: 1.15.0 (bundled with PyVISA)
      Binary library: Not found
   py:
      Version: 0.8.0
      ASRL INSTR: Available via PySerial (3.5)
      USB INSTR: Available via PyUSB (1.3.1). Backend: libusb1
      USB RAW: Available via PyUSB (1.3.1). Backend: libusb1
      TCPIP INSTR: Available 
         Resource discovery:
         - VXI-11: ok
         - hislip: ok
      TCPIP SOCKET: Available 
      PRLGX_TCPIP INTFC: Available 
      PRLGX_ASRL INTFC: Available via PySerial (3.5)
      GPIB INSTR: Available 
      VICP INSTR:
         Please install PyVICP to use this resource type.
      GPIB INTFC:
         Please install linux-gpib (Linux) or gpib-ctypes (Windows, Linux) to use this resource type. Note that installing gpib-ctypes will give you access to a broader range of functionalities.
         No module named 'gpib'
$ ./bin/pyvisa-shell.pyz
...

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

whl2pyz-0.0.5.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

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

whl2pyz-0.0.5-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file whl2pyz-0.0.5.tar.gz.

File metadata

  • Download URL: whl2pyz-0.0.5.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for whl2pyz-0.0.5.tar.gz
Algorithm Hash digest
SHA256 d10146dc438ee382e28c78e35146bb6ace2b2b4addef3123753cd0ee3b051161
MD5 d284287039d4fa95ae50d4fc106285d0
BLAKE2b-256 549ad7f3387d23dcd339033b809c3c4681cfb7ad2d12192c712ee7baa56634ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for whl2pyz-0.0.5.tar.gz:

Publisher: publish.yml on alexis-giraudet/whl2pyz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file whl2pyz-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: whl2pyz-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for whl2pyz-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 59203e84e65e4aafa9bd1336301270970c1ac4d7e020a2211903118adb8efde7
MD5 f22de32e494362cb3e46dc05ac2af995
BLAKE2b-256 9ebfcec720de64def843dcd8958659a655c8f1ff9d817309dd261e084434406d

See more details on using hashes here.

Provenance

The following attestation bundles were made for whl2pyz-0.0.5-py3-none-any.whl:

Publisher: publish.yml on alexis-giraudet/whl2pyz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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