Merge branch 'master' into sh_merge_master

This commit is contained in:
Ralf W. Grosse-Kunstleve 2023-03-16 21:36:21 -07:00
commit 945be5bbd9
6 changed files with 54 additions and 13 deletions

View File

@ -99,13 +99,13 @@ jobs:
- uses: actions/download-artifact@v3 - uses: actions/download-artifact@v3
- name: Publish standard package - name: Publish standard package
uses: pypa/gh-action-pypi-publish@v1.6.4 uses: pypa/gh-action-pypi-publish@v1.8.1
with: with:
password: ${{ secrets.pypi_password }} password: ${{ secrets.pypi_password }}
packages_dir: standard/ packages-dir: standard/
- name: Publish global package - name: Publish global package
uses: pypa/gh-action-pypi-publish@v1.6.4 uses: pypa/gh-action-pypi-publish@v1.8.1
with: with:
password: ${{ secrets.pypi_password_global }} password: ${{ secrets.pypi_password_global }}
packages_dir: global/ packages-dir: global/

View File

@ -70,7 +70,7 @@ repos:
# Ruff, the Python auto-correcting linter written in Rust # Ruff, the Python auto-correcting linter written in Rust
- repo: https://github.com/charliermarsh/ruff-pre-commit - repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.251 rev: v0.0.254
hooks: hooks:
- id: ruff - id: ruff
args: ["--fix", "--show-fixes"] args: ["--fix", "--show-fixes"]
@ -85,7 +85,7 @@ repos:
# PyLint has native support - not always usable, but works for us # PyLint has native support - not always usable, but works for us
- repo: https://github.com/PyCQA/pylint - repo: https://github.com/PyCQA/pylint
rev: "v2.16.1" rev: "v2.16.4"
hooks: hooks:
- id: pylint - id: pylint
files: ^pybind11 files: ^pybind11
@ -101,7 +101,7 @@ repos:
# Check static types with mypy # Check static types with mypy
- repo: https://github.com/pre-commit/mirrors-mypy - repo: https://github.com/pre-commit/mirrors-mypy
rev: "v0.991" rev: "v1.0.1"
hooks: hooks:
- id: mypy - id: mypy
args: [] args: []

View File

@ -21,11 +21,47 @@ Changes:
``dec_ref()`` are now enabled by default again. ``dec_ref()`` are now enabled by default again.
`#4246 <https://github.com/pybind/pybind11/pull/4246>`_ `#4246 <https://github.com/pybind/pybind11/pull/4246>`_
* ``py::initialize_interpreter()`` using ``PyConfig_InitPythonConfig()``
instead of ``PyConfig_InitIsolatedConfig()``, to obtain complete
``sys.path``.
`#4473 <https://github.com/pybind/pybind11/pull/4473>`_
* Cast errors now always include Python type information, even if
``PYBIND11_DETAILED_ERROR_MESSAGES`` is not defined. This increases binary
sizes slightly (~1.5%) but the error messages are much more informative.
`#4463 <https://github.com/pybind/pybind11/pull/4463>`_
Build system improvements: Build system improvements:
* Update clang-tidy to 15 in CI. * Update clang-tidy to 15 in CI.
`#4387 <https://github.com/pybind/pybind11/pull/4387>`_ `#4387 <https://github.com/pybind/pybind11/pull/4387>`_
* Moved the linting framework over to Ruff.
`#4483 <https://github.com/pybind/pybind11/pull/4483>`_
Version 2.10.4 (Mar 16, 2023)
----------------------------
Changes:
* ``python3 -m pybind11`` gained a ``--version`` option (prints the version and
exits).
`#4526 <https://github.com/pybind/pybind11/pull/4526>`_
Bug Fixes:
* Fix a warning when pydebug is enabled on Python 3.11.
`#4461 <https://github.com/pybind/pybind11/pull/4461>`_
* Ensure ``gil_scoped_release`` RAII is non-copyable.
`#4490 <https://github.com/pybind/pybind11/pull/4490>`_
* Ensure the tests dir does not show up with new versions of setuptools.
`#4510 <https://github.com/pybind/pybind11/pull/4510>`_
* Better stacklevel for a warning in setuptools helpers.
`#4516 <https://github.com/pybind/pybind11/pull/4516>`_
Version 2.10.3 (Jan 3, 2023) Version 2.10.3 (Jan 3, 2023)
---------------------------- ----------------------------

View File

@ -4,6 +4,7 @@ import argparse
import sys import sys
import sysconfig import sysconfig
from ._version import __version__
from .commands import get_cmake_dir, get_include, get_pkgconfig_dir from .commands import get_cmake_dir, get_include, get_pkgconfig_dir
@ -25,6 +26,12 @@ def print_includes() -> None:
def main() -> None: def main() -> None:
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument(
"--version",
action="version",
version=__version__,
help="Print the version and exit.",
)
parser.add_argument( parser.add_argument(
"--includes", "--includes",
action="store_true", action="store_true",

View File

@ -8,8 +8,8 @@ import contextlib
import difflib import difflib
import gc import gc
import multiprocessing import multiprocessing
import os
import re import re
import sys
import textwrap import textwrap
import traceback import traceback
@ -25,8 +25,9 @@ except Exception:
@pytest.fixture(scope="session", autouse=True) @pytest.fixture(scope="session", autouse=True)
def always_forkserver_on_unix(): def use_multiprocessing_forkserver_on_linux():
if os.name == "nt": if sys.platform != "linux":
# The default on Windows and macOS is "spawn": If it's not broken, don't fix it.
return return
# Full background: https://github.com/pybind/pybind11/issues/4105#issuecomment-1301004592 # Full background: https://github.com/pybind/pybind11/issues/4105#issuecomment-1301004592
@ -34,8 +35,6 @@ def always_forkserver_on_unix():
# It is actually a well-known pitfall, unfortunately without guard rails. # It is actually a well-known pitfall, unfortunately without guard rails.
# "forkserver" is more performant than "spawn" (~9s vs ~13s for tests/test_gil_scoped.py, # "forkserver" is more performant than "spawn" (~9s vs ~13s for tests/test_gil_scoped.py,
# visit the issuecomment link above for details). # visit the issuecomment link above for details).
# Windows does not have fork() and the associated pitfall, therefore it is best left
# running with defaults.
multiprocessing.set_start_method("forkserver") multiprocessing.set_start_method("forkserver")

View File

@ -63,7 +63,6 @@ def test_importing():
from pybind11_tests.modules import OD from pybind11_tests.modules import OD
assert OD is OrderedDict assert OD is OrderedDict
assert str(OD([(1, "a"), (2, "b")])) == "OrderedDict([(1, 'a'), (2, 'b')])"
def test_pydoc(): def test_pydoc():