How to build a package of eggs with cython and c codes?

I have setup.py as below (other source files are also available)

from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext

ext_modules = [
    Extension("fastsim",
              ["src/fastsim.pyx", "src/selection.c"],
              libraries=["m"],)
]

setup(
    name="fastsimlib",
    cmdclass={"build_ext": build_ext},
    ext_modules=ext_modules
)

      

This works fine as long as cython is installed on the target machine. I am wondering if I can get rid of the cython dependency by creating an egg file so that I can run easy_install or pip.

To clarify, I want to create a distribution so that I can install the library on a machine that does not have cython installed. Or even better, can I only distribute the .so binary (so there is no cython or c code in the package)? The OS and other information about the target machine (Ubuntu) is indicated.

+3


source to share





All Articles