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
python cython


source to share


No one has answered this question yet

Check out similar questions:

5116
How can I check if a file exists without exceptions?
4268
How to combine two dictionaries in one expression?
3790
How can I safely create a subdirectory?
3474
How to list all files in a directory?
3428
How to sort a dictionary by value?
3235
How to check if a list is empty?
1806
How do I upgrade all Python packages using pip?
902
Why use pip over easy_install?
15
Specify the cython output file
1
cannot compile a simple Cython program



All Articles
Loading...
X
Show
Funny
Dev
Pics