Commit Graph

192 Commits

Author SHA1 Message Date
Pieter P
9b3a200065
fix(cmake): improved cross-compilation support (#5083)
* fix(cmake): do not use Python::Interpreter when cross-compiling

* chore: apply cmake-format to pybind11NewTools.cmake

* fix(cmake): do not look for Python Interpreter component when cross-compiling

* feat(cmake): guess Python extension suffix

* fix: add pybind11GuessPythonExtSuffix.cmake to packaging test

* Use PYBIND11_CROSSCOMPILING instead of CMAKE_CROSSCOMPILING

* refactor: require PYBIND11_USE_CROSSCOMPILING

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2024-06-06 17:17:54 -04:00
Henry Schreiner
6b5674f36d
chore: prepare 2.12.0 (#5070)
* chore: prepare 2.12.0

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* docs: more info on numpy 2

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* docs: mention NumPy 2 in README

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* docs: add release date

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* docs: add 4955

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Update changelog.rst

* docs: address review comments

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2024-03-27 18:09:06 -04:00
Henry Schreiner
ddb8b67a8a
fix(cmake): allow forcing old FindPython (#5042) 2024-03-21 03:23:57 -04:00
Ilya Lavrenov
aec6cc5406
fix(cmake): skip empty PYBIND11_PYTHON_EXECUTABLE_LAST for the first cmake run (#4856)
* fix(cmake): skip empty PYBIND11_PYTHON_EXECUTABLE_LAST for the first cmake run

* style: pre-commit fixes

* Update pybind11NewTools.cmake

* style: pre-commit fixes

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
2024-01-08 08:40:41 -05:00
Pol Mesalles
daea1130b4
fix(cmake): upgrade maximum supported CMake version to 3.27 (#4786)
* Upgrade maximum supported CMake version to 3.27 to fix warning with CMP0148 policy (#4785)

* Update `macos_brew_install_llvm` pipeline to use expected Python installation

* Fix `Python_EXECUTABLE` Cmake variable typo

* Apply suggestions from code review

* fix: use FindPython for CMake 3.18+ by default for pybind11's tests

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* tests: fix issues with finding Python

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* tests: also set executable on subdir tests

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* fix(cmake): correct logic for FindPython

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Update ci.yml

* Revert "Update ci.yml"

This reverts commit 33798adf3f.

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
2023-12-14 14:36:45 -05:00
Henry Schreiner
9591cfb0b8
fix(cmake): findpython issues and 3.12 support for pybind11_find_import (#4941)
* fix(cmake): findpython issues and 3.12 support for pybind11_find_import

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Update pybind11NewTools.cmake

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2023-11-16 00:54:47 -05:00
Henry Schreiner
6cf90e7286
fix(cmake): avoid really slow compile on emscripten (#4642)
* fix: avoid really slow compile on emscripten

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Update tools/pybind11Common.cmake

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2023-11-16 00:50:15 -05:00
Henry Schreiner
b389ae77cb
chore: update changelog script for categories (#4942) 2023-11-15 18:59:07 -05:00
Social_Mean
31b0a5d94f fix doc typo 2023-11-03 23:51:16 -04:00
Axel Huebl
76b7f53649
Python_ADDITIONAL_VERSIONS: 3.12 (#4909)
Add 3.12 to the default `Python_ADDITIONAL_VERSIONS`.
2023-10-31 22:56:16 -04:00
Henry Schreiner
a18c10f690
fix(cmake): make library component optional (#4805)
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2023-10-27 11:02:05 -04:00
László Papp
5891867ee4
fix(cmake): support DEBUG_POSTFIX correctly (#4761)
* cmake: split extension

Into suffix and debug postfix. Pybind11 is currently treating both as
suffix, which is problematic when something else defines the
DEBUG_POSTFIX because they will be concatenated.

pybind11_extension sets SUFFIX to _d.something and if DEBUG_POSTFIX is
set to _d.

    _d + _d.something = _d_d.something

The issue has been reported at:

https://github.com/pybind/pybind11/issues/4699

* style: pre-commit fixes

* fix(cmake): support postfix for old FindPythonInterp mode too

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2023-09-15 18:05:43 -04:00
Henry Schreiner
4fb111bd78
fix(cmake): correctly detect FindPython policy and better warning (#4806) 2023-09-15 17:59:30 -04:00
Pieter P
4bf60c609a
Disable strip when build type is unset (#4454) (#4780) 2023-08-07 20:58:30 -07:00
Henry Schreiner
2e5f5c4cf8
fix: support CMake 3.27, drop 3.4 (#4719)
* fix: support CMake 3.27, drop 3.4

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Update upgrade.rst

* Update upgrade.rst

* Update upgrade.rst

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2023-07-12 13:10:24 -05:00
Henry Schreiner
956390a87f
fix(cmake): only define lto if CMAKE's IPO setting is unset (#4643)
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2023-04-29 10:15:45 -04:00
Henry Schreiner
438034c5b8
chore: move to Ruff and add rules (#4483) 2023-02-22 06:18:55 -08:00
Ralf W. Grosse-Kunstleve
08a4a47a6c
Revert "Go back to CMake 3.25.2 (#4496)" (#4503)
* Revert "Go back to CMake 3.25.2 (#4496)"

This reverts commit b8f28551cc.

* Apply patch provided by @bradking (with pre-commit cmake-format auto fixes).

https://github.com/pybind/pybind11/pull/4503#issuecomment-1424768172
2023-02-16 10:54:57 -05:00
Henry Schreiner
b2d7ad72c2
chore: prepare for 2.10.3 (#4437)
* docs: update changelog for v2.10.3

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* chore: bump versions for 2.10.3

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* chore: fix make changelog script with entry is empty

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2023-01-03 11:34:22 -05:00
Henry Schreiner
a97c4d220e
fix(cmake): support Windows ARM cross-compilation (#4406)
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2022-12-19 14:36:39 -05:00
Martin Blanchard
09db6445d8
IPO/LTO support for ICX (IntelLLVM) compiler (#4402)
* IPO/LTO support for ICX (IntelLLVM) compiler

https://github.com/pybind/pybind11/issues/4080

* style: pre-commit fixes

* Add WARNING/HELP WANTED comment.

Co-authored-by: Martin Blanchard <martin.blanchard@siemens.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com>
2022-12-15 21:10:46 -08:00
Martin Blanchard
89c3561d9a
Fix multi-context new Python linking mode (#4401)
Allow CMake find_package() from multiple directories.

https://github.com/pybind/pybind11/issues/4400

Co-authored-by: Martin Blanchard <martin.blanchard@siemens.com>
2022-12-14 14:03:37 -05:00
gitartpiano
88b019a8a5
fix pybind11Tools.cmake typo causing Unknown arguments (#4327)
* fix pybind11Tools.cmake typo causing Unknown arguments

CMake Error at pybind11/tools/pybind11Tools.cmake:217 (if):
  if given arguments:
    "NOT" "MSVC" "AND" "NOT" "TEST" "MATCHES" "DEBUG|RELWITHDEBINFO"
  Unknown arguments specified
https://github.com/pybind/pybind11/issues/4325

* Apply the same fix in tools/pybind11NewTools.cmake

Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com>
2022-11-11 17:52:57 -08:00
Henry Schreiner
4fe905d4f0
fix: add flag for overriding classic Python search values (#4195)
* fix: PyPy needs to overrite broken FindPythonInterp values

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* fix: add flag to opt-in to new (cross-compile) behavior

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Apply suggestions from code review

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2022-10-23 00:32:17 -04:00
Henry Schreiner
91cfb77022
Revert "feat: add entrypoint for cmake modules dir" (#4270)
* Revert "feat: add entrypoint for cmake modules dir (#4258)"

This reverts commit 1d4a65e2f1.

* docs: revert changelog mention too
2022-10-21 17:25:53 -04:00
Henry Schreiner
1d4a65e2f1
feat: add entrypoint for cmake modules dir (#4258)
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2022-10-20 10:35:18 -04:00
Lalaland
fab1eebe2c
First draft of Eigen::Tensor support (#4201)
* First draft of Eigen::Tensor support

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix build errors

* Weird allocator stuff?

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Remove unused + additional allocator junk

* Disable warning

* Use constexpr

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* clang tidy fixes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Resolve comments

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Remove auto constexpr function

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Try again for older C++

* Oops forgot constexpr

* Move to new files as suggested

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix weird tests

* Fix nits

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Oops, forgot import

* Fix clang 3.6 bug

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* More comprehensive test suite

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Refactor allocators to make things more clear

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Switch to std::copy

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Switch to DSizes instead of array

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Address feedback

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix python + dummy c++ change to trigger build

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Alignment

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add include guard

* Forgot inline

* Fix compiler warning

* Remove bad test

* Better type signatures

* Add guards to make compiler requirements more explicit

* style: pre-commit fixes

* Force rerun of tests due to flake

* style: pre-commit fixes

* Keep pragmas & all related comments together, add PLEASE KEEP IN SYNC

* Move headers out of detail

* style: pre-commit fixes

* Fix cmake

* Improve casting

* style: pre-commit fixes

* Add a ton more tests + refactor

* Improve names

* style: pre-commit fixes

* Update include/pybind11/eigen/tensor.h

Co-authored-by: Aaron Gokaslan <skylion.aaron@gmail.com>

* Fix tests

* style: pre-commit fixes

* Update

* Add a test to verify that strange numpy arrays work

* Fix dumb compiler warning

* Better tests

* Better tests

* Fix tests

* style: pre-commit fixes

* More test fixes

* style: pre-commit fixes

* A ton more test coverage

* Fix tests

* style: pre-commit fixes

* style: pre-commit fixes

* Add back constexpr

* Another test

* style: pre-commit fixes

* Improve tests

* Whoops

* Less magic numbers

* Update tests/test_eigen_tensor.py

Co-authored-by: Sergiu Deitsch <sergiud@users.noreply.github.com>

* Update tests/test_eigen_tensor.py

Co-authored-by: Sergiu Deitsch <sergiud@users.noreply.github.com>

* style: pre-commit fixes

* Fix tests

* style: pre-commit fixes

* Fix memory leak

* style: pre-commit fixes

* Fix order

* style: pre-commit fixes

* Add test to make sure unsafe casts fail

* Minor bug fix to work on 32 bit machines

* Implement convert flag

* style: pre-commit fixes

* Switch to correct TensorMap const use

* style: pre-commit fixes

* Support older versions of eigen

* Weird c++ compilers

* Fix Eigen bug

* Fix another eigen bug

* Yet another eigen bug

* Potential flakes?

* style: pre-commit fixes

* Rerun tests with dummy exception to find out what is going on

* Another dummy test run

* Ablate more

* Found the broken test?

* One step closer

* one step further

* Double check

* one thing at a time

* Give up and disable the test

* Clang lies about being gcc

* Oops, fix matrix test

* style: pre-commit fixes

* Add tests to verify scalar conversions

* style: pre-commit fixes

* Fix nits

* Support no_array

* Fix tests

* style: pre-commit fixes

* Silence compiler warning

* Improve build system for ancient compilers

* Make clang happy

* Make gcc happy

* Implement Skylion's suggestions

* Fix warning

* Inline const pointer check

* Implement suggestions

* style: pre-commit fixes

* Improve tests

* Typo

* style: pre-commit fixes

* Support Google's build environment

* style: pre-commit fixes

* Update include/pybind11/eigen/tensor.h

Co-authored-by: Aaron Gokaslan <skylion.aaron@gmail.com>

* style: pre-commit fixes

* Test cleanup per Skylion

* Switch to remvove_cv_t

* Cleaner test

* style: pre-commit fixes

* Remove tensor from eigen.h, update tests

* style: pre-commit fixes

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com>
Co-authored-by: Aaron Gokaslan <aaronGokaslan@gmail.com>
Co-authored-by: Aaron Gokaslan <skylion.aaron@gmail.com>
Co-authored-by: Sergiu Deitsch <sergiud@users.noreply.github.com>
2022-10-18 16:54:16 -07:00
pre-commit-ci[bot]
8756f16ed8
[pre-commit.ci] pre-commit autoupdate (#4151)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/Lucas-C/pre-commit-hooks: v1.3.0 → v1.3.1](https://github.com/Lucas-C/pre-commit-hooks/compare/v1.3.0...v1.3.1)
- [github.com/sirosen/texthooks: 0.3.1 → 0.4.0](https://github.com/sirosen/texthooks/compare/0.3.1...0.4.0)
- [github.com/PyCQA/pylint: v2.14.5 → v2.15.0](https://github.com/PyCQA/pylint/compare/v2.14.5...v2.15.0)
- [github.com/codespell-project/codespell: v2.1.0 → v2.2.1](https://github.com/codespell-project/codespell/compare/v2.1.0...v2.2.1)

* Introduce .codespell-ignore-lines for safer (line-based instead of word-based) suppressions.

* Fix two issues: 1. ensure sort order; 2. remove duplicates

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com>
2022-08-29 21:59:48 -07:00
Henry Schreiner
bbb89da152
fix(cmake): support vcpkg, try 2 (#4123)
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2022-08-09 00:03:36 -04:00
Eli Schwartz
5bdd3d59be
feat(cmake): add installation support for pkg-config dependency detection (#4077)
* add installation support for pkg-config dependency detection

pkg-config is a buildsystem-agnostic alternative to
`pybind11Config.cmake` that can be used from build systems other than
cmake.

Fixes #230

* tests: add test for pkg config

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
2022-08-09 00:02:45 -04:00
Daniel Dinu
8a4bca8216
fix(cmake): use case-insensitive CMAKE_BUILD_TYPE comparisons (#4078) 2022-08-08 10:01:39 -04:00
Henry Schreiner
918d4481a4
fix(cmake): support cross-compiles with classic Python (#3959)
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2022-05-20 09:38:29 -04:00
Henry Schreiner
1e4bd22bdc
fix(cmake): support release and debug at the same time (#3948) 2022-05-18 23:19:33 -04:00
Henry Schreiner
dff6fa0554
fix(cmake): avoid issue with NVCC + Windows (#3947) 2022-05-16 23:45:54 -04:00
HaarigerHarald
f306012b55
fix: file extension on windows with cp36 and cp37 (#3919) 2022-05-04 13:12:33 -04:00
Stefano Rivera
465b2e0bd8
Use sysconfig in Python >= 3.10 (#3764)
* Use sysconfig in Python >= 3.10

Rely on sysconfig for installation paths for Python >= 3.10. distutils
has been deprecated and will be removed.

Fixes: #3677

* Explicitly select the posix_prefix scheme for platinclude on Debian

Debian's default scheme is posix_local, for installing locally-built
packages to /usr/local/.  We want to find the Python headers in /usr/,
so search posix_prefix.
2022-03-01 13:47:10 -05:00
Henry Schreiner
522c59ceb2
chore: drop Python 3.5 (#3719)
* chore: drop Python 3.5 support

* chore: more fstrings with flynt's help

* ci: drop Python 3.5

* chore: bump dependency versions

* docs: touch up py::args

* tests: remove deprecation warning

* Ban smartquotes

* Very minor tweaks (by-product of reviewing PR #3719).

Co-authored-by: Aaron Gokaslan <skylion.aaron@gmail.com>
Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com>
2022-02-11 19:06:16 -05:00
Chris Ohk
1a432b426f
docs: Correct minor typos (#3721) 2022-02-11 10:42:48 -05:00
Ralf W. Grosse-Kunstleve
6493f496e3
Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688)
* `#error BYE_BYE_GOLDEN_SNAKE`

* Removing everything related to 2.7 from ci.yml

* Commenting-out Centos7

* Removing `PYTHON: 27` from .appveyor.yml

* "PY2" removal, mainly from tests. C++ code is not touched.

* Systematic removal of `u` prefix from `u"..."` and `u'...'` literals. Collateral cleanup of a couple minor other things.

* Cleaning up around case-insensitive hits for `[^a-z]py.*2` in tests/.

* Removing obsolete Python 2 mention in compiling.rst

* Proper `#error` for Python 2.

* Using PY_VERSION_HEX to guard `#error "PYTHON 2 IS NO LONGER SUPPORTED.`

* chore: bump pre-commit

* style: run pre-commit for pyupgrade 3+

* tests: use sys.version_info, not PY

* chore: more Python 2 removal

* Uncommenting Centos7 block (PR #3691 showed that it is working again).

* Update pre-commit hooks

* Fix pre-commit hook

* refactor: remove Python 2 from CMake

* refactor: remove Python 2 from setup code

* refactor: simplify, better static typing

* feat: fail with nice messages

* refactor: drop Python 2 C++ code

* docs: cleanup for Python 3

* revert: intree

revert: intree

* docs: minor touchup to py2 statement

Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: Aaron Gokaslan <skylion.aaron@gmail.com>
2022-02-10 18:28:08 -08:00
Henry Schreiner
46dcd9bc75
fix: minor CMake warning fix for unused variable (#3718) 2022-02-10 17:03:33 -05:00
Mattia Basaglia
dc4717bac2
fix: module extension detection for python 3.10 (#3663)
* Fix module extension detection for python 3.10

* Fix for python < 3.10

* Use importlib
2022-01-31 11:10:45 -05:00
Henry Schreiner
e50f841de0
fix: do not use LTS on mips64 and ppc64le (#3557) 2021-12-21 15:42:34 -05:00
Sergiu Deitsch
d2b2131603
cmake: report version type in the version string (#3472) 2021-11-16 10:03:41 -05:00
Henry Schreiner
90707b46f2
fix(build): support conan's multiple includes of all files (#3420) 2021-10-27 15:06:02 -04:00
Henry Schreiner
e7e2c79f3f
fix: improve support for Python 3.11-dev (#3368)
* ci: support Python 3.11-dev

Also update 3.10 to final, better PyPy usage

* fix: use PyFrame_GetCode on Python 3.9+

* ci: some bitiness of pypy not supported on win

* chore: update CMake support to 3.22rc1 to quiet warning

* fix: use dev version of py to fix Py 3.11

* tests: print proper Eigen version

* ci: include pypy2, not sure why

* ci: avoid running on Python 3.11 for now

* ci: fix runs

* ci: simpler PyPy usage, drop unmaintained scipy + pypy index

* ci: only binary numpy, wait on pypy 3.8

* refactor: address review
2021-10-26 14:50:34 -04:00
Henry Schreiner
d58699c9ab
fix(cmake): reduce chance for variable collision (#3302) 2021-09-24 17:47:03 -04:00
Wenzel Jakob
409be8336f CMake: react to python version changes
The new FindPython-based variant of the CMake scripts caches information
about the chosen Python version that can become stale. For example,
suppose I configure a simple pybind11-based project as follows

```
cmake -S . -B build -GNinja -DPython_ROOT=<path to python 3.8>
```

which will generate `my_extension.cpython-38-x86_64-linux-gnu.so`.
A subsequent change to the python version like

```
cmake -S . -B build -GNinja -DPython_ROOT=<path to python 3.9>
```

does not update all necessary build system information. In particular,
the compiled file is still called
`my_extension.cpython-38-x86_64-linux-gnu.so`.

This commit fixes the problem by detecting changes in
`Python_EXECUTABLE` and re-running Python as needed.

Note that the previous way of detecting Python does not seem to be
affected, it always specifies the right suffix.
2021-09-24 17:42:06 +02:00
Henry Schreiner
6ad3f874a7
fix(build): avoid a possible warning about shadowed variables and changing behaviors (#3220) 2021-09-23 15:42:16 -04:00
Aaron Gokaslan
9df2f1ff13
maint(precommit): Apply isort (#3195)
* Apply isort

* Tweak isort config

* Add env.py as a known_first_party

* Add one missing known first party

* Make config compat with older isort versions

* Add another comment

* Revert pyproject setting
2021-08-13 12:37:05 -04:00
Ralf W. Grosse-Kunstleve
7d3b05715b
Improved workaround for Centos 8 failure (follow-on to PR #3030). (#3193)
* Rollback of PR #3030 (Working around Centos 8 failure).

* Adding `-DCMAKE_BUILD_TYPE=Release`

* Improving existing workaround (undoing the originally intended rollback).

* Fixing minor documentation bug.
2021-08-12 13:21:49 -07:00