Skip to main content

Python binding port for JSONSki

Project description

cmake_example for pybind11

Gitter

CI status
MSVC 2019 AppVeyor
conda.recipe Conda Actions Status
pip builds Pip Actions Status
cibuildwheel Wheels Actions Status

An example pybind11 module built with a CMake-based build system. This is useful for C++ codebases that have an existing CMake project structure. This is being replaced by scikit_build_example, which uses scikit-build-core, which is designed to allow Python packages to be driven from CMake without depending on setuptools. The approach here has some trade-offs not present in a pure setuptools build (see python_example) or scikit-build-core. Python 3.7+ required; see the commit history for older versions of Python.

Problems vs. scikit-build-core based example:

  • You have to manually copy fixes/additions when they get added to this example (like when Apple Silicon support was added)
  • Modern editable installs are not supported (scikit-build-core doesn't support them either yet, but probably will soon)
  • You are depending on setuptools, which can and will change
  • You are stuck with an all-or-nothing approach to adding cmake/ninja via wheels (scikit-build-core adds these only as needed, so it can be used on BSD, Cygwin, Pyodide, Android, etc)
  • You are stuck with whatever CMake ships with (scikit-build-core backports FindPython for you)

Prerequisites

  • A compiler with C++11 support
  • Pip 10+ or CMake >= 3.4 (or 3.14+ on Windows, which was the first version to support VS 2019)
  • Ninja or Pip 10+

Installation

Just clone this repository and pip install. Note the --recursive option which is needed for the pybind11 submodule:

git clone --recursive https://github.com/pybind/cmake_example.git
pip install ./cmake_example

With the setup.py file included in this example, the pip install command will invoke CMake and build the pybind11 module as specified in CMakeLists.txt.

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 cmake_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 cmake_example
cmake_example.add(1, 2)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

JSONSki-0.0.18.tar.gz (236.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

JSONSki-0.0.18-cp39-cp39-macosx_13_0_universal2.whl (73.1 kB view details)

Uploaded CPython 3.9macOS 13.0+ universal2 (ARM64, x86-64)

File details

Details for the file JSONSki-0.0.18.tar.gz.

File metadata

  • Download URL: JSONSki-0.0.18.tar.gz
  • Upload date:
  • Size: 236.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for JSONSki-0.0.18.tar.gz
Algorithm Hash digest
SHA256 ba9ef1fa68f424d56a41f84e82bdd13663dc08f44ca9f8ba20b3b3f76a666d21
MD5 26e9d56ca66bc940442566baf57ab49c
BLAKE2b-256 f62dc411958f58f9a120fac9b3de26ed5eaec14b1af0e822cc859dbae2abc0b8

See more details on using hashes here.

File details

Details for the file JSONSki-0.0.18-cp39-cp39-macosx_13_0_universal2.whl.

File metadata

File hashes

Hashes for JSONSki-0.0.18-cp39-cp39-macosx_13_0_universal2.whl
Algorithm Hash digest
SHA256 2c40e03ccaff7090d4858e3d16331b2dc314be89cd5c05707bc919b703d6dfec
MD5 6f03993b50ae9e9005674c0121b0bbcd
BLAKE2b-256 e11e4dd22bacd7b25d8cd43211fc30ad77b2d8ec92387d87df2c3ab26007f5dd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page