Wenzel Jakob | 929fd7e | 2015-10-15 18:24:12 +0200 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | |
Dean Moldovan | a0c1ccf | 2016-08-12 13:50:00 +0200 | [diff] [blame] | 3 | # Setup script for PyPI; use CMakeFile.txt to build extension modules |
Wenzel Jakob | 929fd7e | 2015-10-15 18:24:12 +0200 | [diff] [blame] | 4 | |
| 5 | from setuptools import setup |
Wenzel Jakob | 4f972c0 | 2016-03-01 10:36:10 +0100 | [diff] [blame] | 6 | from pybind11 import __version__ |
Sylvain Corlay | d5ce82b | 2017-02-14 13:16:14 +0100 | [diff] [blame] | 7 | import os |
Wenzel Jakob | 929fd7e | 2015-10-15 18:24:12 +0200 | [diff] [blame] | 8 | |
Sylvain Corlay | d5ce82b | 2017-02-14 13:16:14 +0100 | [diff] [blame] | 9 | # Prevent installation of pybind11 headers by setting |
| 10 | # PYBIND11_USE_CMAKE. |
| 11 | if os.environ.get('PYBIND11_USE_CMAKE'): |
| 12 | headers = [] |
| 13 | else: |
| 14 | headers = [ |
Wenzel Jakob | 48548ea | 2016-01-17 22:36:44 +0100 | [diff] [blame] | 15 | 'include/pybind11/attr.h', |
Wenzel Jakob | 929fd7e | 2015-10-15 18:24:12 +0200 | [diff] [blame] | 16 | 'include/pybind11/cast.h', |
Alessandro Bacchini | 9f13a30 | 2016-12-01 15:22:17 +0100 | [diff] [blame] | 17 | 'include/pybind11/chrono.h', |
Dean Moldovan | c91f8bd | 2017-02-13 18:11:24 +0100 | [diff] [blame] | 18 | 'include/pybind11/class_support.h', |
Alessandro Bacchini | 9f13a30 | 2016-12-01 15:22:17 +0100 | [diff] [blame] | 19 | 'include/pybind11/common.h', |
Wenzel Jakob | 929fd7e | 2015-10-15 18:24:12 +0200 | [diff] [blame] | 20 | 'include/pybind11/complex.h', |
Wenzel Jakob | 678d787 | 2016-01-17 22:36:41 +0100 | [diff] [blame] | 21 | 'include/pybind11/descr.h', |
Wenzel Jakob | 9e0a056 | 2016-05-05 20:33:54 +0200 | [diff] [blame] | 22 | 'include/pybind11/eigen.h', |
Alessandro Bacchini | 9f13a30 | 2016-12-01 15:22:17 +0100 | [diff] [blame] | 23 | 'include/pybind11/eval.h', |
| 24 | 'include/pybind11/functional.h', |
Wenzel Jakob | 929fd7e | 2015-10-15 18:24:12 +0200 | [diff] [blame] | 25 | 'include/pybind11/numpy.h', |
Alessandro Bacchini | 9f13a30 | 2016-12-01 15:22:17 +0100 | [diff] [blame] | 26 | 'include/pybind11/operators.h', |
| 27 | 'include/pybind11/options.h', |
Wenzel Jakob | 929fd7e | 2015-10-15 18:24:12 +0200 | [diff] [blame] | 28 | 'include/pybind11/pybind11.h', |
Alessandro Bacchini | 9f13a30 | 2016-12-01 15:22:17 +0100 | [diff] [blame] | 29 | 'include/pybind11/pytypes.h', |
Wenzel Jakob | 929fd7e | 2015-10-15 18:24:12 +0200 | [diff] [blame] | 30 | 'include/pybind11/stl.h', |
Wenzel Jakob | 25c03ce | 2016-05-15 20:50:38 +0200 | [diff] [blame] | 31 | 'include/pybind11/stl_bind.h', |
Wenzel Jakob | 2723a38 | 2017-01-01 17:14:27 +0100 | [diff] [blame] | 32 | 'include/pybind11/typeid.h' |
Sylvain Corlay | d5ce82b | 2017-02-14 13:16:14 +0100 | [diff] [blame] | 33 | ] |
| 34 | |
| 35 | setup( |
| 36 | name='pybind11', |
| 37 | version=__version__, |
| 38 | description='Seamless operability between C++11 and Python', |
| 39 | author='Wenzel Jakob', |
| 40 | author_email='wenzel.jakob@epfl.ch', |
| 41 | url='https://github.com/wjakob/pybind11', |
| 42 | download_url='https://github.com/wjakob/pybind11/tarball/v' + __version__, |
| 43 | packages=['pybind11'], |
| 44 | license='BSD', |
| 45 | headers=headers, |
Wenzel Jakob | 929fd7e | 2015-10-15 18:24:12 +0200 | [diff] [blame] | 46 | classifiers=[ |
| 47 | 'Development Status :: 5 - Production/Stable', |
| 48 | 'Intended Audience :: Developers', |
| 49 | 'Topic :: Software Development :: Libraries :: Python Modules', |
| 50 | 'Topic :: Utilities', |
| 51 | 'Programming Language :: C++', |
| 52 | 'Programming Language :: Python :: 2.7', |
| 53 | 'Programming Language :: Python :: 3', |
| 54 | 'Programming Language :: Python :: 3.2', |
| 55 | 'Programming Language :: Python :: 3.3', |
| 56 | 'Programming Language :: Python :: 3.4', |
Wenzel Jakob | b456ec7 | 2015-10-15 22:43:55 +0200 | [diff] [blame] | 57 | 'Programming Language :: Python :: 3.5', |
Wenzel Jakob | 2723a38 | 2017-01-01 17:14:27 +0100 | [diff] [blame] | 58 | 'Programming Language :: Python :: 3.6', |
| 59 | 'License :: OSI Approved :: BSD License' |
Wenzel Jakob | 929fd7e | 2015-10-15 18:24:12 +0200 | [diff] [blame] | 60 | ], |
| 61 | keywords='C++11, Python bindings', |
Wenzel Jakob | 2723a38 | 2017-01-01 17:14:27 +0100 | [diff] [blame] | 62 | long_description="""pybind11 is a lightweight header-only library that |
| 63 | exposes C++ types in Python and vice versa, mainly to create Python bindings of |
Wenzel Jakob | 929fd7e | 2015-10-15 18:24:12 +0200 | [diff] [blame] | 64 | existing C++ code. Its goals and syntax are similar to the excellent |
Wenzel Jakob | 2723a38 | 2017-01-01 17:14:27 +0100 | [diff] [blame] | 65 | Boost.Python by David Abrahams: to minimize boilerplate code in traditional |
| 66 | extension modules by inferring type information using compile-time |
Wenzel Jakob | 929fd7e | 2015-10-15 18:24:12 +0200 | [diff] [blame] | 67 | introspection. |
| 68 | |
Wenzel Jakob | 0f294e2 | 2017-01-04 15:17:18 +0100 | [diff] [blame] | 69 | The main issue with Boost.Python-and the reason for creating such a similar |
| 70 | project-is Boost. Boost is an enormously large and complex suite of utility |
Wenzel Jakob | 929fd7e | 2015-10-15 18:24:12 +0200 | [diff] [blame] | 71 | libraries that works with almost every C++ compiler in existence. This |
| 72 | compatibility has its cost: arcane template tricks and workarounds are |
| 73 | necessary to support the oldest and buggiest of compiler specimens. Now that |
| 74 | C++11-compatible compilers are widely available, this heavy machinery has |
| 75 | become an excessively large and unnecessary dependency. |
| 76 | |
| 77 | Think of this library as a tiny self-contained version of Boost.Python with |
Wenzel Jakob | 48548ea | 2016-01-17 22:36:44 +0100 | [diff] [blame] | 78 | everything stripped away that isn't relevant for binding generation. Without |
Wenzel Jakob | 2723a38 | 2017-01-01 17:14:27 +0100 | [diff] [blame] | 79 | comments, the core header files only require ~4K lines of code and depend on |
| 80 | Python (2.7 or 3.x, or PyPy2.7 >= 5.7) and the C++ standard library. This |
| 81 | compact implementation was possible thanks to some of the new C++11 language |
| 82 | features (specifically: tuples, lambda functions and variadic templates). Since |
| 83 | its creation, this library has grown beyond Boost.Python in many ways, leading |
| 84 | to dramatically simpler binding code in many common situations.""") |