Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-tomlkit for openSUSE:Factory checked in at 2022-11-12 17:40:20 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-tomlkit (Old) and /work/SRC/openSUSE:Factory/.python-tomlkit.new.1597 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-tomlkit" Sat Nov 12 17:40:20 2022 rev:11 rq:1035274 version:0.11.6 Changes: -------- --- /work/SRC/openSUSE:Factory/python-tomlkit/python-tomlkit.changes 2022-10-04 20:37:16.756878217 +0200 +++ /work/SRC/openSUSE:Factory/.python-tomlkit.new.1597/python-tomlkit.changes 2022-11-12 17:40:30.941934582 +0100 @@ -1,0 +2,8 @@ +Wed Nov 9 19:31:14 UTC 2022 - Yogalakshmi Arunachalam <yarunacha...@suse.com> + +- Update to 0.11.6 + Fixed + * Allow broader type for toml file path value (#243) + * Auto-determine if a table is a super table if not specified explicitly. (#245) + +------------------------------------------------------------------- Old: ---- tomlkit-0.11.5.tar.gz New: ---- tomlkit-0.11.6.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-tomlkit.spec ++++++ --- /var/tmp/diff_new_pack.6laLY9/_old 2022-11-12 17:40:31.941940535 +0100 +++ /var/tmp/diff_new_pack.6laLY9/_new 2022-11-12 17:40:31.941940535 +0100 @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-tomlkit -Version: 0.11.5 +Version: 0.11.6 Release: 0 Summary: Style preserving TOML library License: MIT ++++++ tomlkit-0.11.5.tar.gz -> tomlkit-0.11.6.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tomlkit-0.11.5/CHANGELOG.md new/tomlkit-0.11.6/CHANGELOG.md --- old/tomlkit-0.11.5/CHANGELOG.md 2022-09-28 03:52:14.099740500 +0200 +++ new/tomlkit-0.11.6/CHANGELOG.md 2022-10-27 10:20:48.030500700 +0200 @@ -2,6 +2,13 @@ ## [Unreleased] +## [0.11.6] - 2022-10-27 + +### Fixed + +- Allow broader type for toml file path value ([#243](https://github.com/sdispater/tomlkit/issues/243)) +- Auto-determine if a table is a super table if not specified explicitly. ([#245](https://github.com/sdispater/tomlkit/issues/245)) + ## [0.11.5] - 2022-09-28 ### Fixed @@ -322,7 +329,8 @@ - Fixed handling of super tables with different sections. - Fixed raw strings escaping. -[unreleased]: https://github.com/sdispater/tomlkit/compare/0.11.5...master +[unreleased]: https://github.com/sdispater/tomlkit/compare/0.11.6...master +[0.11.6]: https://github.com/sdispater/tomlkit/releases/tag/0.11.6 [0.11.5]: https://github.com/sdispater/tomlkit/releases/tag/0.11.5 [0.11.4]: https://github.com/sdispater/tomlkit/releases/tag/0.11.4 [0.11.3]: https://github.com/sdispater/tomlkit/releases/tag/0.11.3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tomlkit-0.11.5/PKG-INFO new/tomlkit-0.11.6/PKG-INFO --- old/tomlkit-0.11.5/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 +++ new/tomlkit-0.11.6/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 @@ -1,12 +1,12 @@ Metadata-Version: 2.1 Name: tomlkit -Version: 0.11.5 +Version: 0.11.6 Summary: Style preserving TOML library Home-page: https://github.com/sdispater/tomlkit License: MIT Author: Sébastien Eustace Author-email: sebast...@eustace.io -Requires-Python: >=3.6,<4.0 +Requires-Python: >=3.6 Classifier: License :: OSI Approved :: MIT License Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.6 @@ -14,6 +14,7 @@ Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 Project-URL: Repository, https://github.com/sdispater/tomlkit Description-Content-Type: text/markdown diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tomlkit-0.11.5/pyproject.toml new/tomlkit-0.11.6/pyproject.toml --- old/tomlkit-0.11.5/pyproject.toml 2022-09-28 03:52:14.099740500 +0200 +++ new/tomlkit-0.11.6/pyproject.toml 2022-10-27 10:20:48.030500700 +0200 @@ -1,6 +1,6 @@ [tool.poetry] name = "tomlkit" -version = "0.11.5" +version = "0.11.6" description = "Style preserving TOML library" authors = ["Sébastien Eustace <sebast...@eustace.io>"] license = "MIT" @@ -18,7 +18,7 @@ ] [tool.poetry.dependencies] -python = "^3.6" +python = ">=3.6" [tool.poetry.dev-dependencies] pytest = "^6.2.5" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tomlkit-0.11.5/setup.py new/tomlkit-0.11.6/setup.py --- old/tomlkit-0.11.5/setup.py 1970-01-01 01:00:00.000000000 +0100 +++ new/tomlkit-0.11.6/setup.py 1970-01-01 01:00:00.000000000 +0100 @@ -9,7 +9,7 @@ setup_kwargs = { 'name': 'tomlkit', - 'version': '0.11.5', + 'version': '0.11.6', 'description': 'Style preserving TOML library', 'long_description': '[github_release]: https://img.shields.io/github/release/sdispater/tomlkit.svg?logo=github&logoColor=white\n[pypi_version]: https://img.shields.io/pypi/v/tomlkit.svg?logo=python&logoColor=white\n[python_versions]: https://img.shields.io/pypi/pyversions/tomlkit.svg?logo=python&logoColor=white\n[github_license]: https://img.shields.io/github/license/sdispater/tomlkit.svg?logo=github&logoColor=white\n[github_action]: https://github.com/sdispater/tomlkit/actions/workflows/tests.yml/badge.svg\n\n[![GitHub Release][github_release]](https://github.com/sdispater/tomlkit/releases/)\n[![PyPI Version][pypi_version]](https://pypi.org/project/tomlkit/)\n[![Python Versions][python_versions]](https://pypi.org/project/tomlkit/)\n[![License][github_license]](https://github.com/sdispater/tomlkit/blob/master/LICENSE)\n<br>\n[![Tests][github_action]](https://github.com/sdispater/tomlkit/actions/workflows/tests.yml)\n\n# TOML Kit - Style-preserving TOML library for Python\n\nTOML Kit is a **1.0.0-compliant** [TOML](https://toml.io/) library.\n\nIt includes a parser that preserves all comments, indentations, whitespace and internal element ordering,\nand makes them accessible and editable via an intuitive API.\n\nYou can also create new TOML documents from scratch using the provided helpers.\n\nPart of the implementation has been adapted, improved and fixed from [Molten](https://github.com/LeopoldArkham/Molten).\n\n## Usage\n\nSee the [documentation](https://github.com/sdispater/tomlkit/blob/master/docs/quickstart.rst) for more information.\n\n## Installation\n\nIf you are using [Poetry](https://poetry.eustace.io),\nadd `tomlkit` to your `pyproject.toml` file by using:\n\n```bash\npoetry add tomlkit\n```\n\nIf not, you can use `pip`:\n\n```bash\npip install tomlkit\n```\n\n## Running tests\n\nPlease clone the repo with submodules with the following command\n`git clone --recurse-submodules https://github.com/sdispater/tomlkit.git`.\nWe need the submodule - `t oml-test` for running the tests.\n\nYou can run the tests with `poetry run pytest -q tests`\n', 'author': 'Sébastien Eustace', @@ -19,7 +19,7 @@ 'url': 'https://github.com/sdispater/tomlkit', 'packages': packages, 'package_data': package_data, - 'python_requires': '>=3.6,<4.0', + 'python_requires': '>=3.6', } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tomlkit-0.11.5/tests/test_items.py new/tomlkit-0.11.6/tests/test_items.py --- old/tomlkit-0.11.5/tests/test_items.py 2022-09-28 03:52:14.099740500 +0200 +++ new/tomlkit-0.11.6/tests/test_items.py 2022-10-27 10:20:48.030500700 +0200 @@ -887,3 +887,11 @@ classifiers = result["tool"]["poetry"]["classifiers"] new = copy.copy(classifiers) assert new == classifiers + + +@pytest.mark.parametrize( + "key_str,escaped", + [("\\", '"\\\\"'), ('"', '"\\""'), ("\t", '"\\t"'), ("\x10", '"\\u0010"')], +) +def test_escape_key(key_str, escaped): + assert api.key(key_str).as_string() == escaped diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tomlkit-0.11.5/tomlkit/__init__.py new/tomlkit-0.11.6/tomlkit/__init__.py --- old/tomlkit-0.11.5/tomlkit/__init__.py 2022-09-28 03:52:14.115740500 +0200 +++ new/tomlkit-0.11.6/tomlkit/__init__.py 2022-10-27 10:20:48.046501400 +0200 @@ -25,7 +25,7 @@ from tomlkit.api import ws -__version__ = "0.11.5" +__version__ = "0.11.6" __all__ = [ "aot", "array", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tomlkit-0.11.5/tomlkit/_utils.py new/tomlkit-0.11.6/tomlkit/_utils.py --- old/tomlkit-0.11.5/tomlkit/_utils.py 2022-09-28 03:52:14.115740500 +0200 +++ new/tomlkit-0.11.6/tomlkit/_utils.py 2022-10-27 10:20:48.046501400 +0200 @@ -113,7 +113,7 @@ **{v: f"\\{k}" for k, v in _escaped.items()}, '"""': '""\\"', } -_basic_escapes = CONTROL_CHARS | {'"'} +_basic_escapes = CONTROL_CHARS | {'"', "\\"} def _unicode_escape(seq: str) -> str: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tomlkit-0.11.5/tomlkit/api.py new/tomlkit-0.11.6/tomlkit/api.py --- old/tomlkit-0.11.5/tomlkit/api.py 2022-09-28 03:52:14.115740500 +0200 +++ new/tomlkit-0.11.6/tomlkit/api.py 2022-10-27 10:20:48.046501400 +0200 @@ -3,6 +3,7 @@ from collections.abc import Mapping from typing import IO from typing import Iterable +from typing import Optional from typing import Tuple from typing import Union @@ -174,7 +175,7 @@ return value(raw) -def table(is_super_table: bool = False) -> Table: +def table(is_super_table: Optional[bool] = None) -> Table: """Create an empty table. :param is_super_table: if true, the table is a super table diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tomlkit-0.11.5/tomlkit/items.py new/tomlkit-0.11.6/tomlkit/items.py --- old/tomlkit-0.11.5/tomlkit/items.py 2022-09-28 03:52:14.115740500 +0200 +++ new/tomlkit-0.11.6/tomlkit/items.py 2022-10-27 10:20:48.046501400 +0200 @@ -179,10 +179,6 @@ key=lambda i: (isinstance(i[1], dict), i[0] if _sort_keys else 1), ): val[k] = item(v, _parent=val, _sort_keys=_sort_keys) - only_child = val[next(iter(value))] if len(value) == 1 else None - if table_constructor is Table and isinstance(only_child, (AoT, Table)): - # The table becomes super table if the only child is a table or AoT. - val._is_super_table = True return val elif isinstance(value, (list, tuple)): @@ -1553,7 +1549,7 @@ value: "container.Container", trivia: Trivia, is_aot_element: bool, - is_super_table: bool = False, + is_super_table: Optional[bool] = None, name: Optional[str] = None, display_name: Optional[str] = None, ) -> None: @@ -1632,7 +1628,13 @@ def is_super_table(self) -> bool: """A super table is the intermediate parent of a nested table as in [a.b.c]. If true, it won't appear in the TOML representation.""" - return self._is_super_table + if self._is_super_table is not None: + return self._is_super_table + # If the table has only one child and that child is a table, then it is a super table. + if len(self) != 1: + return False + only_child = next(iter(self.values())) + return isinstance(only_child, (Table, AoT)) def as_string(self) -> str: return self._value.as_string() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tomlkit-0.11.5/tomlkit/parser.py new/tomlkit-0.11.6/tomlkit/parser.py --- old/tomlkit-0.11.5/tomlkit/parser.py 2022-09-28 03:52:14.115740500 +0200 +++ new/tomlkit-0.11.6/tomlkit/parser.py 2022-10-27 10:20:48.046501400 +0200 @@ -948,6 +948,7 @@ is_aot, name=name_parts[0].key if name_parts else key.key, display_name=full_key.as_string(), + is_super_table=False, ) if len(name_parts) > 1: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tomlkit-0.11.5/tomlkit/toml_file.py new/tomlkit-0.11.6/tomlkit/toml_file.py --- old/tomlkit-0.11.5/tomlkit/toml_file.py 2022-09-28 03:52:14.115740500 +0200 +++ new/tomlkit-0.11.6/tomlkit/toml_file.py 2022-10-27 10:20:48.046501400 +0200 @@ -1,10 +1,20 @@ import os import re +from typing import TYPE_CHECKING + from tomlkit.api import loads from tomlkit.toml_document import TOMLDocument +if TYPE_CHECKING: + from _typeshed import StrPath as _StrPath +else: + from typing import Union + + _StrPath = Union[str, os.PathLike] + + class TOMLFile: """ Represents a TOML file. @@ -12,7 +22,7 @@ :param path: path to the TOML file """ - def __init__(self, path: str) -> None: + def __init__(self, path: _StrPath) -> None: self._path = path self._linesep = os.linesep