From ba214640eea22830ec786284426d7c1015eb59a1 Mon Sep 17 00:00:00 2001 From: wouter bolsterlee Date: Mon, 15 Jan 2024 17:54:49 +0100 Subject: [PATCH 1/6] tox: adapt to renamed configuration option --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 0df3ada..ff9ed00 100644 --- a/tox.ini +++ b/tox.ini @@ -4,4 +4,4 @@ envlist = py310, py39, py38, py37 [testenv] deps = -rrequirements-test.txt commands = make test -whitelist_externals = make +allowlist_externals = make From b865c107a2c290f1608e4931a023e32b6d4bada0 Mon Sep 17 00:00:00 2001 From: wouter bolsterlee Date: Mon, 15 Jan 2024 18:06:25 +0100 Subject: [PATCH 2/6] tox: install setuptools (needed for python 3.12) --- requirements-test.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements-test.txt b/requirements-test.txt index dfdd43d..074321b 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,2 +1,3 @@ pytest>=3.6 pytest-cov +setuptools From 2a531fd70aac0ee1a48d214c99fb6a8e6f6fc70c Mon Sep 17 00:00:00 2001 From: wouter bolsterlee Date: Mon, 15 Jan 2024 18:06:50 +0100 Subject: [PATCH 3/6] tox: test against python 3.12 and 3.11 --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index ff9ed00..20df1d1 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py310, py39, py38, py37 +envlist = py312, py311, py310, py39, py38, py37 [testenv] deps = -rrequirements-test.txt From 21efff8850e5a625cb86abd007105248da74d377 Mon Sep 17 00:00:00 2001 From: wouter bolsterlee Date: Mon, 15 Jan 2024 17:50:01 +0100 Subject: [PATCH 4/6] prepare for 1.5.1 release (with python 3.12 support) --- NEWS.rst | 12 ++++++++++++ plyvel/_version.py | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/NEWS.rst b/NEWS.rst index 4093051..f0832fe 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -2,6 +2,18 @@ Version history =============== +Plyvel 1.5.1 +============ + +Release date: 2024-01-15 + +* Add Python 3.12 support + +* Rebuild Linux wheels, including Python 3.12 wheels. + +* Allow using plyvel.DB as a context manager + (`pr #151 `_) + Plyvel 1.5.0 ============ diff --git a/plyvel/_version.py b/plyvel/_version.py index 551a364..4ffd924 100644 --- a/plyvel/_version.py +++ b/plyvel/_version.py @@ -5,4 +5,4 @@ # Note: don't add any non-trivial logic here; this file is also loaded # from setup.py file when the module has not yet been compiled! -__version__ = '1.5.0' +__version__ = '1.5.1' From 30e237d3e79b3fc3bf8d4f1b5570bd64bf2bdc9a Mon Sep 17 00:00:00 2001 From: wouter bolsterlee Date: Mon, 15 Jan 2024 18:29:16 +0100 Subject: [PATCH 5/6] docs: document using DB as a context manager see #151 --- doc/api.rst | 5 +++++ doc/user.rst | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/doc/api.rst b/doc/api.rst index 2b2cf02..e35c168 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -35,6 +35,11 @@ LevelDB database. Most arguments are optional; only the database name is required. + Instances of this class can be used as context managers + (Python's ``with`` block). When the ``with`` block terminates, + the database automatically closes without an explicit call to + :py:meth:`DB.close`. + See the descriptions for :cpp:class:`DB`, :cpp:func:`DB::Open`, :cpp:class:`Cache`, :cpp:class:`FilterPolicy`, and :cpp:class:`Comparator` in the LevelDB C++ API for more information. diff --git a/doc/user.rst b/doc/user.rst index 330bd8b..9a29648 100644 --- a/doc/user.rst +++ b/doc/user.rst @@ -48,6 +48,13 @@ To close the database we just opened, use :py:meth:`DB.close` and inspect the >>> db.closed True +:py:class:`DB` instances can also be used as context managers, which +will cause the database to close itself at the end of the ``with`` +block:: + + with plyvel.DB('/tmp/testdb/') as db: + ... + Alternatively, you can just delete the variable that points to it, but this might not close the database immediately, e.g. because active iterators are using it:: From 7395215fb19e01796d51474d40331eebbae28dc0 Mon Sep 17 00:00:00 2001 From: wouter bolsterlee Date: Mon, 15 Jan 2024 18:30:43 +0100 Subject: [PATCH 6/6] docs: add readthedocs config file --- .readthedocs.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .readthedocs.yaml diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..d27118d --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,10 @@ +--- +version: "2" + +build: + os: "ubuntu-22.04" + tools: + python: "3.12" + +sphinx: + configuration: doc/conf.py