Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6240f65

Browse files
committed
expanded readme
1 parente217a64 commit6240f65

File tree

2 files changed

+41
-6
lines changed

2 files changed

+41
-6
lines changed

‎README.md‎

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,41 @@
11
#python_cpp_example
22
This repository contains an example Python module which wraps C++ code. The code presented here was designed to meet four requirements:
33

4-
1. Python bindings for C++ code (using pybind11).
5-
2. Unit tests for C++ code (using Catch).
6-
3. Unit tests for Python code (using unittest).
7-
4. A setuptools setup.py script for building, installation, and testing.
4+
1. Python bindings for C++ code (using[`pybind11`](http://pybind11.readthedocs.io/en/stable/index.html) and built with[CMake](http://cmake.org))
5+
2. Unit tests for C++ code (using[`catch`](http://catch-lib.net))
6+
3. Unit tests for Python code (using`unittest`)
7+
4. A`setuptools` setup.py script for building, installation, and testing
8+
9+
Please see the[blog post that accompanies this repository]() for more information.
10+
11+
#Installation
12+
13+
To build and install`python_cpp_example` clone or download this repository and then, from within the repository, run:
14+
15+
```bash
16+
python3 ./setup.py install
17+
```
18+
19+
or
20+
21+
```bash
22+
pip3 install.
23+
```
24+
25+
#Tests
26+
27+
To execute all unit tests, run the following command:
28+
29+
```bash
30+
python3 ./setup.pytest
31+
```
32+
33+
#Requirements
34+
35+
- Python 2 or 3
36+
- CMake 2.8.12 or higher
37+
- A modern compiler with C++11 support
38+
39+
#Acknowledgements
40+
41+
Much of the code in this repository was adapted from the[`pybind11` tutorial](http://pybind11.readthedocs.io/en/stable/basics.html) and the[`pybind11` example CMake repository](https://github.com/pybind/cmake_example).

‎setup.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,10 @@ def run(self):
8484
super(CatchTestCommand,self).run()
8585
print("\nPython tests complete, now running C++ tests...\n")
8686
# Run catch tests
87-
subprocess.call(['./python_cpp_example_test'],
87+
subprocess.call(['./*_test'],
8888
cwd=os.path.join('build',
89-
self.distutils_dir_name('temp')))
89+
self.distutils_dir_name('temp')),
90+
shell=True)
9091

9192

9293
setup(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp