Skip to main content

A small library for zipping Python application dependencies

Project description

This library can be used for zipping Python application dependencies.

This library uses the dllist library to discover required DLLs for dependencies.

Installation

This library can be installed using pip:

python -m pip install depzip

Usage

Here is a Python script showing how to use depzip to copy the dependencies of a Python application using matplotlib, numpy, and PySide6 into a file called bundle.zip:

import depzip

depzip.bundle(
    applications=[
        "pyside6-uic",
    ],
    modules=[
        "matplotlib.backends.backend_qtagg",
        "matplotlib.figure",
        "matplotlib.style",
        "matplotlib",
        "numpy",
        "PySide6.QtCore",
        "PySide6.QtGui",
        "PySide6.QtNetwork",
        "PySide6.QtUiTools",
        "PySide6.QtWidgets",
    ],
    includes=[
        "Lib\\site-packages\\matplotlib\\mpl-data",
        "Lib\\site-packages\\pyside6-uic",
        "Lib\\site-packages\\PySide6\\plugins\\platforms\\qwindows.dll",
        "Lib\\site-packages\\PySide6\\plugins\\styles\\qmodernwindowsstyle.dll",
        "Lib\\site-packages\\PySide6\\uic.exe",
    ],
    excludes=[
        "python.exe",
        "pythonw.exe",
    ],
    output="bundle.zip",
)

The source code of this script can be found in examples/bundle.py.

The provided executable file import.exe can be used to run a Python application. It starts Python and imports a module with the same name as the executable file. For example, to run a Python file named app.py, the executable file import.exe should be renamed to app.exe.

The applications parameter is a list of application names that is used to automatically copy import.exe to executable files with names in this list.

The source code of the executable file import.exe can be found in examples/import.c.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

depzip-0.1-py3-none-win_amd64.whl (18.0 kB view details)

Uploaded Python 3Windows x86-64

File details

Details for the file depzip-0.1-py3-none-win_amd64.whl.

File metadata

  • Download URL: depzip-0.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 18.0 kB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for depzip-0.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 2c8a0470b2bef3ae872a7f276794545b8ff897e795ce63bcbd594079d0b16706
MD5 6866be751655f18499239da17b953945
BLAKE2b-256 fdd8f55adf8495bd2b8d466d945af693cfea8dc2272d8aa972eba19b97b6d476

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