Skip to content

ditwoo/cpp-for-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Wrappers for C++ code

Preparations

Please create sandbox environment where you can destroy everything practice.

If you have Anaconda you can clone base env:

conda create --name cpp_packages --clone base

Otherwise please check python docs about virtual envs.

Soo ... if you are conda user (like me) please do not forget to activate recentry created environment,
you can do this with the following command:

source activate cpp_packages

Building package and testing

To build a package you should do something like this:

python setup.py build_ext --inplace

Next good practice is to test your code.
The most pythonic way to do this is to write tests using PyTest or something similar.
To run tests you just need:

python -m pytest

This command will check test (or tests) directory and execute all files with test*.py pattern.

Some links

Series of blog posts about boost::python: