1. 31 Oct, 2022 1 commit
    • Ralf W. Grosse-Kunstleve's avatar
      fix: define (non-empty) `PYBIND11_EXPORT_EXCEPTION` only under macOS. (#4298) · b1bd7f26
      Ralf W. Grosse-Kunstleve authored
      Background: #2999, #4105, #4283, #4284
      
      In a nutshell:
      
      * Only macOS actually needs `PYBIND11_EXPORT_EXCEPTION` (#4284).
      
      * Evidently (#4283), under macOS `PYBIND11_EXPORT_EXCEPTION` does not run the risk of introducing ODR violations,
      
      * but evidently (#4283) under Linux it does, in the presumably rare/unusual situation that `RTLD_GLOBAL` is used.
      
      * Windows does no have the equivalent of `RTLD_GLOBAL`, therefore `PYBIND11_EXPORT_EXCEPTION` has no practical benefit, on the contrary, noisy warning suppression pragmas are needed, therefore it is best left empty.
      b1bd7f26
  2. 21 Oct, 2022 1 commit
  3. 20 Oct, 2022 1 commit
  4. 14 Sep, 2022 1 commit
  5. 01 Aug, 2022 1 commit
  6. 27 Jul, 2022 1 commit
  7. 16 Jul, 2022 1 commit
  8. 15 Jul, 2022 1 commit
  9. 13 Jul, 2022 1 commit
  10. 06 Jul, 2022 1 commit
  11. 28 Jun, 2022 1 commit
  12. 31 Mar, 2022 1 commit
  13. 17 Mar, 2022 2 commits
  14. 14 Feb, 2022 1 commit
  15. 12 Feb, 2022 1 commit
  16. 11 Feb, 2022 1 commit
    • Ralf W. Grosse-Kunstleve's avatar
      Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) · 6493f496
      Ralf W. Grosse-Kunstleve authored
      
      
      * `#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: default avatarHenry Schreiner <henryschreineriii@gmail.com>
      Co-authored-by: default avatarAaron Gokaslan <skylion.aaron@gmail.com>
      6493f496
  17. 06 Feb, 2022 1 commit
  18. 03 Feb, 2022 1 commit
  19. 02 Feb, 2022 1 commit
  20. 29 Jan, 2022 1 commit
  21. 26 Jan, 2022 1 commit
  22. 19 Jan, 2022 1 commit
  23. 28 Dec, 2021 2 commits
  24. 21 Dec, 2021 2 commits
  25. 02 Dec, 2021 1 commit
  26. 18 Nov, 2021 1 commit
  27. 16 Nov, 2021 1 commit
  28. 12 Nov, 2021 1 commit
  29. 10 Nov, 2021 1 commit
  30. 06 Nov, 2021 1 commit
  31. 01 Nov, 2021 1 commit
  32. 29 Oct, 2021 1 commit
    • Jason Rhinelander's avatar
      feat: allow kw-only args after a py::args (#3402) · e7c9753f
      Jason Rhinelander authored
      
      
      * Simply has_kw_only_args handling
      
      This simplifies tracking the number of kw-only args by instead tracking
      the number of positional arguments (which is really what we care about
      everywhere this is used).
      
      * Allow keyword-only arguments to follow py::args
      
      This removes the constraint that py::args has to be last (or
      second-last, with py::kwargs) and instead makes py::args imply
      py::kw_only for any remaining arguments, allowing you to bind a function
      that works the same way as a Python function such as:
      
          def f(a, *args, b):
              return a * b + sum(args)
      
          f(10, 1, 2, 3, b=20)  # == 206
      
      With this change, you can bind such a function using:
      
          m.def("f", [](int a, py::args args, int b) { /* ... */ },
              "a"_a, "b"_a);
      
      Or, to be more explicit about the keyword-only arguments:
      
          m.def("g", [](int a, py::args args, int b) { /* ... */ },
              "a"_a, py::kw_only{}, "b"_a);
      
      (The only difference between the two is that the latter will fail at
      binding time if the `kw_only{}` doesn't match the `py::args` position).
      
      This doesn't affect backwards compatibility at all because, currently,
      you can't have a py::args anywhere except the end/2nd-last.
      
      * Take args/kwargs by const lvalue ref
      Co-authored-by: default avatarHenry Schreiner <HenrySchreinerIII@gmail.com>
      Co-authored-by: default avatarHenry Schreiner <HenrySchreinerIII@gmail.com>
      e7c9753f
  33. 27 Oct, 2021 2 commits
  34. 23 Oct, 2021 1 commit
  35. 19 Oct, 2021 1 commit
  36. 08 Oct, 2021 1 commit