Hello community, here is the log from the commit of package python-tinydb for openSUSE:Factory checked in at 2020-10-13 15:41:54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-tinydb (Old) and /work/SRC/openSUSE:Factory/.python-tinydb.new.3486 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-tinydb" Tue Oct 13 15:41:54 2020 rev:8 rq:841139 version:4.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-tinydb/python-tinydb.changes 2020-09-29 19:05:41.222046787 +0200 +++ /work/SRC/openSUSE:Factory/.python-tinydb.new.3486/python-tinydb.changes 2020-10-13 15:43:35.345396444 +0200 @@ -1,0 +2,9 @@ +Sat Oct 10 18:44:41 UTC 2020 - Arun Persaud <a...@gmx.de> + +- update to version 4.2.0: + * Feature: Add support for specifying document IDs during insertion + (see issue 303) + * Internal change: Use OrderedDict.move_to_end() in the query cache + (see issue 338) + +------------------------------------------------------------------- Old: ---- tinydb-4.1.1.tar.gz New: ---- tinydb-4.2.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-tinydb.spec ++++++ --- /var/tmp/diff_new_pack.lx8UeS/_old 2020-10-13 15:43:35.973396715 +0200 +++ /var/tmp/diff_new_pack.lx8UeS/_new 2020-10-13 15:43:35.977396717 +0200 @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-tinydb -Version: 4.1.1 +Version: 4.2.0 Release: 0 Summary: A document-oriented database License: MIT ++++++ tinydb-4.1.1.tar.gz -> tinydb-4.2.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tinydb-4.1.1/LICENSE new/tinydb-4.2.0/LICENSE --- old/tinydb-4.1.1/LICENSE 2017-01-16 12:29:58.000000000 +0100 +++ new/tinydb-4.2.0/LICENSE 2020-10-03 16:59:11.341498100 +0200 @@ -1,7 +1,7 @@ -Copyright (C) 2013 Markus Siemens <mar...@m-siemens.de> - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +Copyright (C) 2013 Markus Siemens <mar...@m-siemens.de> + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tinydb-4.1.1/PKG-INFO new/tinydb-4.2.0/PKG-INFO --- old/tinydb-4.1.1/PKG-INFO 2020-05-08 16:36:38.860000000 +0200 +++ new/tinydb-4.2.0/PKG-INFO 2020-10-03 16:59:35.037635000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: tinydb -Version: 4.1.1 +Version: 4.2.0 Summary: TinyDB is a tiny, document oriented database optimized for your happiness :) Home-page: https://github.com/msiemens/tinydb License: MIT @@ -18,6 +18,7 @@ Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Classifier: Topic :: Database diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tinydb-4.1.1/pyproject.toml new/tinydb-4.2.0/pyproject.toml --- old/tinydb-4.1.1/pyproject.toml 2020-05-08 09:42:55.000000000 +0200 +++ new/tinydb-4.2.0/pyproject.toml 2020-10-03 16:59:11.345498000 +0200 @@ -1,6 +1,6 @@ [tool.poetry] name = "tinydb" -version = "4.1.1" +version = "4.2.0" description = "TinyDB is a tiny, document oriented database optimized for your happiness :)" authors = ["Markus Siemens <mar...@m-siemens.de>"] license = "MIT" @@ -47,7 +47,6 @@ pycodestyle = "^2.5.0" sphinx = "^2.2.1" coveralls = "^1.8.2" -pytest-azurepipelines = "^0.8.0" pyyaml = "^5.1.2" pytest-mypy = { version = "^0.4.1", markers = "platform_python_implementation != 'PyPy'" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tinydb-4.1.1/setup.py new/tinydb-4.2.0/setup.py --- old/tinydb-4.1.1/setup.py 2020-05-08 16:36:38.860000000 +0200 +++ new/tinydb-4.2.0/setup.py 2020-10-03 16:59:35.037083600 +0200 @@ -9,9 +9,9 @@ setup_kwargs = { 'name': 'tinydb', - 'version': '4.1.1', + 'version': '4.2.0', 'description': 'TinyDB is a tiny, document oriented database optimized for your happiness :)', - 'long_description': ".. image:: https://raw.githubusercontent.com/msiemens/tinydb/master/artwork/logo.png\n :scale: 100%\n :height: 150px\n\n|Build Status| |Coverage| |Version|\n\nQuick Links\n***********\n\n- `Example Code`_\n- `Supported Python Versions`_\n- `Documentation <http://tinydb.readthedocs.org/>`_\n- `Changelog <https://tinydb.readthedocs.io/en/latest/changelog.html>`_\n- `Extensions <https://tinydb.readthedocs.io/en/latest/extensions.html>`_\n- `Contributing`_\n\nIntroduction\n************\n\nTinyDB is a lightweight document oriented database optimized for your happiness :)\nIt's written in pure Python and has no external dependencies. The target are\nsmall apps that would be blown away by a SQL-DB or an external database server.\n\nTinyDB is:\n\n- **tiny:** The current source code has 1800 lines of code (with about 40%\n documentation) and 1600 lines tests.\n\n- **document oriented:** Like MongoDB_, you can store any document\n (represented as ``dict``) in TinyDB.\n\n- **optimized for your happiness:** TinyDB is designed to be simple and\n fun to use by providing a simple and clean API.\n\n- **written in pure Python:** TinyDB neither needs an external server (as\n e.g. `PyMongo <https://api.mongodb.org/python/current/>`_) nor any dependencies\n from PyPI.\n\n- **works on Python 3.5+ and PyPy:** TinyDB works on all modern versions of Python\n and PyPy.\n\n- **powerfully extensible:** You can easily extend TinyDB by writing new\n storages or modify the behaviour of storages with Middlewares.\n\n- **100% test coverage:** No explanation needed.\n\nTo dive straight into all the details, head over to the `TinyDB docs\n<https://tinydb.readthedocs.io/>`_. You can also discuss everything related\nto TinyDB like general development, extensions or showcase your TinyDB-based\nprojects on the `discussion forum <http://forum.m-siemens.de/.>`_.\n\nSupported Python Versions\n*************************\n\nTinyDB has been tested with Python 3.5 - 3.8 and PyPy.\n\nExample Code\n************\n\n.. code-block:: python\n\n >>> from tinydb import TinyDB, Query\n >>> db = TinyDB('/path/to/db.json')\n >>> db.insert({'int': 1, 'char': 'a'})\n >>> db.insert({'int': 1, 'char': 'b'})\n\nQuery Language\n==============\n\n.. code-block:: python\n\n >>> User = Query()\n >>> # Search for a field value\n >>> db.search(User.name == 'John')\n [{'name': 'John', 'age': 22}, {'name': 'John', 'age': 37}]\n\n >>> # Combine two queries with logical and\n >>> db.search((User.name == 'John') & (User.age <= 30))\n [{'name': 'John', 'age': 22}]\n\n >>> # Combine two queries with logical or\n >>> db.search((User.name == 'John') | (User.name == 'Bob'))\n [{'name': 'John', 'age': 22}, {'name': 'John', 'age': 37}, {'name': 'Bob', 'age': 42}]\n\n >>> # More possible comparisons: != < > <= >=\n >>> # More possible checks: where(...).matches(regex), where(...).test(your_test_func)\n\nTables\n======\n\n.. code-block:: python\n\n >>> table = db.table('name')\n >>> table.insert({'value': True})\n >>> table.all()\n [{'value': True}]\n\nUsing Middlewares\n=================\n\n.. code-block:: python\n\n >>> from tinydb.storages import JSONStorage\n >>> from tinydb.middlewares import CachingMiddleware\n >>> db = TinyDB('/path/to/db.json', storage=CachingMiddleware(JSONStorage))\n\n\nContributing\n************\n\nWhether reporting bugs, discussing improvements and new ideas or writing\nextensions: Contributions to TinyDB are welcome! Here's how to get started:\n\n1. Check for open issues or open a fresh issue to start a discussion around\n a feature idea or a bug\n2. Fork `the repository <https://github.com/msiemens/tinydb/>`_ on Github,\n create a new branch off the `master` branch and start making your changes\n (known as `GitHub Flow <https://guides.github.com/introduction/flow/index.html>`_)\n3. Write a test which shows that the bug was fixed or that the feature works\n as expected\n4. Send a pull request and bug the maintainer until it gets merged and\n published \xe2\x98\xba\n\n.. |Build Status| image:: https://img.shields.io/azure-devops/build/msiemens/3e5baa75-12ec-43ac-9728-89823ee8c7e2/2.svg?style=flat-square\n :target: https://dev.azure.com/msiemens/github/_build?definitionId=2\n.. |Coverage| image:: http://img.shields.io/coveralls/msiemens/tinydb.svg?style=flat-square\n :target: https://coveralls.io/r/msiemens/tinydb\n.. |Version| image:: http://img.shields.io/pypi/v/tinydb.svg?style=flat-square\n :target: https://pypi.python.org/pypi/tinydb/\n.. _Buzhug: http://buzhug.sourceforge.net/\n.. _CodernityDB: https://github.com/perchouli/codernitydb\n.. _MongoDB: http://mongodb.org/\n", + 'long_description': ".. image:: https://raw.githubusercontent.com/msiemens/tinydb/master/artwork/logo.png\n :scale: 100%\n :height: 150px\n\n|Build Status| |Coverage| |Version|\n\nQuick Links\n***********\n\n- `Example Code`_\n- `Supported Python Versions`_\n- `Documentation <http://tinydb.readthedocs.org/>`_\n- `Changelog <https://tinydb.readthedocs.io/en/latest/changelog.html>`_\n- `Extensions <https://tinydb.readthedocs.io/en/latest/extensions.html>`_\n- `Contributing`_\n\nIntroduction\n************\n\nTinyDB is a lightweight document oriented database optimized for your happiness :)\nIt's written in pure Python and has no external dependencies. The target are\nsmall apps that would be blown away by a SQL-DB or an external database server.\n\nTinyDB is:\n\n- **tiny:** The current source code has 1800 lines of code (with about 40%\n documentation) and 1600 lines tests.\n\n- **document oriented:** Like MongoDB_, you can store any document\n (represented as ``dict``) in TinyDB.\n\n- **optimized for your happiness:** TinyDB is designed to be simple and\n fun to use by providing a simple and clean API.\n\n- **written in pure Python:** TinyDB neither needs an external server (as\n e.g. `PyMongo <https://api.mongodb.org/python/current/>`_) nor any dependencies\n from PyPI.\n\n- **works on Python 3.5+ and PyPy:** TinyDB works on all modern versions of Python\n and PyPy.\n\n- **powerfully extensible:** You can easily extend TinyDB by writing new\n storages or modify the behaviour of storages with Middlewares.\n\n- **100% test coverage:** No explanation needed.\n\nTo dive straight into all the details, head over to the `TinyDB docs\n<https://tinydb.readthedocs.io/>`_. You can also discuss everything related\nto TinyDB like general development, extensions or showcase your TinyDB-based\nprojects on the `discussion forum <http://forum.m-siemens.de/.>`_.\n\nSupported Python Versions\n*************************\n\nTinyDB has been tested with Python 3.5 - 3.8 and PyPy.\n\nExample Code\n************\n\n.. code-block:: python\n\n >>> from tinydb import TinyDB, Query\n >>> db = TinyDB('/path/to/db.json')\n >>> db.insert({'int': 1, 'char': 'a'})\n >>> db.insert({'int': 1, 'char': 'b'})\n\nQuery Language\n==============\n\n.. code-block:: python\n\n >>> User = Query()\n >>> # Search for a field value\n >>> db.search(User.name == 'John')\n [{'name': 'John', 'age': 22}, {'name': 'John', 'age': 37}]\n\n >>> # Combine two queries with logical and\n >>> db.search((User.name == 'John') & (User.age <= 30))\n [{'name': 'John', 'age': 22}]\n\n >>> # Combine two queries with logical or\n >>> db.search((User.name == 'John') | (User.name == 'Bob'))\n [{'name': 'John', 'age': 22}, {'name': 'John', 'age': 37}, {'name': 'Bob', 'age': 42}]\n\n >>> # More possible comparisons: != < > <= >=\n >>> # More possible checks: where(...).matches(regex), where(...).test(your_test_func)\n\nTables\n======\n\n.. code-block:: python\n\n >>> table = db.table('name')\n >>> table.insert({'value': True})\n >>> table.all()\n [{'value': True}]\n\nUsing Middlewares\n=================\n\n.. code-block:: python\n\n >>> from tinydb.storages import JSONStorage\n >>> from tinydb.middlewares import CachingMiddleware\n >>> db = TinyDB('/path/to/db.json', storage=CachingMiddleware(JSONStorage))\n\n\nContributing\n************\n\nWhether reporting bugs, discussing improvements and new ideas or writing\nextensions: Contributions to TinyDB are welcome! Here's how to get started:\n\n1. Check for open issues or open a fresh issue to start a discussion around\n a feature idea or a bug\n2. Fork `the repository <https://github.com/msiemens/tinydb/>`_ on Github,\n create a new branch off the `master` branch and start making your changes\n (known as `GitHub Flow <https://guides.github.com/introduction/flow/index.html>`_)\n3. Write a test which shows that the bug was fixed or that the feature works\n as expected\n4. Send a pull request and bug the maintainer until it gets merged and\n published ☺\n\n.. |Build Status| image:: https://img.shields.io/azure-devops/build/msiemens/3e5baa75-12ec-43ac-9728-89823ee8c7e2/2.svg?style=flat-square\n :target: https://dev.azure.com/msiemens/github/_build?definitionId=2\n.. |Coverage| image:: http://img.shields.io/coveralls/msiemens/tinydb.svg?style=flat-square\n :target: https://coveralls.io/r/msiemens/tinydb\n.. |Version| image:: http://img.shields.io/pypi/v/tinydb.svg?style=flat-square\n :target: https://pypi.python.org/pypi/tinydb/\n.. _Buzhug: http://buzhug.sourceforge.net/\n.. _CodernityDB: https://github.com/perchouli/codernitydb\n.. _MongoDB: http://mongodb.org/\n", 'author': 'Markus Siemens', 'author_email': 'mar...@m-siemens.de', 'maintainer': None, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tinydb-4.1.1/tinydb/operations.py new/tinydb-4.2.0/tinydb/operations.py --- old/tinydb-4.1.1/tinydb/operations.py 2020-05-07 18:56:39.000000000 +0200 +++ new/tinydb-4.2.0/tinydb/operations.py 2020-10-03 16:59:11.345498000 +0200 @@ -3,7 +3,7 @@ They are used for updates like this: ->>> db.update(delete('foo'), where('foo') == 2 +>>> db.update(delete('foo'), where('foo') == 2) This would delete the ``foo`` field from all documents where ``foo`` equals 2. """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tinydb-4.1.1/tinydb/table.py new/tinydb-4.2.0/tinydb/table.py --- old/tinydb-4.1.1/tinydb/table.py 2020-05-07 18:56:39.000000000 +0200 +++ new/tinydb-4.2.0/tinydb/table.py 2020-10-03 16:59:11.345498000 +0200 @@ -146,10 +146,21 @@ raise ValueError('Document is not a Mapping') # First, we get the document ID for the new document - doc_id = self._get_next_id() + if isinstance(document, Document): + # For a `Document` object we use the specified ID + doc_id = document.doc_id + + # We also reset the stored next ID so the next insert won't + # re-use document IDs by accident when storing an old value + self._next_id = None + else: + # In all other cases we use the next free ID + doc_id = self._get_next_id() # Now, we update the table and add the document def updater(table: dict): + assert doc_id not in table, 'doc_id '+str(doc_id)+' already exists' + # By calling ``dict(document)`` we convert the data we got to a # ``dict`` instance even if it was a different class that # implemented the ``Mapping`` interface diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tinydb-4.1.1/tinydb/utils.py new/tinydb-4.2.0/tinydb/utils.py --- old/tinydb-4.1.1/tinydb/utils.py 2020-05-07 18:56:39.000000000 +0200 +++ new/tinydb-4.2.0/tinydb/utils.py 2020-10-03 16:59:11.345498000 +0200 @@ -67,9 +67,7 @@ value = self.cache.get(key) if value is not None: - # Move the entry to the front by re-inserting it - del self.cache[key] - self.cache[key] = value + self.cache.move_to_end(key, last=True) return value @@ -77,9 +75,8 @@ def set(self, key: K, value: V): if self.cache.get(key): - # Move the entry to the front by re-inserting it - del self.cache[key] - self.cache[key] = value + self.cache.move_to_end(key, last=True) + else: self.cache[key] = value diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tinydb-4.1.1/tinydb/version.py new/tinydb-4.2.0/tinydb/version.py --- old/tinydb-4.1.1/tinydb/version.py 2020-05-08 09:42:49.000000000 +0200 +++ new/tinydb-4.2.0/tinydb/version.py 2020-10-03 16:59:11.345498000 +0200 @@ -1 +1 @@ -__version__ = '4.1.1' +__version__ = '4.2.0'