Skip to main content

Codacy Badge build status Codecov

What is Subzero?

The goal of subzero is to allow simple and rapid deployment of frozen Python applications with minimal additional effort and developer time. In contrast to other solutions, subzero’s philosophy is that having a working application, quickly is more important than optimizing for size or other factors and that generating your end product (be it an MSI, or other installer) should take only a few minutes to set up. Subzero builds on the extensive development work of other projects, and doesn’t re-invent the wheel. Rather, it ties everything together in a simple and intuitive manner.

How do I use it?

In your setup file, replace the default setup import with the followng:

from subzero import setup, Executable

Then run the following command:

python setup.py bdist_msi

Subzero will the build executables specified in the entry_points and scripts sections and then create an installer that contains those executables.

Example

setup(
    name='Name',
    author='Author',
    packages=find_packages(),
    version=versioneer.get_version(),
    cmdclass=versioneer.get_cmdclass(),
    install_requires=[
        'paramiko',
    ],
    entry_points={
        'gui_scripts': [
            Executable(
                    'gui = app.__main__:gui',
                    icon_file='Icon.ico'),
        ],
        'console_scripts': [
            'console = app.__main__:console',
        ],
    },
    options={
        'build_exe': {
            'pathex':
            [os.path.join(os.path.dirname(PyQt5.__file__), 'Qt', 'bin')],
            'datas':
            [datafile, '.')],
        },
        'bdist_msi': {
            'upgrade_code': '84b31ed7-3985-46ad-9d07-eb4140a6d44a',
            'shortcuts': ['My Program = gui'],
            'wix_template_dir': os.path.abspath('./wix_templates'),
        }
    })

Options are applied first globally from the options dictionary passed to setup, and then for each executable if the Executable class is present for that particular entry_point or script.

The full array of options for build_exe is available in the PyInstaller documentation. Providing an upgrade code is strongly recommended for the bdist_msi command. A license agreement will be added to the installer if there is a license text file in the same directory as setup.py.

Extended import discovery (In beta)

In case PyInstaller cannot discover all of your dependencies, you can set optimize_imports=False, as shown below. This option may discover certain imports previously not found but it may also make your application larger. Note that you must add your package requirements in install_requires for this option to work!

'build_exe': {
    'optimize_imports': False
},

Cython

Cython modules can also be built because Subzero executes the builtin build command before calling PyInstaller. Just add your modules to the ext_modules key:

from setuptools import find_packages, Extension
from subzero import setup

setup(
    name='hello_world',
    ext_modules=[
        Extension(
            'my_module',
            sources=['my_module.pyx'],
        )
    ])

Metadata

Release files for subzero 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for subzero 0.2.4
File Size Uploaded Provenance Actions
subzero-0.2.4.tar.gz 86.5 kB Without provenance Details for subzero-0.2.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for subzero 0.2.4
File Interpreter ABI Platform Actions
subzero-0.2.4-py3-none-any.whl Python 3 none any Details for subzero-0.2.4-py3-none-any.whl

Total release size: 100.6 kB

Release files / subzero-0.2.4.tar.gz

Download URL subzero-0.2.4.tar.gz
Size 86.5 kB
Tags Source
SHA-256 checksum
How to use checksums
bb80396f782119b81494d7f7c23b5b54a4cf832323ea051567f36973a7663e68
BLAKE2b-256 checksum
How to use checksums
8a3cf3d3a0fef98d1c3b63fb22ca0cbc3c6f42194ad124dfc8d50f2f2d83959c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / subzero-0.2.4-py3-none-any.whl

Download URL subzero-0.2.4-py3-none-any.whl
Size 14.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
97f635abd25cc020c631c30acd8bf408f5b6518f2879076db3c9fc7b58de4668
BLAKE2b-256 checksum
How to use checksums
8d61da73e7caa1201fd3c9a0d7a09c7b7f03f787c5b95cacca0ec1fdd30eb656
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for subzero 0.2.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page