Skip to content

Shows how to implement context-aware APIs in different languages.

License

Notifications You must be signed in to change notification settings

dev-cafe/context-api-example

Repository files navigation

Build Status License

context-api-example

Shows how to implement and use context-aware APIs in C++, Fortran, and Python. Inspired by Armin Ronacher's "Beautiful Native Libraries".

Comments, contributions, and improvements are most welcome!

How to build and run this demo

Install Python dependencies

$ virtualenv venv
$ source venv/bin/activate
$ pip install -r requirements.txt

Configure and build the compiled code

$ mkdir build
$ cd build
$ cmake ..
$ make

Test the C++/Fortran interfaces

$ make test

Test the Python interface

$ ACCOUNT_LIBRARY_DIR=$PWD/build/lib ACCOUNT_INCLUDE_DIR=$PWD/account PYTHONPATH=$PWD pytest -vv test/test.py