GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - olned/python_cpp_example: An example of a hybrid python/C++ package with unit tests

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

32 Commits
32 Commits

Folders and files

NameName
Last commit message
Last commit date
docs
docs
 
 
lib
lib
 
 
src/python_cpp_example
src/python_cpp_example
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
.gitmodules
.gitmodules
 
 
CMakeLists.txt
CMakeLists.txt
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
setup.py
setup.py
 
 

Repository files navigation

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.

About

An example of a hybrid python/C++ package with unit tests

www.benjack.io/2018/02/02/python-cpp-revisited.html

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.