Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pybind11 and flake8 fixes #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

autosummary_generate = True

breathe_projects = { "python_cpp_example": "_build/doxygenxml/" }
breathe_projects = {"python_cpp_example": "_build/doxygenxml/"}
breathe_default_project = "python_cpp_example"
breathe_domain_by_extension = {'hpp': 'cpp'}

Expand Down Expand Up @@ -183,6 +183,3 @@ def generate_doxygen_xml(app):
def setup(app):
"""Add hook for building doxygen xml when needed"""
app.connect("builder-inited", generate_doxygen_xml)



2 changes: 1 addition & 1 deletion lib/pybind11
Submodule pybind11 updated 179 files
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
import os
import re
import sys
import sysconfig
import platform
import subprocess

from distutils.version import LooseVersion
from setuptools import setup, Extension, find_packages
from setuptools.command.build_ext import build_ext
from setuptools.command.test import test as TestCommand
from shutil import copyfile, copymode


Expand Down Expand Up @@ -100,7 +98,7 @@ def copy_test_file(self, src_file):
description='A hybrid Python/C++ test project',
long_description='',
packages=find_packages('src'),
package_dir={'':'src'},
package_dir={'': 'src'},
ext_modules=[CMakeExtension('python_cpp_example/python_cpp_example')],
cmdclass=dict(build_ext=CMakeBuild),
test_suite='tests',
Expand Down
10 changes: 4 additions & 6 deletions src/python_cpp_example/bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

namespace py = pybind11;

PYBIND11_PLUGIN(python_cpp_example) {
py::module m("python_cpp_example", R"doc(
PYBIND11_MODULE(python_cpp_example, m) {
m.doc() = R"doc(
Python module
-----------------------
.. currentmodule:: python_cpp_example
Expand All @@ -13,7 +13,7 @@ PYBIND11_PLUGIN(python_cpp_example) {

add
subtract
)doc");
)doc";

m.def("add", &add, R"doc(
Add two numbers
Expand All @@ -26,6 +26,4 @@ PYBIND11_PLUGIN(python_cpp_example) {

Some other information about the subtract function.
)doc");

return m.ptr();
}
}
2 changes: 1 addition & 1 deletion src/python_cpp_example/hello.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

def say_hello():
print("Hello world!")
print("Hello world!")
2 changes: 1 addition & 1 deletion tests/math_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ def test_subtract(self):
self.assertEqual(python_cpp_example.subtract(1, 1), 0)

if __name__ == '__main__':
unittest.main()
unittest.main()