Skip to content
Tech News
← Back to articles

Wrap Go binaries in Python wheels

read original get PyInstaller for Python packaging → more articles
Why This Matters

This tool streamlines the distribution of Go CLI programs by enabling developers to compile and package them as Python wheels, making it easier for consumers to install and use Go binaries across multiple platforms via pip or pipx. It bridges the gap between Go and Python ecosystems, enhancing cross-language interoperability and simplifying deployment workflows for developers and users alike.

Key Takeaways

Compile Go CLI programs into Python wheels.

This tool takes a Go module directory, cross-compiles it for multiple platforms, and produces properly-tagged Python wheels that can be installed via pip or pipx to get the Go binary on your PATH.

See Distributing Go binaries like sqlite-scanner through PyPI using go-to-wheel for background on this project.

Installation

pip install go-to-wheel # or pipx install go-to-wheel

Requires Go to be installed and available in your PATH.

Quick start

Build wheels for all platforms from a Go module:

go-to-wheel path/to/go-module

This will create wheels in a ./dist directory for Linux (glibc and musl), macOS (Intel and Apple Silicon), and Windows (amd64 and arm64).

... continue reading