setup.py revision 12037
111986Sandreas.sandberg@arm.com#!/usr/bin/env python
211986Sandreas.sandberg@arm.com
311986Sandreas.sandberg@arm.com# Setup script for PyPI; use CMakeFile.txt to build extension modules
411986Sandreas.sandberg@arm.com
511986Sandreas.sandberg@arm.comfrom setuptools import setup
611986Sandreas.sandberg@arm.comfrom pybind11 import __version__
712037Sandreas.sandberg@arm.comimport os
811986Sandreas.sandberg@arm.com
912037Sandreas.sandberg@arm.com# Prevent installation of pybind11 headers by setting
1012037Sandreas.sandberg@arm.com# PYBIND11_USE_CMAKE.
1112037Sandreas.sandberg@arm.comif os.environ.get('PYBIND11_USE_CMAKE'):
1212037Sandreas.sandberg@arm.com    headers = []
1312037Sandreas.sandberg@arm.comelse:
1412037Sandreas.sandberg@arm.com    headers = [
1511986Sandreas.sandberg@arm.com        'include/pybind11/attr.h',
1611986Sandreas.sandberg@arm.com        'include/pybind11/cast.h',
1711986Sandreas.sandberg@arm.com        'include/pybind11/chrono.h',
1812037Sandreas.sandberg@arm.com        'include/pybind11/class_support.h',
1911986Sandreas.sandberg@arm.com        'include/pybind11/common.h',
2011986Sandreas.sandberg@arm.com        'include/pybind11/complex.h',
2111986Sandreas.sandberg@arm.com        'include/pybind11/descr.h',
2211986Sandreas.sandberg@arm.com        'include/pybind11/eigen.h',
2311986Sandreas.sandberg@arm.com        'include/pybind11/eval.h',
2411986Sandreas.sandberg@arm.com        'include/pybind11/functional.h',
2511986Sandreas.sandberg@arm.com        'include/pybind11/numpy.h',
2611986Sandreas.sandberg@arm.com        'include/pybind11/operators.h',
2711986Sandreas.sandberg@arm.com        'include/pybind11/options.h',
2811986Sandreas.sandberg@arm.com        'include/pybind11/pybind11.h',
2911986Sandreas.sandberg@arm.com        'include/pybind11/pytypes.h',
3011986Sandreas.sandberg@arm.com        'include/pybind11/stl.h',
3111986Sandreas.sandberg@arm.com        'include/pybind11/stl_bind.h',
3212037Sandreas.sandberg@arm.com        'include/pybind11/typeid.h'
3312037Sandreas.sandberg@arm.com    ]
3412037Sandreas.sandberg@arm.com
3512037Sandreas.sandberg@arm.comsetup(
3612037Sandreas.sandberg@arm.com    name='pybind11',
3712037Sandreas.sandberg@arm.com    version=__version__,
3812037Sandreas.sandberg@arm.com    description='Seamless operability between C++11 and Python',
3912037Sandreas.sandberg@arm.com    author='Wenzel Jakob',
4012037Sandreas.sandberg@arm.com    author_email='wenzel.jakob@epfl.ch',
4112037Sandreas.sandberg@arm.com    url='https://github.com/wjakob/pybind11',
4212037Sandreas.sandberg@arm.com    download_url='https://github.com/wjakob/pybind11/tarball/v' + __version__,
4312037Sandreas.sandberg@arm.com    packages=['pybind11'],
4412037Sandreas.sandberg@arm.com    license='BSD',
4512037Sandreas.sandberg@arm.com    headers=headers,
4611986Sandreas.sandberg@arm.com    classifiers=[
4711986Sandreas.sandberg@arm.com        'Development Status :: 5 - Production/Stable',
4811986Sandreas.sandberg@arm.com        'Intended Audience :: Developers',
4911986Sandreas.sandberg@arm.com        'Topic :: Software Development :: Libraries :: Python Modules',
5011986Sandreas.sandberg@arm.com        'Topic :: Utilities',
5111986Sandreas.sandberg@arm.com        'Programming Language :: C++',
5211986Sandreas.sandberg@arm.com        'Programming Language :: Python :: 2.7',
5311986Sandreas.sandberg@arm.com        'Programming Language :: Python :: 3',
5411986Sandreas.sandberg@arm.com        'Programming Language :: Python :: 3.2',
5511986Sandreas.sandberg@arm.com        'Programming Language :: Python :: 3.3',
5611986Sandreas.sandberg@arm.com        'Programming Language :: Python :: 3.4',
5711986Sandreas.sandberg@arm.com        'Programming Language :: Python :: 3.5',
5812037Sandreas.sandberg@arm.com        'Programming Language :: Python :: 3.6',
5912037Sandreas.sandberg@arm.com        'License :: OSI Approved :: BSD License'
6011986Sandreas.sandberg@arm.com    ],
6111986Sandreas.sandberg@arm.com    keywords='C++11, Python bindings',
6212037Sandreas.sandberg@arm.com    long_description="""pybind11 is a lightweight header-only library that
6312037Sandreas.sandberg@arm.comexposes C++ types in Python and vice versa, mainly to create Python bindings of
6411986Sandreas.sandberg@arm.comexisting C++ code. Its goals and syntax are similar to the excellent
6512037Sandreas.sandberg@arm.comBoost.Python by David Abrahams: to minimize boilerplate code in traditional
6612037Sandreas.sandberg@arm.comextension modules by inferring type information using compile-time
6711986Sandreas.sandberg@arm.comintrospection.
6811986Sandreas.sandberg@arm.com
6911986Sandreas.sandberg@arm.comThe main issue with Boost.Python-and the reason for creating such a similar
7011986Sandreas.sandberg@arm.comproject-is Boost. Boost is an enormously large and complex suite of utility
7111986Sandreas.sandberg@arm.comlibraries that works with almost every C++ compiler in existence. This
7211986Sandreas.sandberg@arm.comcompatibility has its cost: arcane template tricks and workarounds are
7311986Sandreas.sandberg@arm.comnecessary to support the oldest and buggiest of compiler specimens. Now that
7411986Sandreas.sandberg@arm.comC++11-compatible compilers are widely available, this heavy machinery has
7511986Sandreas.sandberg@arm.combecome an excessively large and unnecessary dependency.
7611986Sandreas.sandberg@arm.com
7711986Sandreas.sandberg@arm.comThink of this library as a tiny self-contained version of Boost.Python with
7811986Sandreas.sandberg@arm.comeverything stripped away that isn't relevant for binding generation. Without
7912037Sandreas.sandberg@arm.comcomments, the core header files only require ~4K lines of code and depend on
8012037Sandreas.sandberg@arm.comPython (2.7 or 3.x, or PyPy2.7 >= 5.7) and the C++ standard library. This
8112037Sandreas.sandberg@arm.comcompact implementation was possible thanks to some of the new C++11 language
8212037Sandreas.sandberg@arm.comfeatures (specifically: tuples, lambda functions and variadic templates). Since
8312037Sandreas.sandberg@arm.comits creation, this library has grown beyond Boost.Python in many ways, leading
8412037Sandreas.sandberg@arm.comto dramatically simpler binding code in many common situations.""")
85