Keaton flag in setup.py

I am starting to compile my Python 3 project with Cython, and I would like to know if it is possible to reduce the current current compilation workflow to one instruction.

This is my setup.py at the moment:

from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize

extensions = [
    Extension("v", ["version.py"]),
    Extension("*", ["lib/*.py"])
]

setup(
    name = "MyFirst App",
    ext_modules = cythonize(extensions),
)

And this is what I run from the shell to get my executables:

python3 setup.py build_ext --inplace
cython3 --embed -o main.c main.py
gcc -Os -I /usr/include/python3.5m -o main main.c -lpython3.5m -lpthread -lm -lutil -ldl

This whole process works very well, I would like to know if there is a way to insert the last two commands into the setup.py script.

thank

+4
source share

Source: https://habr.com/ru/post/1687772/


All Articles