Skip to content

Latest commit

 

History

History
46 lines (30 loc) · 1.48 KB

README.md

File metadata and controls

46 lines (30 loc) · 1.48 KB

py_cppmodel

license issues pre-commit

py_cppmodel is a Python wrapper around clang's python bindings to generate a simple Python model of a C++ translation unit.

Limitations

Currently the environment variable PY_CPPMODEL_LIBCLANG_PATH must be defined to specify where libclang can be found. This may be fixed in the future.

Testing

To run the tests, run:

python3 -m venv .venv           # Create a Python virtual env.
source ./.venv/bin/activate     # Activate the virtual env for bash by source.

mypy *.py --check-untyped-defs  # Run mypy to check type hints.
unittest discover .             # Run tests.

Attribution

We've made considerable use of the following in putting this together:

Design of the python bindings is taken from clang's cindex.

Mistakes are our own.