GitXplorerGitXplorer
d

setuptools-cpp

public
12 stars
3 forks
2 issues

Commits

List of commits on branch master.
Verified
8aa3e1684004b2130f4a2c43fa1d913282cb1649

Add docs for use with poetry (#1)

ddmontagu committed 5 years ago
Verified
72d3d15bac31d6e697bcf69bfc0f14c9f651efcb

Merge pull request #2 from dmontagu/add-submodule-checkout

ddmontagu committed 5 years ago
Unverified
971f63ab55e5c352fa15b4680e9d1519fd79b446

Update actions

committed 5 years ago
Unverified
324f753932b0e150405d6684c7620f360b4c91c8

Update logos

committed 5 years ago
Unverified
d44d42391e14306010cc97edd0ccf813ff1de6b7

Initial commit.

committed 5 years ago

README

The README file for this repository.

setuptools-cpp

Simplified packaging for pybind11-based C++ extensions

Build Coverage Netlify status
Package version


Documentation: https://setuptools-cpp.davidmontague.xyz

Source Code: https://github.com/dmontagu/setuptools-cpp


Features

  • Pybind11Extension: For standard Pybind11 extensions from C++ source files
  • CMakeExtension: Useful for incorporating CMake-dependent libraries like CGAL
  • Poetry Compatibility: Easy to use with poetry's custom build system

Basic Usage

You can use the CMakeExtension or Pybind11Extension classes in your setup.py as follows:

from setuptools import setup

from setuptools_cpp import CMakeExtension, ExtensionBuilder, Pybind11Extension

ext_modules = [
    # A basic pybind11 extension in <project_root>/src/ext1:
    Pybind11Extension(
        "my_pkg.ext1", ["src/ext1/ext1.cpp"], include_dirs=["src/ext1/include"]
    ),
    # An extension with a custom <project_root>/src/ext2/CMakeLists.txt:
    CMakeExtension(f"my_pkg.ext2", sourcedir="src/ext2")
]

setup(
    name="my_pkg",
    version="0.1.0",
    packages=["my_pkg"],
    # ... other setup kwargs ...
    ext_modules=ext_modules,
    cmdclass=dict(build_ext=ExtensionBuilder),
    zip_safe=False,
)

You can then use standard setuptools commands like python setup.py install.

See the User Guide for more details.

Requirements

This package is intended for use with Python 3.6+.

Installation

pip install setuptools-cpp

License

This project is licensed under the terms of the MIT license.