From d76b38dd2b11fc0cdfee97548ca323d10d9fded3 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Tue, 3 Oct 2023 17:45:52 +0200 Subject: [PATCH 1/4] upgrade to regular Python 3.12 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53235459..4c3a1bbd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: fail-fast: false matrix: os: ['ubuntu-latest', 'windows-2022', 'macos-latest'] - python: ['3.8', '3.9', '3.10', '3.11', '3.12.0-rc.3', 'pypy3.9', 'pypy3.10'] + python: ['3.8', '3.9', '3.10', '3.11', '3.12.0', 'pypy3.9', 'pypy3.10'] name: "Python ${{ matrix.python }} / ${{ matrix.os }}" runs-on: ${{ matrix.os }} @@ -48,7 +48,7 @@ jobs: python -m pip install pytest pytest-github-actions-annotate-failures - name: Install NumPy - if: matrix.python != 'pypy3.9' && matrix.python != 'pypy3.10' && matrix.python != '3.12.0-rc.3' + if: matrix.python != 'pypy3.9' && matrix.python != 'pypy3.10' && matrix.python != '3.12.0' run: | python -m pip install numpy scipy From 31d115fce310475fed0f539b9446cc41ba9ff4d4 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Tue, 3 Oct 2023 22:45:03 +0200 Subject: [PATCH 2/4] The intrusive reference counting headers weren't distributed on PyPI.. --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index b45eab0e..59ff5fe0 100644 --- a/setup.py +++ b/setup.py @@ -71,6 +71,7 @@ 'include/nanobind/stl/detail/*.h', 'include/nanobind/eigen/*.h', 'include/nanobind/intrusive/*.h', + 'include/nanobind/intrusive/*.inl', 'ext/robin_map/include/tsl/robin_map.h', 'ext/robin_map/include/tsl/robin_hash.h', 'ext/robin_map/include/tsl/robin_growth_policy.h', From cc5ac7e61def198db2a8b65c6d630343987a9f1d Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Tue, 3 Oct 2023 22:47:33 +0200 Subject: [PATCH 3/4] v1.6.2 release --- docs/changelog.rst | 13 ++++++++++--- include/nanobind/nanobind.h | 2 +- src/__init__.py | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index ede95966..c50a8bfb 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -15,18 +15,25 @@ case, both modules must use the same nanobind ABI version, or they will be isolated from each other. Releases that don't explicitly mention an ABI version below inherit that of the preceding release. +Version 1.6.2 (Oct 3, 2023) +------------------- + +* Added a missing include file used by the new intrusive reference counting + sample implementation from v1.6.0. (commit `31d115 + `__). + Version 1.6.1 (Oct 2, 2023) ------------------- * Added missing namespace declaration to the :cpp:class:`ref` intrusive reference counting RAII helper class added in version 1.6.0. (commit `3ba352 `__). - + Version 1.6.0 (Oct 2, 2023) ------------------- -* Several :cpp:class:`nb::ndarray\<..\> ` improvements: +* Several :cpp:class:`nb::ndarray\<..\> ` improvements: 1. CPU loops involving nanobind ndarrays weren't getting properly vectorized. This release of nanobind adds *views*, which provide an efficient @@ -209,7 +216,7 @@ Version 1.3.2 (June 2, 2023) Version 1.3.1 (May 31, 2023) ---------------------------- -* CMake build system improvements for stable ABI wheel generation. +* CMake build system improvements for stable ABI wheel generation. (PR `#222 `__). Version 1.3.0 (May 31, 2023) diff --git a/include/nanobind/nanobind.h b/include/nanobind/nanobind.h index 80eed2cd..7e15c9f2 100644 --- a/include/nanobind/nanobind.h +++ b/include/nanobind/nanobind.h @@ -23,7 +23,7 @@ #define NB_VERSION_MAJOR 1 #define NB_VERSION_MINOR 6 -#define NB_VERSION_PATCH 1 +#define NB_VERSION_PATCH 2 // Core C++ headers that nanobind depends on #include diff --git a/src/__init__.py b/src/__init__.py index 1839f68f..5b46ab2e 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -12,7 +12,7 @@ def cmake_dir() -> str: "Return the path to the nanobind CMake module directory." return os.path.join(os.path.abspath(os.path.dirname(__file__)), "cmake") -__version__ = "1.6.1" +__version__ = "1.6.2" __all__ = ( "__version__", From 8bd58c75c6b36efe3a2458224d0c97692bc92c91 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Wed, 4 Oct 2023 23:08:22 +0200 Subject: [PATCH 4/4] added ``ref::reset()`` function --- docs/api_extra.rst | 5 +++++ include/nanobind/intrusive/ref.h | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/docs/api_extra.rst b/docs/api_extra.rst index 8aa827b5..ee31829a 100644 --- a/docs/api_extra.rst +++ b/docs/api_extra.rst @@ -1146,6 +1146,11 @@ functions: Overwrite this reference with a pointer to another object + .. cpp:function:: void reset() + + Clear the reference and reduces the reference count of the object (if not + ``nullptr``) + .. cpp:function:: bool operator==(const ref &r) const Compare this reference with another reference (pointer equality) diff --git a/include/nanobind/intrusive/ref.h b/include/nanobind/intrusive/ref.h index 6c0a7528..e0c20657 100644 --- a/include/nanobind/intrusive/ref.h +++ b/include/nanobind/intrusive/ref.h @@ -73,6 +73,12 @@ template class ref { return *this; } + /// Clear the currently stored reference + void reset() { + dec_ref(m_ptr); + m_ptr = nullptr; + } + /// Compare this reference with another reference bool operator==(const ref &r) const { return m_ptr == r.m_ptr; }