* 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>
* 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>
* 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.
* 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>
* `#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>
* fix: match new extension discovery with changes to classic discovery
Followup to #2638 - this was fixed in 2.6.0, but only for classic Python
* fix: followup to avoid warnings
* Use LIBDIR and MULTIARCH on linux to find python library
* Remove apple-specific setting; the non-windows one should work fine on OS X
* Default LIBDIR/MULTIARCH to '' (to avoid getting None)
* Remove trailing whitespace from FindPythonLibsNew
Fixes#365. `sysconfig.get_config_var('SO')` already returns the correct
PYTHON_MODULE_EXTENSION, even for debug builds, so there is no need to
add anything else manually.
When run on windows in a venv, PYTHON_LIBRARY pointet to a non-existant
location in the virtual environment directory.
This has been fixed by testing if the path exists and, if not, trying
an alternative path, relative to the PYTHON_INCLUDE_DIR.
If the alternative path doesn't exit as well, an error will be raised.