| 1 |
Metadata-Version: 1.1 |
| 2 |
Name: PyBindGen |
| 3 |
Version: 0.20.0 |
| 4 |
Summary: Python Bindings Generator |
| 5 |
Home-page: https://launchpad.net/pybindgen |
| 6 |
Author: Gustavo Carneiro |
| 7 |
Author-email: [email protected] |
| 8 |
License: UNKNOWN |
| 9 |
Description: About |
| 10 |
===== |
| 11 |
PyBindGen is (surprise!) a python bindings generator. The main features are: |
| 12 |
|
| 13 |
* Generates clean C or C++ code, nearly as readable as code written |
| 14 |
manually by a developer; |
| 15 |
* Generated code is self contained and does not require any external |
| 16 |
libraries or macros; after generating the python module only python |
| 17 |
header files are required, nothing else; |
| 18 |
* Does not require Boost.Python (no C++ template magic, also works in C); |
| 19 |
* The interface for code generation is a simple Python API, not some |
| 20 |
obscure interface definition language. Additionally PyBindGen can |
| 21 |
parse header files with gccxml, if gccxml and pygccxml are |
| 22 |
installed in the system (note: pygccxml has not been ported to Python 3 yet); |
| 23 |
* Can be easily extended with new type handlers; |
| 24 |
* Type handlers can allocate memory and register cleanup code to free; |
| 25 |
* Supports in, out, and inout parameters (e.g. with pointers or C++ references); |
| 26 |
* Supports multiple return values (e.g. due to out/inout parameters); |
| 27 |
* Supports wrapping of simple C++ classes; |
| 28 |
* Supports virtual methods in classes; |
| 29 |
* Supports reference counted classes and, to some extent, smart pointers; |
| 30 |
* Multiple inheritance; |
| 31 |
* Wrapping templated classes; |
| 32 |
|
| 33 |
Notable features NOT implemented: |
| 34 |
|
| 35 |
* Converting exceptions from Python to C++ (only from C++ to Python is currently supported); |
| 36 |
* Callbacks. |
| 37 |
|
| 38 |
Supported Python versions |
| 39 |
========================= |
| 40 |
|
| 41 |
See the `documentation <http://pybindgen.readthedocs.org/en/latest/tutorial/#supported-python-versions>`_. |
| 42 |
|
| 43 |
Installation |
| 44 |
============ |
| 45 |
|
| 46 |
NOTE: if checking out pybindgen from bazaar, do not forget to see the |
| 47 |
file HACKING for additional instructions. |
| 48 |
|
| 49 |
Before proceeding make sure the system requirements are met. PyBindGen requires: |
| 50 |
|
| 51 |
1. Python (http://www.python.org) |
| 52 |
2. Python development files (the `python-dev` package in Ubuntu/Debian, for example) |
| 53 |
3. A C/C++ Compilation tool-chain (`apt-get install build-essential`) |
| 54 |
4. (optional) GCCXML and `PyGCCXML <http://www.language-binding.net/pygccxml/download.html>`_ |
| 55 |
|
| 56 |
You can install PyBindGen using either the `setup.py` or WAF. Note: to |
| 57 |
be able to run all tests, which involve code generation, and |
| 58 |
subsequent compilation, you need to use WAF. |
| 59 |
|
| 60 |
Installation using setup.py: |
| 61 |
---------------------------- |
| 62 |
|
| 63 |
python setup.py install |
| 64 |
|
| 65 |
Installation using WAF |
| 66 |
---------------------- |
| 67 |
|
| 68 |
PyBindGen uses `WAF <http://code.google.com/p/waf/>`_ as main build system. |
| 69 |
However, WAF does not have to be previously installed, as it is |
| 70 |
shipped with PyBindGen in a single `waf` script. |
| 71 |
|
| 72 |
To install PyBindGen, issue the following commands (win32 users should omit the ./ prefix in commands): |
| 73 |
|
| 74 |
1. ./waf configure |
| 75 |
- optionally you may add the option --prefix /foo/bar. To select a non-defaul python version, use the PYTHON environment variable, e.g.:: |
| 76 |
|
| 77 |
PYTHON=/usr/bin/python2.4 ./waf configure |
| 78 |
|
| 79 |
2. ./waf |
| 80 |
- possible options: `-jN` for parallel build, `-p` for progress bar |
| 81 |
3. ./waf check |
| 82 |
- optional step, runs the unit tests |
| 83 |
4. ./waf --examples |
| 84 |
- optional step, compiles the examples |
| 85 |
5. ./waf install |
| 86 |
- may require sudo |
| 87 |
|
| 88 |
|
| 89 |
Windows specific notes |
| 90 |
---------------------- |
| 91 |
|
| 92 |
WAF concurrency bugs |
| 93 |
++++++++++++++++++++ |
| 94 |
|
| 95 |
|
| 96 |
WAF automatically detects the number of cores and tries to activate |
| 97 |
multiple build threads accordingly. However, this concurrency support |
| 98 |
appears to be buggy on Windows, therefore you should disable it with the |
| 99 |
-j1 option, if you have multiple CPUs: |
| 100 |
|
| 101 |
waf check -j1 |
| 102 |
|
| 103 |
Compiler selection |
| 104 |
++++++++++++++++++ |
| 105 |
|
| 106 |
Note that if you are compiling on win32, WAF will look for MSVC |
| 107 |
(MicroSoft Visual C) by default and give up on finding a C/C++ |
| 108 |
compiler if not found. If you do not have MSVC installed but instead |
| 109 |
have MinGW or CygWin GCC, you have to tell WAF to look for GCC in the |
| 110 |
configure stage: |
| 111 |
|
| 112 |
waf configure --check-c-compiler=gcc --check-cxx-compiler=g++ |
| 113 |
|
| 114 |
Installation |
| 115 |
++++++++++++ |
| 116 |
|
| 117 |
On win32, `waf install` installs to a Temp folder by default. To have |
| 118 |
it install for a certain Python version, use the --prefix option to |
| 119 |
waf configure. For instance: |
| 120 |
|
| 121 |
waf configure --prefix C:\Python26 |
| 122 |
waf install |
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
Installation failsafe |
| 127 |
--------------------- |
| 128 |
|
| 129 |
If by any chance you have trouble with WAF and are just looking to |
| 130 |
install PyBindGen, you should know that PyBindGen is entirely |
| 131 |
self-contained in the `pybindgen` directory. You can simply |
| 132 |
recursively copy the entire pybindgen folder into Python's |
| 133 |
site-packages directory, and that's it! PyBindGen is a pure Python |
| 134 |
package and does not actually require a C/C++ compiler; a C++ compiler is only |
| 135 |
used for code generation unit tests and compiling the example modules, and it is not needed to generate code. |
| 136 |
|
| 137 |
|
| 138 |
Documentation |
| 139 |
============= |
| 140 |
|
| 141 |
The following documentation is available: |
| 142 |
|
| 143 |
1. `API docs (with introductory tutorial) <http://pybindgen.readthedocs.org/en/latest/>`_ |
| 144 |
2. Many simple examples in the `examples` directory |
| 145 |
3. Advanced examples in the unit tests (`tests/`) |
| 146 |
4. The source code! |
| 147 |
|
| 148 |
.. image:: https://travis-ci.org/gjcarneiro/pybindgen.svg?branch=master |
| 149 |
:target: https://travis-ci.org/gjcarneiro/pybindgen |
| 150 |
|
| 151 |
|
| 152 |
Platform: UNKNOWN |
| 153 |
Classifier: Development Status :: 4 - Beta |
| 154 |
Classifier: Intended Audience :: Developers |
| 155 |
Classifier: Topic :: Software Development :: Build Tools |
| 156 |
Classifier: License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+) |
| 157 |
Classifier: Programming Language :: Python :: 2 |
| 158 |
Classifier: Programming Language :: Python :: 3 |