[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Package containing C sources

Victor Porton <porton at narod.ru> writes:

> I am going to create a Python wrapper around a generally useful C library. 
> So the wrapper needs to contain some C code to glue them together.
> Can I upload a package containing C sources to PyPi?

You can.

This is documented in "https://docs.python.org/2/extending/building.html";
(for Python 2; likely, it works in the same way for Python 3).

Note: I use "setuptools" (a "distutils" extension)
rather than the base "distutils" -- essentially, because it facilitates
the inclusion of non Python files in a distribution.
I do not know whether the base "distutils" automatically includes
the sources of C extensions (likely it does); "setuptools" provides
a way to include everything under control of a versioning system
(which I rely upon to not miss important files).