mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-22 05:05:11 +00:00
ci: disallow some common capitalization mistakes (#2472)
* ci: only annotate linux for now * style: block some common mistakes
This commit is contained in:
parent
064a03a49b
commit
37f845a1dc
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -12,6 +12,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
standard:
|
standard:
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
runs-on: [ubuntu-latest, windows-latest, macos-latest]
|
runs-on: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
arch: [x64]
|
arch: [x64]
|
||||||
@ -103,6 +104,7 @@ jobs:
|
|||||||
run: python -m pip install -r tests/requirements.txt --prefer-binary
|
run: python -m pip install -r tests/requirements.txt --prefer-binary
|
||||||
|
|
||||||
- name: Setup annotations
|
- name: Setup annotations
|
||||||
|
if: runner.os == 'Linux'
|
||||||
run: python -m pip install pytest-github-actions-annotate-failures
|
run: python -m pip install pytest-github-actions-annotate-failures
|
||||||
|
|
||||||
- name: Configure C++11 ${{ matrix.args }}
|
- name: Configure C++11 ${{ matrix.args }}
|
||||||
|
@ -34,6 +34,14 @@ repos:
|
|||||||
types: [file]
|
types: [file]
|
||||||
files: (\.cmake|CMakeLists.txt)(.in)?$
|
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
|
- repo: local
|
||||||
hooks:
|
hooks:
|
||||||
- id: check-style
|
- id: check-style
|
||||||
|
@ -274,7 +274,7 @@ Vectors versus column/row matrices
|
|||||||
|
|
||||||
Eigen and numpy have fundamentally different notions of a vector. In Eigen, a
|
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
|
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
|
contrast, has comparable 2-dimensional 1xN and Nx1 arrays, but *also* has
|
||||||
1-dimensional arrays of size N.
|
1-dimensional arrays of size N.
|
||||||
|
|
||||||
|
@ -628,7 +628,7 @@ v2.2.0 (August 31, 2017)
|
|||||||
in reference cycles.
|
in reference cycles.
|
||||||
`#856 <https://github.com/pybind/pybind11/pull/856>`_.
|
`#856 <https://github.com/pybind/pybind11/pull/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
|
1. Support for negative strides in Python buffer objects/numpy arrays. This
|
||||||
required changing integers from unsigned to signed for the related C++ APIs.
|
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
|
* Improved support for ``std::shared_ptr<>`` conversions
|
||||||
* Initial support for ``std::set<>`` conversions
|
* Initial support for ``std::set<>`` conversions
|
||||||
* Fixed type resolution issue for types defined in a separate plugin module
|
* 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)
|
* Factored out generic functionality to non-templated code (smaller code size)
|
||||||
* Added a code size / compile time benchmark vs Boost.Python
|
* Added a code size / compile time benchmark vs Boost.Python
|
||||||
* Added an appveyor CI script
|
* Added an appveyor CI script
|
||||||
|
@ -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.
|
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
|
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
|
.. code-block:: cmake
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ something. The changes are:
|
|||||||
``CMAKE_CXX_STANDARD=<number>`` instead, or any other valid CMake CXX or CUDA
|
``CMAKE_CXX_STANDARD=<number>`` instead, or any other valid CMake CXX or CUDA
|
||||||
standard selection method, like ``target_compile_features``.
|
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.
|
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)``
|
If you depend on the old behavior, please use ``set(CMAKE_CXX_STANDARD 14)``
|
||||||
instead.
|
instead.
|
||||||
|
@ -37,7 +37,7 @@ TEST_SUBMODULE(numpy_vectorize, m) {
|
|||||||
));
|
));
|
||||||
|
|
||||||
// test_type_selection
|
// 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<int, py::array::c_style>) { return "Int branch taken."; });
|
m.def("selective_func", [](py::array_t<int, py::array::c_style>) { return "Int branch taken."; });
|
||||||
m.def("selective_func", [](py::array_t<float, py::array::c_style>) { return "Float branch taken."; });
|
m.def("selective_func", [](py::array_t<float, py::array::c_style>) { return "Float branch taken."; });
|
||||||
m.def("selective_func", [](py::array_t<std::complex<float>, py::array::c_style>) { return "Complex float branch taken."; });
|
m.def("selective_func", [](py::array_t<std::complex<float>, py::array::c_style>) { return "Complex float branch taken."; });
|
||||||
|
Loading…
Reference in New Issue
Block a user