setuptools-golang
A setuptools extension for building cpython extensions written in golang.
What it is and what it does
setuptools-golang is a setuptools plugin that lets you write CPython extension modules in Go instead of C or C++. You define Go source files as extension modules in your setup.py, and the tool compiles them into native Python extensions using Go's cgo mechanism. It handles the build configuration, GOPATH management, and optional binary stripping to reduce extension size.
The package is primarily useful for teams that want to leverage Go's concurrency model, standard library, or existing Go codebases to accelerate performance-critical sections of Python applications. It also provides a tool for building manylinux wheels so end users can install pre-compiled extensions without needing a Go compiler. However, the project is now archived and no longer maintained, meaning new Python or Go versions may introduce incompatibilities that won't be fixed.
Use it for:
- Accelerate CPU-bound Python code by rewriting hot loops or algorithms in Go and exposing them as Python functions.
- Integrate existing Go libraries or services into Python applications without rewriting them in C or Python.
- Build and distribute pre-compiled manylinux wheels so Python users don't need Go or a C compiler installed.
- Prototype Go-based performance improvements to Python projects while keeping the public API in Python.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A setuptools extension that builds CPython extensions from Go source code, enabling developers to write performance-critical Python modules in Go and package them as standard Python extensions.
No—do not install for new projects. The package is archived and abandoned; no releases have been made since the latest release and the repository accepts no new contributions. While it works for existing projects already using it, starting a new Go-Python integration on this tool risks hitting unresolved bugs or incompatibilities with future Python or Go versions. Consider alternatives for new work.
Install
setuptools-golang on PyPI
pip
pip install setuptools-golanguv
uv add setuptools-golangpoetry
poetry add setuptools-golangInstalling setuptools-golang
Before you install
Low install friction with a single runtime dependency on setuptools. However, the project is archived and abandoned, with no releases for over a year, signaling that maintenance has ended and future compatibility issues may not be addressed.
License in practice
MIT license is permissive, allowing commercial and private use with minimal restrictions—you may use this in proprietary projects without obligation to share modifications.
Quickstart
# In setup.py:
from setuptools import setup, Extension
setup(
name='myproject',
build_golang={'root': 'github.com/user/project'},
ext_modules=[Extension('example', ['example.go'])],
setup_requires=['setuptools-golang'],
)
# Then: pip install .
Requires Go >= 1.5 installed on the build system; Python >= 3.8 required; supported on Linux, macOS, and win32.
Verify before relying
- Whether the archived repository will receive security patches or compatibility fixes for future Python or Go releases.
- Current real-world usage and whether the Go cgo/CPython API integration remains stable with modern Go and Python versions.
- Compatibility with PyPy3 given the abandoned maintenance status.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — setuptools |
| Maintenance | abandoned — 1,112 days since the last release |
| Last repo commit | (repository archived) |
| First released | |
| Downloads | 1,375,874/month — #3,987 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: setuptools_golang-2.9.0-py2.py3-none-any.whl
Tags
More Build Tools packages
Provides reusable utilities for Python…
permissive · top 100 on PyPI
tqdmWraps any iterable to display a real-time…
copyleft · top 100 on PyPI
pippip is the standard installer for Python…
permissive · top 100 on PyPI
hatchlingHatchling is a standards-compliant Python build…
permissive · top 100 on PyPI
grpcio-toolsGenerates Python gRPC service stubs and message…
permissive · top 1,000 on PyPI
pre-commitpre-commit is a framework for installing and…
permissive · top 1,000 on PyPI
manygoConverts Golang platform identifiers (GOOS and…
permissive · top 15,000 on PyPI
setuptools-gitA setuptools plugin that automatically includes…
permissive · top 15,000 on PyPI
setuptools-dsosetuptools_dso is a setuptools plugin that…
permissive · top 15,000 on PyPI
setuptools-protobufA setuptools plugin that automates compilation…
permissive · top 15,000 on PyPI
setuptools-git-versioningAutomatically generates PEP 440-compliant…
permissive · top 5,000 on PyPI
dockerfileParses Dockerfile syntax into structured Python…
permissive · top 15,000 on PyPI
extension-helpersProvides build helpers and utilities for Python…
permissive · top 5,000 on PyPI
setuptools-odooSetuptools-odoo automates packaging of Odoo…
copyleft · top 15,000 on PyPI
readthedocs-sphinx-extProvides Sphinx extensions that integrate…
permissive · top 15,000 on PyPI