From 8426e7bf2bf9c2d7ff0d53f8ed629f43c38a4964 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Thu, 27 Aug 2020 10:47:31 -0400 Subject: [PATCH 1/2] ci: only annotate linux for now --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 825631beae..1ebc9dc776 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,7 @@ on: jobs: standard: strategy: + fail-fast: false matrix: runs-on: [ubuntu-latest, windows-latest, macos-latest] arch: [x64] @@ -103,6 +104,7 @@ jobs: run: python -m pip install -r tests/requirements.txt --prefer-binary - name: Setup annotations + if: runner.os == 'Linux' run: python -m pip install pytest-github-actions-annotate-failures - name: Configure C++11 ${{ matrix.args }} From dc161ac25c0558a6e4089287065424e720c29451 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Tue, 8 Sep 2020 00:24:56 -0400 Subject: [PATCH 2/2] style: block some common mistakes --- .pre-commit-config.yaml | 8 ++++++++ docs/advanced/cast/eigen.rst | 2 +- docs/changelog.rst | 4 ++-- docs/faq.rst | 2 +- docs/upgrade.rst | 2 +- tests/test_numpy_vectorize.cpp | 2 +- 6 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a046c6fcfe..6863f4c495 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,6 +34,14 @@ repos: types: [file] files: (\.cmake|CMakeLists.txt)(.in)?$ +- repo: local + hooks: + - id: disallow-caps + name: Disallow improper capitalization + language: pygrep + entry: PyBind|Numpy|Cmake + exclude: .pre-commit-config.yaml + - repo: local hooks: - id: check-style diff --git a/docs/advanced/cast/eigen.rst b/docs/advanced/cast/eigen.rst index 59ba08c3c4..e01472d5ae 100644 --- a/docs/advanced/cast/eigen.rst +++ b/docs/advanced/cast/eigen.rst @@ -274,7 +274,7 @@ Vectors versus column/row matrices Eigen and numpy have fundamentally different notions of a vector. In Eigen, a vector is simply a matrix with the number of columns or rows set to 1 at -compile time (for a column vector or row vector, respectively). Numpy, in +compile time (for a column vector or row vector, respectively). NumPy, in contrast, has comparable 2-dimensional 1xN and Nx1 arrays, but *also* has 1-dimensional arrays of size N. diff --git a/docs/changelog.rst b/docs/changelog.rst index 461002e3fb..ca025f9d83 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -628,7 +628,7 @@ v2.2.0 (August 31, 2017) in reference cycles. `#856 `_. -* Numpy and buffer protocol related improvements: +* NumPy and buffer protocol related improvements: 1. Support for negative strides in Python buffer objects/numpy arrays. This required changing integers from unsigned to signed for the related C++ APIs. @@ -1359,7 +1359,7 @@ Happy Christmas! * Improved support for ``std::shared_ptr<>`` conversions * Initial support for ``std::set<>`` conversions * Fixed type resolution issue for types defined in a separate plugin module -* Cmake build system improvements +* CMake build system improvements * Factored out generic functionality to non-templated code (smaller code size) * Added a code size / compile time benchmark vs Boost.Python * Added an appveyor CI script diff --git a/docs/faq.rst b/docs/faq.rst index b68562910a..5f7866fa76 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -285,7 +285,7 @@ CMake code. Conflicts can arise, however, when using pybind11 in a project that Python detection in a system with several Python versions installed. This difference may cause inconsistencies and errors if *both* mechanisms are used in the same project. Consider the following -Cmake code executed in a system with Python 2.7 and 3.x installed: +CMake code executed in a system with Python 2.7 and 3.x installed: .. code-block:: cmake diff --git a/docs/upgrade.rst b/docs/upgrade.rst index 7c3f1c3280..894c65fdcb 100644 --- a/docs/upgrade.rst +++ b/docs/upgrade.rst @@ -32,7 +32,7 @@ something. The changes are: ``CMAKE_CXX_STANDARD=`` instead, or any other valid CMake CXX or CUDA standard selection method, like ``target_compile_features``. -* If you do not request a standard, PyBind11 targets will compile with the +* If you do not request a standard, pybind11 targets will compile with the compiler default, but not less than C++11, instead of forcing C++14 always. If you depend on the old behavior, please use ``set(CMAKE_CXX_STANDARD 14)`` instead. diff --git a/tests/test_numpy_vectorize.cpp b/tests/test_numpy_vectorize.cpp index a875a74b99..e76e462cbf 100644 --- a/tests/test_numpy_vectorize.cpp +++ b/tests/test_numpy_vectorize.cpp @@ -37,7 +37,7 @@ TEST_SUBMODULE(numpy_vectorize, m) { )); // test_type_selection - // Numpy function which only accepts specific data types + // NumPy function which only accepts specific data types m.def("selective_func", [](py::array_t) { return "Int branch taken."; }); m.def("selective_func", [](py::array_t) { return "Float branch taken."; }); m.def("selective_func", [](py::array_t, py::array::c_style>) { return "Complex float branch taken."; });