PyOxidizer a utility for packaging Python projects into executable files

PyOxidizer

A few days ago developers introduced the first version of the PyOxidizer utility, which is offered as a utility that can be used to package a Python project as a separate executable file, including the Python interpreter and all necessary libraries and resources.

Such files can be run in environments without the Python toolkit installed or regardless of the availability of the required version of Python.

PyOxidizer can also generate statically related executables that are not associated with the system libraries. The project code is written in the Rust language and is distributed under the MPL (Mozilla Public License) 2.0.

About PyOxidizer?

The project is based on the module of the same name for the Rust language, which allows you to embed a Python interpreter in Rust programs to run Python scripts on them.

PyOxidizer It has now gone beyond the plugin for Rust and is positioned as a tool available to a wider audience for building and distributing standalone Python packages.

PyOxidizer a utility that aims to solve the problem of how to distribute Python applications.

For those who do not need to distribute applications in the form of an executable file, PyOxidizer offers opportunities to generate suitable libraries to link with any application to embed the Python interpreter and the necessary set of extensions in them.

Python application distribution is generally considered an unsolved problem as Russel Keith-Magee identified code distribution as an existential threat to longevity, for Python. In his words, Python has never had a consistent history of how I give my code to someone else, especially if that other person is not a developer and just wants to use my application.

For end users, delivering a project in the form of a single executable file It greatly simplifies installation and eliminates the work of selecting dependencies, which is important, for example, for complex Python projects such as video editors.

While on the other hand for application developers, PyOxidizer enables them to save time organizing the delivery of an application without having to use different tools to create packages for different operating systems.

How does PyOxidizer work?

Using the proposed builds it also has a positive effect on performance: files generated in PyOxidizer run faster than using the Python system by removing imports and defining basic modules.

In PyOxidizer, modules are imported from memory (All built-in modules are immediately loaded into memory and then used without disk access). In testing, the application startup time with PyOxidizer is roughly halved.

From similar existing projects, it is possible to observe: PyInstaller (unpacks the file into a temporary directory and imports modules from it).

  • Py2exe (linked to Windows platform and requires multiple file distribution), py2app (linked to macOS)
  • Cx-freeze (requires separate dependency packaging), Shiv and PEX (form a zip package and require Python on the system)
  • Nuitka (compiles the code, not the embedded interpreter), pynsist (linked to Windows), PyRun (proprietary development without explanation of the principles of operation).

At the current stage of development, PyOxidizer has already implemented the main functionality to generate executable files for Windows, macOS, and Linux.

Of the far-reaching capabilities noted the absence of a standard compilation environment, the inability to generate a package in MSI, DMG and deb / rpm format, with project packaging problems involving complex extensions to the C language.

While the absence of instructions to support the release ("pyoxidizer add", "pyoxidizer analyze" and "pyoxidizer upgrade") and limited support for Terminfo and Readline, lack of support for versions other than Python 3.7, lack of support for resource compression, inability to cross compile.

Source: https://pyoxidizer.readthedocs.io


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.