* Add test_class_sh_property_non_owning.cpp,py
Failing:
```
__________________________________________________________ test_persistent_holder __________________________________________________________
def test_persistent_holder():
h = m.DataFieldsHolder(2)
> c = h.vec_at(0).core_fld
E RuntimeError: Non-owning holder (loaded_as_shared_ptr).
h = <pybind11_tests.class_sh_property_non_owning.DataFieldsHolder object at 0x7fabab516470>
test_class_sh_property_non_owning.py:6: RuntimeError
__________________________________________________________ test_temporary_holder ___________________________________________________________
def test_temporary_holder():
d = m.DataFieldsHolder(2).vec_at(1)
> c = d.core_fld
E RuntimeError: Non-owning holder (loaded_as_shared_ptr).
d = <pybind11_tests.class_sh_property_non_owning.DataField object at 0x7fabab548770>
test_class_sh_property_non_owning.py:13: RuntimeError
```
* Introduce `shared_ptr_from_python(responsible_parent)` and use in all `property_cpp_function`s with `const shared_ptr<T> &` arguments.
Tests are incomplete.
* Complete tests.
* Add comment for `smart_holder_type_caster_load<T>::shared_ptr_from_python`
Without this, it's impossible to get feature parity between detection
mechanisms. Both the pkg-config file and the cmake config set their
versions, but the python probe script didn't provide an option for this.
So you could print the compiler flags for using it, but you could not
check what you got.
```
flake8...................................................................Failed
- hook id: flake8
- exit code: 1
pybind11/setup_helpers.py:177:13: B028 No explicit stacklevel keyword argument found. The warn method from the warnings module uses a stacklevel of 1 by default. This will only show a stack trace for the line on which the warn method is called. It is therefore recommended to use a stacklevel of 2 or greater to provide more information to the user.
warnings.warn("You cannot safely change the cxx_level after setting it!")
^
```
```
flake8...................................................................Failed
- hook id: flake8
- exit code: 1
pybind11/setup_helpers.py:177:13: B028 No explicit stacklevel keyword argument found. The warn method from the warnings module uses a stacklevel of 1 by default. This will only show a stack trace for the line on which the warn method is called. It is therefore recommended to use a stacklevel of 2 or greater to provide more information to the user.
warnings.warn("You cannot safely change the cxx_level after setting it!")
^
```
* Use PyConfig_InitPythonConfig instead of PyConfig_InitIsolatedConfig
* add unit test for default python configuration
---------
Co-authored-by: Daniel Jacobs <daniel.jacobs@is4s.com>
* Resolve flake8 error by replacing `pytest.raises(Exception)` with `SystemError`
* Also remove the obsolete comment.
* Tweak comment instead of removing it.
* Make sure to properly untrack gc objects before freeing them
* style: pre-commit fixes
* Fix lint
* Add comment about where the original track comes from
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>