Skip to content

Feature - Python_api wheels

Simon Ward requested to merge feature-python_api-build_wheels into master

Python libraries are often distributed via pypi.org, where users are used to just typing pip install xyz to obtain a library. On pypi libraries are often packaged as wheels, which are archives with name specifiers which say what platform/python version they are built for. For CFML to be more widely used, it is important that it is compatible with this install method. As it contains Fortran code, this has turned out to be non trivial.

This pull request introduces the setup.py file for python packaging and changes to Cmake to make it more universal. To build the library, simply call python setup.py bdist_wheel. Currently:

  • On Linux, building can be performed on the users system, however the manylinux docker image and the script Scripts/buildwheel.sh should be considered as the resulting package is linux distribution agnostic. The resulting wheel does not depend on python 3.x version
  • On OSX, The resulting wheel does not depend on python 3.x version but the python package delocate should be used to add the necessary libraries to the wheel.
  • On Windows things are not as easy. A package has to be built for each python version and the python package delvewheel should be used to add the necessary libraries to the wheel.

Example wheels and workflow can be found at https://github.com/easyScience/CFML_builder/actions/runs/1054660703 (Available 90 days from 22/07/2021)

Edited by Simon Ward

Merge request reports