Skip to main content

Binary orchestrator for Python packages

Project description

Smelt

Smelt is python tool that aims to simplify greatly shipping native code from Python projects. This notably covers:

  • Providing a fully standalone way to compile native code in Python project without any system dependency.
  • Cross-compiling Python C extensions
  • Combining multiple tools building or providing native code in Python projects (e.g., mypyc, nuitka, local C/Zig extensions)
  • Providing a single high-level interface to automate binary builds, either for platform-specific wheels or even for standalone fully compiled binary Python projects.

Status

Smelt is currently under construction and is not ready-for-use -yet.

Why Smelt

One usual headache with Python is to distribute the software. As an interpreted language, Python has some limitations compared to other compiled languages - first because shipping your Python code requires an interpreter on the target machine, and second because the whole nature of the language makes obfuscation difficult - which is a problem for close-source projects. For the first problem, one simple solution is to ship an entire interpret toegether with the project, in order to make it a standalone binary. That's what a tool like PyInstaller does. It has limitations though:

  • It tends to produced bloated binaries, as the entire interpreter is shipped, even though only a tiny part of the standard library might be used by the shipped project
  • It does not obfuscate anything, as the source code is shipped directly; even if one were to only shipped the compiled .pyc files, theses ones still leak most of the information if it has not been pre-processed by tools such as PyArmor.

As a consequence, it's not uncommon to see Python-to-C transpilers such as Nuitka being used the sake of obfuscating, or to produce less bloated binaries. Transpiling to C actually allows eliminating dead code and also provides actual obfuscation - but it also makes the platform specific part more complex; as now the whole project needs to be compiled to the target platform - whereas methods based on interpreter building only have to bundle a pre-built interpreter binary for the target platform, the pure Python code itself being portable.
Another dimension to that problem appears when one start using native code in their Python project- Native code being usually some kind of C extension (or other languages such as Rust or Zig). That native code also needs to be built per platform - even when an interpeter is already available on the target host. Packages that have native code will be built to platform-specific wheels; for major libraries, these wheels are usually pre-built and uploaded to the PyPi index, which means you often don't have to deal with that as a user of the library. However, for smaller projects (or closed-source ones) that might not a complex multi-platform build pipeline, people installing the library might have to compile the project locally. Compiling the native code usually implies dependency on the host system (at least a C compiler !), which might not be met all the times.
Add to that that are now multiple tools that can provide native code in Python projects: standard C extensions, Rust extensions, mypyc compiled modules, nuitka-compiled modules, etc. These tools all have independant build tools and pipelines, which are themselves covered by multiple layers of abstraction in the Python build backend. That makes handling cross-platform distrubution (and even single-platform ones!) largely more complex that they would on a compiled programming language.

Smelt aims to solve these problems with 4 axes:

  • Making native code building completely self-contained by removing system dependency (such as C compiler) out of the equation, thus making a simple pip install ... enough to install your package with native code.
  • Orchestrating the aforementioned native code solutions under one single interface, to allow automating the building of complex projects from a simple config file.
  • Providing a self-contained cross-compiling solution for native code within Python projects, which is for now largely absent from the Python ecosystem.
  • Providing standalone binary builds (=a single exe for an entire Python application) as a first-class citizen - with all the features mentioned in the bullet points above.

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

smelt-0.4.1.tar.gz (63.5 kB view details)

Uploaded Source

Built Distribution

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

smelt-0.4.1-py3-none-any.whl (53.1 kB view details)

Uploaded Python 3

File details

Details for the file smelt-0.4.1.tar.gz.

File metadata

  • Download URL: smelt-0.4.1.tar.gz
  • Upload date:
  • Size: 63.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for smelt-0.4.1.tar.gz
Algorithm Hash digest
SHA256 0f60bb82fd0709342be201cd5c6f105918538fa9ddeacb1573e0662fc7b429b0
MD5 0af1f814f8fb9df9aa859d20cff61e8f
BLAKE2b-256 299dfa5c4f23692fff172f926b4bfdc1d2ec420976572520b2926fd8266acabc

See more details on using hashes here.

Provenance

The following attestation bundles were made for smelt-0.4.1.tar.gz:

Publisher: publish-to-pypi.yml on Hedwyn/smelt

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

File details

Details for the file smelt-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: smelt-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 53.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for smelt-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e639ef907e4fdd9a949a3c7d92b219302ac9d0d641501962c243978d07984d3d
MD5 3d98c3e9a8634fb2d97389935c7583eb
BLAKE2b-256 74187d314daa21aa28a72597585b115a651b1d5047ce2454451e08ef2d9b0ea1

See more details on using hashes here.

Provenance

The following attestation bundles were made for smelt-0.4.1-py3-none-any.whl:

Publisher: publish-to-pypi.yml on Hedwyn/smelt

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