Skip to main content

nuitka-setuptools

Extension to setuptools to run your package through nuitka to produce compiled, faster, obfuscated binary modules.

Nuitka [http://nuitka.net/pages/overview.html] is a python compiler with full language support and CPython compatibility.

It’s fully compatible with Python 2.6, 2.7, 3.2, 3.3, 3.4, 3.5, and 3.6.

You feed it your Python app, it does a lot of clever things, and spits out an executable or extension module.

This module provides some hooks to add to your python packages setup.py to automatically run some/all of your code through nuitka when building a binary dist. This will typically be done with python setup.py bdist_wheel to create a wheel for distribution.

With nuitka-setuptools this wheel can be devoid of pure python and only contain compiled code which is not only faster (quote: Nuitka is more than 2 times faster than CPython) but has a relatively high level of code security.

Basic Usage: setup.py:

import sys
from setuptools import setup

# Get the long description from the README file
with open(path.join(path.dirname(__file__), 'README.rst'), 'r') as f:
    long_description = f.read()

packages = ['mod', 'pkg']

if any('bdist' in arg for arg in sys.argv):
    from nuitka_setuptools import Nuitka, Compile

    build_settings = dict(
        # Compile module
        cmdclass={'build_ext': Nuitka},
        ext_modules=Compile(packages),
    )
else:
    build_settings = {}


setup(
    name='nuitka_setuptools',
    py_modules=['nuitka_setuptools'],
    description='Extension to setuptools to run your package through nuitka to '
                'produce compiled, faster, obfuscated binary modules.',
    long_description=long_description,
    author='Andrew Leech',
    author_email='andrew@alelec.net',
    url='https://gitlab.com/alelec/nuitka-setuptools',
    use_scm_version=True,
    include_package_data=True,
    install_requires=['setuptools_scm'],
    setup_requires=['setuptools_scm'],
    cmdclass={'build_ext': Nuitka},
    ext_modules=Compile(['nuitka_setuptools']),
    **build_settings
)

Release files for nuitka-setuptools 2.0

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

Source distribution (sdist)

Source distribution for nuitka-setuptools 2.0
File Size Uploaded
nuitka_setuptools-2.0.tar.gz 9.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nuitka-setuptools 2.0
File Interpreter ABI Platform
nuitka_setuptools-2.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size:15.5 kB

Release files / nuitka_setuptools-2.0.tar.gz

Download URL nuitka_setuptools-2.0.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3344ff0e8e0a5c9e36fd1574bbec19b4f1b97b5852221b08b03b2c3b573593be
BLAKE2b-256 checksum
How to use checksums
dcfc6fbf4aa3deeb2d17ab22b38ac7131f7e6a4707436c1b628253b38408ae50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / nuitka_setuptools-2.0-py2.py3-none-any.whl

Download URL nuitka_setuptools-2.0-py2.py3-none-any.whl
Size 6.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
8dca8848368ba9047df81f9bb23419c75dd20b17ffdbdea6af66c82c49cb2527
BLAKE2b-256 checksum
How to use checksums
36d7515b36d1abc731831b0c91ef0c5f216551108bc78d7a825febd9be353ce0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

2.0 This release

2 release files

1.1

2 release files

1.0

2 release files

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