Giter Club home page Giter Club logo

python_cpp_example's Introduction

python_cpp_example

This repository contains an example Python module which wraps C++ code. The code presented here was designed to meet four requirements:

  1. Python bindings for C++ code (using pybind11 and built with CMake)
  2. Unit tests for C++ code (using catch)
  3. Unit tests for Python code (using unittest)
  4. A setuptools setup.py script for building, installation, and testing

Please see the blog post that accompanies this repository for more information.

NOTE: If you'd like to see the version of the repository that corresponds to my original June 2017 blog post, go to this release. However, I no longer recommend using the repository structure from this old release.

Installation

To build and install python_cpp_example, clone or download this repository and then, from within the repository, run:

python3 ./setup.py install

or

pip3 install .

Tests

To execute all unit tests, run the following command:

python3 ./setup.py test

Requirements

  • Python 2 or 3
  • CMake 2.8.12 or higher
  • A modern compiler with C++11 support

Acknowledgements

Much of the code in this repository was adapted from the pybind11 tutorial and the pybind11 example CMake repository.

python_cpp_example's People

Contributors

benjaminjack avatar jcfr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

python_cpp_example's Issues

Must clone with submodules

You need to clone with submodules or else python setup.py install will not work.

git clone --recurse-submodules -j8 https://github.com/benjaminjack/python_cpp_example.git

maybe add this to the readme?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.