/pyHelloExtension

Python extension with C library example

Primary LanguageCBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Hello World!

Minimal example demonstrating the production of python extinsion module using an external C library. It also demonstrate the automatic generation and uploading of the sdist and wheels for unix, Windows and MacOS.

The module contains a simple function that receive a string as argument and return a heap allocated string containing "hello " with the argument string appended, and a final !. For instance hello("Gérard") returns the string hello Gérard!.

The wheels are compiled only when a tag is uploaded starting with v. When the tag contains also -rc with a trailing release candidate digit (eg. v0.0.0-rc0), the built wheels is uploaded to test.PyPi, otherwise the built wheels is uploaded to PyPi.

To install the module, use the command python3 -m pip install hello_ext.

To use the module in python, do the following:

$python3
>>> import hello_ext
>>> hello_ext.hello('Gérard')
'hello Gérard!'