Python/C++ Bob Extension Building Support
This package provides a pkg-config bridge for Python/C++ extensions for Bob. You use this package by including it in the setup_requires field of your setup.py file.
Building with zc.buildout is possible using the develop recipe in xbob.buildout. Follow the instructions described on that package for this recipe.
Preparing for C++ Compilation
Creating C++/Python bindings should be trivial. Firstly, edit your setup.py so that you include the following:
from xbob.extension import Extension
...
setup(
name="xbob.myext",
version="1.0.0",
...
setup_requires=[
'xbob.extension',
],
...
ext_modules=[
Extension("xbob.myext._myext",
[
"xbob/myext/ext/file1.cpp",
"xbob/myext/ext/file2.cpp",
"xbob/myext/ext/main.cpp",
],
pkgconfig = [ #bob modules you depend on
'bob-math',
'bob-sp',
],
include_dirs = [ #optionally, include directories
"xbob/myext/ext/headers/",
],
),
... #add more extensions if you wish
],
...
)
These modifications will allow you to compile extensions that are linked against the named pkg-config modules. You can specify the modules of Bob you want to link against. You don’t have to specify bob-python, which is automatically added. Furthermore, you can specify any pkg-config module and that will be linked in (for example, opencv). Other modules and options can be set manually using the standard options for python extensions. To hook-in the building on the package through zc.buildout, add the following section to your buildout.cfg:
[xbob.myext] recipe = xbob.buildout:develop
If you need to build multiple eggs, you will need one entry per project on your buildout.cfg. This includes, possibly, dependent projects. Currently, zc.buildout ignores the setup_requires entry on your setup.py file. The recipe above creates a new interpreter that hooks that package in and builds the project considering variables like prefixes into consideration.
Metadata
Release files for xbob.extension 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| xbob.extension-0.2.1.zip | 9.7 kB | Without provenance | Details for xbob.extension-0.2.1.zip |
Release files / xbob.extension-0.2.1.zip
| Download URL | xbob.extension-0.2.1.zip |
|---|---|
| Size | 9.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f8502e63e1319e7aa1215cf21c375adb2a2d7d6ab25a4cec0f68f82f208f69c3
|
|
BLAKE2b-256 checksum How to use checksums |
6aa8166f53154cfe8619157f0e5b871570643b48be1004401b94ca0abec3708f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for xbob.extension 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.