Skip to main content

Helper package to resolve C/C++ header-only libraries for Python build with native extensions

Project description

PyPI version Build python

pybuild-header-dependency

pybuild-header-dependency is a helper package to resolve C/C++ header-only libraries for Python build with native extensions.

Why this project?

Are you developing a Python project with C/C++ extensions? You are likely to have some dependencies on C/C++ libraries. Managing C/C++ dependencies can be tricky in this case because setuptools, the standard build system for Python extension module, does not have a proper package management for C/C++ libraries.

In many cases, your C/C++ dependencies are header-only libraries. You need to then tell setuptools the path to the needed header files. Some header-only libraries, e.g. pybind11, are directly installable from PyPI and you can resolve the header location by calling the function get_include. This is however not universally applicable for all header-only libraries.

This project is a helper package aiming to facilitate the build process by automatically downloading the needed C/C++ header-only libraries and providing a include path to the build system (setuptools).

Alternatives to this project

pybind11 also provides a way to build C/C++ extensions using full cmake build system. In this way, all the C/C++ dependencies can be resolved in cmake. Please refer to their documentation. This project, however, aims at the developers using setuptools to build the extensions.

Installation

You rarely need to install it manually. If you do, you can directly install it from PyPI:

pip install pybuild-header-dependency

Usage

Build dependency

Get headers

Limitation

As the name of this project suggests, this project supports header-only C/C++ libraries. If you project depends on some static/dynamic libraries, you need to use a full build system like cmake.

The default way of downloading packages from GitLab/GitHub is based on releases.

License

This project is licensed under the BSD-3-Clause license, see LICENSE for details.

Licenses of the libraries

Each supported head-only library is licensed under its own terms. Please consult them individually.

Contribution

You are more than welcome to make contributions to this project. Please have a look at the pkg.json for some examples about how to add new packages. Also refer to boost.py for an example of custom sources.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page