Skip to content

Commit

Permalink
fix: find_import didn't work properly for classic tools (#2550)
Browse files Browse the repository at this point in the history
* fix: find_import didn't work properly for classic tools

* ci: fix all files not being checked in style run
  • Loading branch information
henryiii authored Oct 5, 2020
1 parent 1411207 commit 2a2f522
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: pre-commit/[email protected]
with:
# Slow hooks are marked with manual - slow is okay here, run them too
extra_args: --hook-stage manual
extra_args: --hook-stage manual --all-files

clang-tidy:
name: Clang-Tidy
Expand Down
1 change: 0 additions & 1 deletion docs/cmake/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ install with ``find_package(pybind11 CONFIG)``. The interface provided in
either case is functionally identical.

.. cmake-module:: ../../tools/pybind11Config.cmake.in

2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ commonmark==0.9.1
recommonmark==0.6.0
sphinx==3.2.1
sphinx_rtd_theme==0.5.0
sphinxcontrib-svg2pdfconverter==1.1.0
sphinxcontrib-moderncmakedomain==3.13
sphinxcontrib-svg2pdfconverter==1.1.0
2 changes: 1 addition & 1 deletion tools/pybind11Common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ else()

endif()

# --------------------- pybind11_check_import -------------------------------
# --------------------- pybind11_find_import -------------------------------

if(NOT _pybind11_nopython)
# Check to see if modules are importable. Use REQUIRED to force an error if
Expand Down
7 changes: 4 additions & 3 deletions tools/pybind11NewTools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,10 @@ execute_process(
ERROR_VARIABLE _PYTHON_MODULE_EXTENSION_ERR
OUTPUT_STRIP_TRAILING_WHITESPACE)

if (_PYTHON_MODULE_EXTENSION STREQUAL "")
message(FATAL_ERROR "pybind11 could not query the module file extension, likely the 'distutils'"
"package is not installed. Full error message:\n${_PYTHON_MODULE_EXTENSION_ERR}")
if(_PYTHON_MODULE_EXTENSION STREQUAL "")
message(
FATAL_ERROR "pybind11 could not query the module file extension, likely the 'distutils'"
"package is not installed. Full error message:\n${_PYTHON_MODULE_EXTENSION_ERR}")
endif()

# This needs to be available for the pybind11_extension function
Expand Down
4 changes: 3 additions & 1 deletion tools/pybind11Tools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,6 @@ function(pybind11_add_module target_name)
endfunction()

# Provide general way to call common Python commands in "common" file.
set(_Python PYTHON)
set(_Python
PYTHON
CACHE INTERNAL "" FORCE)

0 comments on commit 2a2f522

Please sign in to comment.