Skip to content
master
Switch branches/tags
Code

Latest commit

* chore: bump pypa/gh-action-pypi-publish from v1.4.1 to v1.4.2

Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from v1.4.1 to v1.4.2.
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](pypa/gh-action-pypi-publish@v1.4.1...27b3170)

Signed-off-by: dependabot[bot] <support@github.com>

* ci: fix old version of virtualenv breaking things

Fixed in master in pypa/build

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
3574dd8

Git stats

Files

Permalink
Failed to load latest commit information.

python_example

Gitter

CI status
Linux/macOS Travis Travis-CI
MSVC 2015 AppVeyor
conda.recipe Conda Actions Status
pip builds Pip Actions Status
cibuildwheel Wheels Actions Status

An example project built with pybind11.

Installation

On Unix (Linux, OS X)

  • clone this repository
  • pip install ./python_example

On Windows (Requires Visual Studio 2015)

  • For Python 3.5+:

    • clone this repository
    • pip install ./python_example
  • For Python 2.7:

    Pybind11 requires a C++11 compliant compiler (i.e. Visual Studio 2015 on Windows). Running a regular pip install command will detect the version of the compiler used to build Python and attempt to build the extension with it. We must force the use of Visual Studio 2015.

    • clone this repository
    • "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" x64
    • set DISTUTILS_USE_SDK=1
    • set MSSdk=1
    • pip install ./python_example

    Note that this requires the user building python_example to have registry edition rights on the machine, to be able to run the vcvarsall.bat script.

CI Examples

There are examples for CI in .github/workflows. A simple way to produces binary "wheels" for all platforms is illustrated in the "wheels.yml" file, using cibuildwheel. You can also see a basic recipe for building and testing in pip.yml, and conda.yml has an example of a conda recipe build.

Windows Python 2.7 runtime requirements

On Windows, the Visual C++ 2015 redistributable packages are a runtime requirement for this project if you build for Python 2.7 (newer versions of Python include this redistributable). It can be found here.

Building the documentation

Documentation for the example project is generated using Sphinx. Sphinx has the ability to automatically inspect the signatures and documentation strings in the extension module to generate beautiful documentation in a variety formats. The following command generates HTML-based reference documentation; for other formats please refer to the Sphinx manual:

  • cd python_example/docs
  • make html

License

pybind11 is provided under a BSD-style license that can be found in the LICENSE file. By using, distributing, or contributing to this project, you agree to the terms and conditions of this license.

Test call

import python_example
python_example.add(1, 2)

About

Example pybind11 module built with a Python-based build system

Resources

License

Releases

No releases published

Packages

No packages published