From 09747eb176a245a18ab5a8f61b1ac2be698a7ec4fd6e13f6ec32047e9132ccdd Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Fri, 22 Mar 2024 19:54:00 +0000 Subject: [PATCH] - update to 0.23.1: * Fix a regression in 0.23.0 that could defeat type inference of a bidict's key type and value type when running in Python 3.8 or 3.9. :issue:`310` * Primarily, this release simplifies bidict by removing minor features that are no longer necessary or that have little to no apparent usage, and it also includes some performance optimizations. * Specifically, initializing or updating a bidict is now up to 70% faster in microbenchmarks. * The changes in this release will also make it easier to maintain and improve bidict in the future, including further potential performance optimizations. * It also contains several other improvements. * Drop support for Python 3.7, which reached end of life on 2023-06-27, and take advantage of features available in Python 3.8+. * Drop support for Python 3.7, which reached end of life on 2023-06-27, and take advantage of features available in Python 3.8+. * Remove FrozenOrderedBidict now that Python 3.7 is no longer supported. :class:`~bidict.frozenbidict` now provides everything that FrozenOrderedBidict provided (including :class:`reversibility `) on all supported Python versions, but with less space overhead. * Remove FrozenOrderedBidict now that Python 3.7 is no longer supported. :class:`~bidict.frozenbidict` now provides everything that FrozenOrderedBidict provided (including :class:`reversibility `) on all supported Python versions, but with less space overhead. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bidict?expand=0&rev=33 --- bidict-0.22.1-gh.tar.gz | 3 -- bidict-0.23.1-gh.tar.gz | 3 ++ python-bidict.changes | 98 +++++++++++++++++++++++++++++++++++++++- python-bidict.spec | 10 ++-- support-python-312.patch | 13 ------ 5 files changed, 105 insertions(+), 22 deletions(-) delete mode 100644 bidict-0.22.1-gh.tar.gz create mode 100644 bidict-0.23.1-gh.tar.gz delete mode 100644 support-python-312.patch diff --git a/bidict-0.22.1-gh.tar.gz b/bidict-0.22.1-gh.tar.gz deleted file mode 100644 index ba53cc7..0000000 --- a/bidict-0.22.1-gh.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:da32e2e9a36f34396feb4999e4bbbb5d7e97096554418b522936502a4d9ab0e5 -size 181134 diff --git a/bidict-0.23.1-gh.tar.gz b/bidict-0.23.1-gh.tar.gz new file mode 100644 index 0000000..a58cf82 --- /dev/null +++ b/bidict-0.23.1-gh.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b3619436e1e1e3cba15856839666edcb769fce97b47f5bba5e2789b03eed3156 +size 390680 diff --git a/python-bidict.changes b/python-bidict.changes index a41290d..27aeb64 100644 --- a/python-bidict.changes +++ b/python-bidict.changes @@ -1,3 +1,99 @@ +------------------------------------------------------------------- +Fri Mar 22 19:53:11 UTC 2024 - Dirk Müller + +- update to 0.23.1: + * Fix a regression in 0.23.0 that could defeat type inference + of a bidict's key type and value type when running in Python + 3.8 or 3.9. :issue:`310` + * Primarily, this release simplifies bidict by removing minor + features that are no longer necessary or that have little to + no apparent usage, and it also includes some performance + optimizations. + * Specifically, initializing or updating a bidict is now up to + 70% faster in microbenchmarks. + * The changes in this release will also make it easier to + maintain and improve bidict in the future, including further + potential performance optimizations. + * It also contains several other improvements. + * Drop support for Python 3.7, which reached end of life on + 2023-06-27, and take advantage of features available in + Python 3.8+. + * Drop support for Python 3.7, which reached end of life on + 2023-06-27, and take advantage of features available in + Python 3.8+. + * Remove FrozenOrderedBidict now that Python 3.7 is no longer + supported. :class:`~bidict.frozenbidict` now provides + everything that FrozenOrderedBidict provided (including + :class:`reversibility `) on all + supported Python versions, but with less space overhead. + * Remove FrozenOrderedBidict now that Python 3.7 is no longer + supported. :class:`~bidict.frozenbidict` now provides + everything that FrozenOrderedBidict provided (including + :class:`reversibility `) on all + supported Python versions, but with less space overhead. + * Remove namedbidict due to low usage. + * Remove namedbidict due to low usage. + * Remove the kv field of :class:`~bidict.OnDup` which specified + the :class:`~bidict.OnDupAction` to take in the case of + :ref:`basic-usage:key and value duplication`. The + :attr:`~bidict.OnDup.val` field now specifies the action to + take in the case of :ref:`basic-usage:key and value + duplication` as well as :ref:`just value duplication `. + * Remove the kv field of :class:`~bidict.OnDup` which specified + the :class:`~bidict.OnDupAction` to take in the case of + :ref:`basic-usage:key and value duplication`. The + :attr:`~bidict.OnDup.val` field now specifies the action to + take in the case of :ref:`basic-usage:key and value + duplication` as well as :ref:`just value duplication `. + * Improve type hints for the :attr:`~bidict.BidictBase.inv` + shortcut alias for :attr:`~bidict.BidictBase.inverse`. + * Improve type hints for the :attr:`~bidict.BidictBase.inv` + shortcut alias for :attr:`~bidict.BidictBase.inverse`. + * Fix a bug where calls like bidict(None), bi.update(False), + etc. would fail to raise a :class:`TypeError`. + * Fix a bug where calls like bidict(None), bi.update(False), + etc. would fail to raise a :class:`TypeError`. + * All :meth:`~bidict.BidictBase.__init__`, + :meth:`~bidict.MutableBidict.update`, and related methods now + handle SupportsKeysAndGetItem objects that are not + :class:`~collections.abc.Mapping`s the same way that + MutableMapping.update() does, before falling back to handling + the provided object as an iterable of pairs. + * All :meth:`~bidict.BidictBase.__init__`, + :meth:`~bidict.MutableBidict.update`, and related methods now + handle SupportsKeysAndGetItem objects that are not + :class:`~collections.abc.Mapping`s the same way that + MutableMapping.update() does, before falling back to handling + the provided object as an iterable of pairs. + * The :func:`repr` of ordered bidicts now matches that of + regular bidicts, e.g. OrderedBidict({1: 1}) rather than + OrderedBidict([(1, 1)]). (Accordingly, the + bidict.__repr_delegate__ field has been removed now that it's + no longer needed.) This tracks with the change to + :class:`collections.OrderedDict`'s :func:`repr` in Python + 3.12. + * The :func:`repr` of ordered bidicts now matches that of + regular bidicts, e.g. OrderedBidict({1: 1}) rather than + OrderedBidict([(1, 1)]). + * (Accordingly, the bidict.__repr_delegate__ field has been + removed now that it's no longer needed.) + * This tracks with the change to + :class:`collections.OrderedDict`'s :func:`repr` in Python + 3.12. + * Test with Python 3.12 in CI. Note: Older versions of bidict + also support Python 3.12, even though they don't explicitly + declare support for it. + * Test with Python 3.12 in CI. + * Note: Older versions of bidict also support Python 3.12, even + though they don't explicitly declare support for it. + * Drop use of Trove classifiers that declare support for + specific Python versions in package metadata. + * Drop use of Trove classifiers that declare support for + specific Python versions in package metadata. +- drop support-python-312.patch (upstream) + ------------------------------------------------------------------- Tue Feb 6 05:38:41 UTC 2024 - Steve Kowalik @@ -128,7 +224,7 @@ Tue Sep 1 04:48:00 UTC 2020 - Steve Kowalik * Add bidict.MutableBidirectionalMapping ABC * Drop Python 3.5 support * Remove bidict.compat module - * Remove APIs deprecated in previous releases + * Remove APIs deprecated in previous releases - Drop dont-limit-versions.patch, included upstream ------------------------------------------------------------------- diff --git a/python-bidict.spec b/python-bidict.spec index f38b96f..a0801e2 100644 --- a/python-bidict.spec +++ b/python-bidict.spec @@ -18,27 +18,27 @@ %{?sle15_python_module_pythons} Name: python-bidict -Version: 0.22.1 +Version: 0.23.1 Release: 0 Summary: Bidirectional map implementation for Python License: MPL-2.0 URL: https://github.com/jab/bidict Source: https://github.com/jab/bidict/archive/refs/tags/v%{version}.tar.gz#/bidict-%{version}-gh.tar.gz -# PATCH-FIX-OPENSUSE Upstream has since rewritten the test suite, drop on update -Patch0: support-python-312.patch BuildRequires: %{python_module base >= 3.7} BuildRequires: %{python_module pip} BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros +Requires: python-typing-extensions +BuildArch: noarch # SECTION test requirements +BuildRequires: %{python_module sortedcollections} BuildRequires: %{python_module hypothesis >= 3.6.1} BuildRequires: %{python_module pytest >= 3.0.7} BuildRequires: %{python_module pytest-benchmark >= 3.1.0a1} BuildRequires: %{python_module pytest-xdist} +BuildRequires: %{python_module typing-extensions} # /SECTION -BuildArch: noarch - %python_subpackages %description diff --git a/support-python-312.patch b/support-python-312.patch deleted file mode 100644 index f3eaab4..0000000 --- a/support-python-312.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: bidict-0.22.1/tests/test_class_relationships.py -=================================================================== ---- bidict-0.22.1.orig/tests/test_class_relationships.py -+++ bidict-0.22.1/tests/test_class_relationships.py -@@ -123,7 +123,7 @@ def test_issubclass_internal() -> None: - - def test_abstract_bimap_init_fails() -> None: - """Instantiating `AbstractBimap` should fail with expected TypeError.""" -- excmatch = r"Can't instantiate abstract class AbstractBimap with abstract methods .* inverse" -+ excmatch = r"Can't instantiate abstract class AbstractBimap with.*abstract methods .*inverse" - with pytest.raises(TypeError, match=excmatch): - AbstractBimap() # type: ignore -