'Include Cython module in a Python package setup

I have a python package that includes a Cython part (see below a simplified version of the directory). But when I build my package, I cannot import the cython module. From what I could gather, I need some additional setup in my package but I can't figure it out.

package_name
    utils
        cython_module.c
    main.py

I have found some documentation here to do it with a setup.py file (see below). However, I am using a setup.cfg file to build the package. Is there a way to do the same thing with a cfg file or I need to have a setup.py?

from setuptools import Extension, setup

setup(
    ext_modules = [Extension("example", ["example.c"])]
)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source