Skip to content

go-python/setuptools-golang

Repository files navigation

Build Status Coverage Status

setuptools-golang

A setuptools extension for building cpython extensions written in golang.

Requirements

This requires golang >= 1.5. It is currently tested against 1.5 and 1.6.

This requires python >= 2.7. It is currently tested against 2.7, 3.4, 3.5, and pypy.

It is incompatible with pypy3 (for now) due to a lack of c-api.

Usage

Add setuptools-golang to the setup_requires in your setup.py and build_golang={'root': ...}. root refers to the root go import path of your project.

An extension must be a single file in the main go package (though the entire main package will be built into the extension). That package may import other code. You may have multiple extensions in your setup.py.

setup(
    ...
    build_golang={'root': 'github.com/user/project'},
    ext_modules=[Extension('example', ['example.go'])],
    setup_requires=['setuptools-golang'],
    ...
)

Writing cpython extensions in golang

TODO

About

A setuptools extension for building cpython extensions written in golang.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 58.9%
  • C 20.0%
  • Go 19.5%
  • Makefile 1.6%