Lines Matching +full:- +full:dpybind11_werror

12 question, it's essential that you submit a self-contained and minimal piece of
28 * Add tests for any new functionality and run the test suite (`cmake --build
29 build --target pytest`) to ensure that no existing features break.
30 * Please run [`pre-commit`][pre-commit] to check your code matches the
31 project style. (Note that `gawk` is required.) Use `pre-commit run
32 --all-files` before committing (or use installed-mode, check pre-commit docs)
39 pybind11 is provided under a BSD-style license that can be found in the
48 hereby grant the following license: a non-exclusive, royalty-free perpetual
60 python3 -m venv venv
62 pip install -r tests/requirements.txt
63 cmake -S . -B build -DDOWNLOAD_CATCH=ON -DDOWNLOAD_EIGEN=ON
64 cmake --build build -j4
74 * You can use `-DPYBIND11_FINDPYTHON=ON` to use FindPython on CMake 3.12+
75 * In classic mode, you may need to set `-DPYTHON_EXECUTABLE=/path/to/python`.
76 FindPython uses `-DPython_ROOT_DIR=/path/to` or
77 `-DPython_EXECUTABLE=/path/to/python`.
81 In CMake, configuration options are given with “-D”. Options are stored in the
83 build directory. Two selections are special - the generator, given with `-G`,
85 similar, or `-DCMAKE_CXX_COMPILER=`. Unlike the others, these cannot be changed
90 * `-DCMAKE_BUILD_TYPE`: Release, Debug, MinSizeRel, RelWithDebInfo
91 * `-DPYBIND11_FINDPYTHON=ON`: Use CMake 3.12+’s FindPython instead of the
93 * `-DPYBIND11_NOPYTHON=ON`: Disable all Python searching (disables tests)
94 * `-DBUILD_TESTING=ON`: Enable the tests
95 * `-DDOWNLOAD_CATCH=ON`: Download catch to build the C++ tests
96 * `-DOWNLOAD_EIGEN=ON`: Download Eigen for the NumPy tests
97 * `-DPYBIND11_INSTALL=ON/OFF`: Enable the install target (on by default for the
99 * `-DUSE_PYTHON_INSTALL_DIR=ON`: Try to install into the python dir
104 * Use `cmake --build build -v` to see the commands used to build the files.
105 * Use `cmake build -LH` to list the CMake options with help.
106 * Use `ccmake` if available to see a curses (terminal) gui, or `cmake-gui` for
108 * Use `cmake --build build -j12` to build with 12 cores (for example).
109 * Use `-G` and the name of a generator to use something different. `cmake
110 --help` lists the generators available.
111 - On Unix, setting `CMAKE_GENERATER=Ninja` in your environment will give
114 * You can use `-DCMAKE_EXPORT_COMPILE_COMMANDS=ON` to generate the `.json` file
123 cmake --build build --target check
126 `--target` can be spelled `-t` in CMake 3.15+. You can also run individual
135 `-DPYBIND11_TEST_OVERRIDE="test_callbacks.cpp;test_pickling.cpp"`. If this is
140 (see [`pytest` docs](https://docs.pytest.org/en/2.7.3/customize.html#adding-default-options)). As a…
143 env PYTEST_ADDOPTS="--capture=no --exitfirst" \
144 cmake --build build --target pytest
146 env PYTEST_ADDOPTS="-s -x" cmake --build build --target pytest
151 All formatting is handled by pre-commit.
157 python3 -m pip install pre-commit
160 brew install pre-commit
167 pre-commit run
169 pre-commit run --all-files
173 name, pre-commit):
176 pre-commit install
179 ### Clang-Format
181 As of v2.6.2, pybind11 ships with a [`clang-format`][clang-format]
183 `.clang-format`). Currently, formatting is NOT applied automatically, but
184 manually using `clang-format` for newly developed files is highly encouraged.
188 clang-format -style=file --dry-run some.cpp
194 clang-format -style=file -i some.cpp
197 Note that the `-style-file` option searches the parent directories for the
198 `.clang-format` file, i.e. the commands above can be run in any subdirectory
201 ### Clang-Tidy
203 [`clang-tidy`][clang-tidy] performs deeper static code analyses and is
204 more complex to run, compared to `clang-format`, but support for `clang-tidy`
205 is built into the pybind11 CMake configuration. To run `clang-tidy`, the
210 docker run --rm -v $PWD:/pybind11 -it silkeh/clang:10
211 apt-get update && apt-get install python3-dev python3-pytest
212 cmake -S pybind11/ -B build -DCMAKE_CXX_CLANG_TIDY="$(which clang-tidy);-fix"
213 cmake --build build
218 To run include what you use, install (`brew install include-what-you-use` on
222 cmake -S . -B build-iwyu -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE=$(which include-what-you-use)
223 cmake --build build
234 python3 -m venv venv
237 cmake -S . -B build-intel -DCMAKE_CXX_COMPILER=$(which icpc) -DDOWNLOAD_CATCH=ON -DDOWNLOAD_EIGEN=O…
243 docker run --rm -it -v $PWD:/pybind11 nvcr.io/hpc/pgi-compilers:ce
244 apt-get update && apt-get install -y python3-dev python3-pip python3-pytest
245 wget -qO- "https://cmake.org/files/v3.18/cmake-3.18.2-Linux-x86_64.tar.gz" | tar --strip-components…
246 cmake -S pybind11/ -B build
247 cmake --build build
269 and a `pybind11-global` package that can be included via `pybind11[global]` if
280 python3 -m pip install -e .
287 python3 -m pip install build
290 python3 -m build -s .
293 PYBIND11_GLOBAL_SDIST=1 python3 -m build -s .
322 can disable this with `--no-build-isolation` as long as you have CMake 3.15+
324 2. The environment variable `PYBIND11_GLOBAL_SDIST` is checked - if it is set
325 and truthy, this will be make the accessory `pybind11-global` package,
331 3. CMake is run with `-DCMAKE_INSTALL_PREIFX=pybind11`. Since the CMake install
352 [pre-commit]: https://pre-commit.com
353 [clang-format]: https://clang.llvm.org/docs/ClangFormat.html
354 [clang-tidy]: https://clang.llvm.org/extra/clang-tidy/
358 [using pull requests]: https://help.github.com/articles/using-pull-requests