Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-pytoolconfig for openSUSE:Factory checked in at 2024-03-17 22:15:02 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pytoolconfig (Old) and /work/SRC/openSUSE:Factory/.python-pytoolconfig.new.1905 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pytoolconfig" Sun Mar 17 22:15:02 2024 rev:4 rq:1158464 version:1.3.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pytoolconfig/python-pytoolconfig.changes 2024-01-06 18:41:12.141617119 +0100 +++ /work/SRC/openSUSE:Factory/.python-pytoolconfig.new.1905/python-pytoolconfig.changes 2024-03-17 22:15:25.779124320 +0100 @@ -1,0 +2,11 @@ +Sat Mar 16 11:57:12 UTC 2024 - Dirk Müller <dmuel...@suse.com> + +- update to 1.3.1: + * Drop 3.7 support + * do sys path hack +- update to 1.3.0: + * Enum Support + * Use trusted publishing + * deduplicate ci + +------------------------------------------------------------------- Old: ---- pytoolconfig-1.2.6.tar.gz New: ---- pytoolconfig-1.3.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pytoolconfig.spec ++++++ --- /var/tmp/diff_new_pack.GDv8w8/_old 2024-03-17 22:15:26.299143342 +0100 +++ /var/tmp/diff_new_pack.GDv8w8/_new 2024-03-17 22:15:26.299143342 +0100 @@ -18,14 +18,14 @@ %{?sle15_python_module_pythons} Name: python-pytoolconfig -Version: 1.2.6 +Version: 1.3.1 Release: 0 Summary: Python tool configuration License: LGPL-3.0-or-later URL: https://github.com/bagel897/pytoolconfig Source: https://files.pythonhosted.org/packages/source/p/pytoolconfig/pytoolconfig-%{version}.tar.gz -BuildRequires: %{python_module base >= 3.7} -BuildRequires: %{python_module packaging >= 22} +BuildRequires: %{python_module base >= 3.8} +BuildRequires: %{python_module packaging >= 23.2} BuildRequires: %{python_module pdm-backend} BuildRequires: %{python_module pip} BuildRequires: %{python_module tomli >= 2.0.1 if %python-base < 3.11} @@ -41,11 +41,11 @@ Requires: python-typing-extensions >= 4.4.0 %endif # SECTION test -BuildRequires: %{python_module Sphinx >= 4.5.0} -BuildRequires: %{python_module platformdirs > 1.4.4} -BuildRequires: %{python_module pydantic >= 1.7.4} +BuildRequires: %{python_module Sphinx >= 7.1.2} +BuildRequires: %{python_module platformdirs >= 3.11.0 } +BuildRequires: %{python_module pydantic >= 2.5.3} BuildRequires: %{python_module pytest} -BuildRequires: %{python_module tabulate >= 0.8.9} +BuildRequires: %{python_module tabulate >= 0.9.0} # /SECTION %python_subpackages @@ -57,7 +57,7 @@ %package global Summary: [global] extra for %{python_flavor}-pytoolconfig -Requires: python-platformdirs >= 1.4.4 +Requires: python-platformdirs >= 3.11.0 Requires: python-pytoolconfig = %{version} %description global @@ -65,7 +65,7 @@ %package validation Summary: [validation] extra for %{python_flavor}-pytoolconfig -Requires: python-pydantic >= 1.7.4 +Requires: python-pydantic >= 2.5.3 Requires: python-pytoolconfig = %{version} %description validation ++++++ pytoolconfig-1.2.6.tar.gz -> pytoolconfig-1.3.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytoolconfig-1.2.6/PKG-INFO new/pytoolconfig-1.3.1/PKG-INFO --- old/pytoolconfig-1.2.6/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 +++ new/pytoolconfig-1.3.1/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 @@ -1,21 +1,20 @@ Metadata-Version: 2.1 Name: pytoolconfig -Version: 1.2.6 +Version: 1.3.1 Summary: Python tool configuration Author-Email: bageljr <bageljr...@protonmail.com> License: LGPL-3.0-or-later Project-URL: Homepage, https://github.com/bageljrkhanofemus/pytoolconfig -Requires-Python: >=3.7 +Requires-Python: >=3.8 Requires-Dist: tomli>=2.0.1; python_version < "3.11" -Requires-Dist: packaging>=22.0 -Requires-Dist: typing-extensions>=4.4.0; python_version < "3.8" -Requires-Dist: pydantic>=1.7.4; extra == "validation" -Requires-Dist: platformdirs>=1.4.4; extra == "global" -Requires-Dist: tabulate>=0.8.9; extra == "doc" -Requires-Dist: sphinx>=4.5.0; extra == "doc" -Requires-Dist: sphinx>=4.5.0; extra == "gendocs" -Requires-Dist: sphinx-autodoc-typehints>=1.18.1; extra == "gendocs" -Requires-Dist: sphinx-rtd-theme>=1.0.0; extra == "gendocs" +Requires-Dist: packaging>=23.2 +Requires-Dist: pydantic>=2.5.3; extra == "validation" +Requires-Dist: platformdirs>=3.11.0; extra == "global" +Requires-Dist: tabulate>=0.9.0; extra == "doc" +Requires-Dist: sphinx>=7.1.2; extra == "doc" +Requires-Dist: sphinx>=7.1.2; extra == "gendocs" +Requires-Dist: sphinx-autodoc-typehints>=1.25.2; extra == "gendocs" +Requires-Dist: sphinx-rtd-theme>=2.0.0; extra == "gendocs" Requires-Dist: pytoolconfig[doc]; extra == "gendocs" Provides-Extra: validation Provides-Extra: global @@ -30,7 +29,7 @@ The goal of this project is to manage configuration for python tools, such as rope and add support for a pyproject.toml configuration file. [Documentation](https://pytoolconfig.readthedocs.io/en/latest/) This library -only supports python 3.7 to 3.11. 3.12 plus may work, but isn't tested. +only supports python 3.8 to 3.12. 3.13+ may work, but isn't tested. ## Development diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytoolconfig-1.2.6/README.md new/pytoolconfig-1.3.1/README.md --- old/pytoolconfig-1.2.6/README.md 2023-09-16 20:15:01.532572000 +0200 +++ new/pytoolconfig-1.3.1/README.md 2024-01-11 17:24:56.724668300 +0100 @@ -5,7 +5,7 @@ The goal of this project is to manage configuration for python tools, such as rope and add support for a pyproject.toml configuration file. [Documentation](https://pytoolconfig.readthedocs.io/en/latest/) This library -only supports python 3.7 to 3.11. 3.12 plus may work, but isn't tested. +only supports python 3.8 to 3.12. 3.13+ may work, but isn't tested. ## Development diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytoolconfig-1.2.6/pyproject.toml new/pytoolconfig-1.3.1/pyproject.toml --- old/pytoolconfig-1.2.6/pyproject.toml 2023-10-15 00:00:21.084315800 +0200 +++ new/pytoolconfig-1.3.1/pyproject.toml 2024-01-11 17:25:08.704626800 +0100 @@ -4,15 +4,14 @@ description = "Python tool configuration" dependencies = [ "tomli>=2.0.1; python_version < \"3.11\"", - "packaging>=22.0", - "typing-extensions>=4.4.0; python_version < \"3.8\"", + "packaging>=23.2", ] -requires-python = ">=3.7" +requires-python = ">=3.8" readme = "README.md" authors = [ { name = "bageljr", email = "bageljr...@protonmail.com" }, ] -version = "1.2.6" +version = "1.3.1" [project.license] text = "LGPL-3.0-or-later" @@ -22,19 +21,19 @@ [project.optional-dependencies] validation = [ - "pydantic>=1.7.4", + "pydantic>=2.5.3", ] global = [ - "platformdirs>=1.4.4", + "platformdirs>=3.11.0", ] doc = [ - "tabulate>=0.8.9", - "sphinx>=4.5.0", + "tabulate>=0.9.0", + "sphinx>=7.1.2", ] gendocs = [ - "sphinx>=4.5.0", - "sphinx-autodoc-typehints>=1.18.1", - "sphinx-rtd-theme>=1.0.0", + "sphinx>=7.1.2", + "sphinx-autodoc-typehints>=1.25.2", + "sphinx-rtd-theme>=2.0.0", "pytoolconfig[doc]", ] @@ -43,16 +42,16 @@ [tool.pdm.dev-dependencies] dev = [ - "pytest>=7.2.0", - "mypy>=0.991", - "types-tabulate>=0.9.0.2", - "tox>=4.0.8", - "tox-pdm>=0.6.0", - "types-docutils>=0.19.1.9", - "tox-gh>=1.0.0", + "pytest>=7.4.4", + "mypy>=1.8.0", + "types-tabulate>=0.9.0.20240106", + "tox>=4.11.4", + "tox-pdm>=0.7.2", + "types-docutils>=0.20.0.20240106", + "tox-gh>=1.3.1", "pytest-emoji>=0.2.0", "pytest-md>=0.2.0", - "pydantic>=2.3.0", + "pydantic>=2.5.3", ] [tool.pytoolconfig] @@ -85,7 +84,7 @@ "SLF001", "FA100", ] -target-version = "py37" +target-version = "py38" force-exclude = true [tool.ruff.per-file-ignores] @@ -107,7 +106,7 @@ ] [tool.tox] -legacy_tox_ini = "[tox]\nenvlist = py37,py38, py39, py310, py311, py312\nisolated_build = True\n\n[gh-actions]\npython =\n 3.7: py37\n 3.8: py38\n 3.9: py39\n 3.10: py310\n 3.11: py311\n 3.12: py312\n[testenv]\nextras = doc, global\ngroups = dev\ncommands = pytest\n" +legacy_tox_ini = "[tox]\nmin_version = 4.0\nenvlist = py38, py39, py310, py311, py312\nisolated_build = True\n\n[gh-actions]\npython =\n 3.8: py38\n 3.9: py39\n 3.10: py310\n 3.11: py311\n 3.12: py312\n[testenv]\ngroups = dev, doc, global\ncommands = pytest\n" [tool.pylint.format] max-line-length = "88" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytoolconfig-1.2.6/src/pytoolconfig/documentation.py new/pytoolconfig-1.3.1/src/pytoolconfig/documentation.py --- old/pytoolconfig-1.2.6/src/pytoolconfig/documentation.py 2023-09-16 20:15:01.532572000 +0200 +++ new/pytoolconfig-1.3.1/src/pytoolconfig/documentation.py 2024-01-11 17:24:56.724668300 +0100 @@ -3,7 +3,6 @@ from __future__ import annotations -import sys from dataclasses import is_dataclass from typing import TYPE_CHECKING, Any, Generator @@ -15,6 +14,8 @@ from .pytoolconfig import PyToolConfig from .types import ConfigField +from typing import get_origin + from sphinx.ext.autodoc import ClassDocumenter from tabulate import tabulate @@ -22,11 +23,6 @@ from .sources import Source from .universal_config import UniversalConfig -if sys.version_info < (3, 8, 0): - from typing_extensions import get_origin -else: - from typing import get_origin - def _type_to_str(type_to_print: type[Any]) -> str | None: if type_to_print is None: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytoolconfig-1.2.6/src/pytoolconfig/fields.py new/pytoolconfig-1.3.1/src/pytoolconfig/fields.py --- old/pytoolconfig-1.2.6/src/pytoolconfig/fields.py 2023-09-16 20:15:01.532572000 +0200 +++ new/pytoolconfig-1.3.1/src/pytoolconfig/fields.py 2024-01-11 17:24:56.724668300 +0100 @@ -23,7 +23,7 @@ @overload -def field( # noqa: PLR0913 +def field( default: T, description: str | None = None, command_line: tuple[str] | None = None, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytoolconfig-1.2.6/src/pytoolconfig/utils.py new/pytoolconfig-1.3.1/src/pytoolconfig/utils.py --- old/pytoolconfig-1.2.6/src/pytoolconfig/utils.py 2023-09-16 20:15:01.534572100 +0200 +++ new/pytoolconfig-1.3.1/src/pytoolconfig/utils.py 2024-01-11 17:24:56.724668300 +0100 @@ -2,7 +2,9 @@ from __future__ import annotations import sys +import warnings from dataclasses import Field, fields, is_dataclass, replace +from enum import EnumMeta from pathlib import Path from typing import TYPE_CHECKING, Any, Generator, Mapping, TypeVar @@ -90,6 +92,12 @@ return {field.name: field for field in fields(dataclass) if field.init} +def _format_enum(option: Any) -> str: + if isinstance(option, str): + return f'"{option}"' + return str(option) + + def _dict_to_dataclass( dataclass: type[T], dictionary: Mapping[str, Key], @@ -103,7 +111,19 @@ assert isinstance(value, Mapping) filtered_arg_dict[key_name] = _dict_to_dataclass(sub_table, value) elif key_name in dataclass_fields: - filtered_arg_dict[key_name] = value + keytype = dataclass_fields[key_name].type + if isinstance(keytype, EnumMeta): + try: + filtered_arg_dict[key_name] = keytype(value) + except ValueError: + valid = set(keytype._value2member_map_.keys()) + warnings.warn( + f"{value} is not a valid option for {key_name}, skipping." + f"Valid options are: {','.join(map(_format_enum, valid))}.", + stacklevel=1, + ) + else: + filtered_arg_dict[key_name] = value return dataclass(**filtered_arg_dict) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytoolconfig-1.2.6/tests/configfiles/pyproject.toml new/pytoolconfig-1.3.1/tests/configfiles/pyproject.toml --- old/pytoolconfig-1.2.6/tests/configfiles/pyproject.toml 2023-09-16 20:15:01.534572100 +0200 +++ new/pytoolconfig-1.3.1/tests/configfiles/pyproject.toml 2024-01-11 17:24:56.728668200 +0100 @@ -4,28 +4,28 @@ [project] name = "tomli" -version = "2.0.1" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT +version = "2.0.1" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT description = "A lil' TOML parser" authors = [ - { name = "Taneli Hukkinen", email = "huk...@users.noreply.github.com" }, + { name = "Taneli Hukkinen", email = "huk...@users.noreply.github.com" }, ] license = { file = "LICENSE" } requires-python = ">=3.7" readme = "README.md" classifiers = [ - "License :: OSI Approved :: MIT License", - "Operating System :: MacOS", - "Operating System :: Microsoft :: Windows", - "Operating System :: POSIX :: Linux", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: Implementation :: CPython", - "Programming Language :: Python :: Implementation :: PyPy", - "Topic :: Software Development :: Libraries :: Python Modules", - "Typing :: Typed", + "License :: OSI Approved :: MIT License", + "Operating System :: MacOS", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX :: Linux", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", + "Topic :: Software Development :: Libraries :: Python Modules", + "Typing :: Typed", ] keywords = ["toml"] @@ -34,6 +34,10 @@ "Changelog" = "https://github.com/hukkin/tomli/blob/master/CHANGELOG.md" [tool.pytoolconfig] formatter = "black" +[tool.pytoolconfig2] +option2 = true +option1 = false +option3 = "alternate" [tool.fall_through] foo_other = "ba" [tool.isort] @@ -50,16 +54,9 @@ [project.optional-dependencies] -validation = [ - "pydantic>=1.7.4", -] -global = [ - "appdirs>=1.4.4", -] -doc = [ - "tabulate>=0.8.9", - "sphinx>=4.5.0", -] +validation = ["pydantic>=1.7.4"] +global = ["appdirs>=1.4.4"] +doc = ["tabulate>=0.8.9", "sphinx>=4.5.0"] [tool.tox] legacy_tox_ini = ''' [tox] @@ -135,12 +132,12 @@ [tool.coverage.report] # Regexes for lines to exclude from consideration exclude_lines = [ - # Re-enable the standard pragma (with extra strictness) - '# pragma: no cover\b', - # Code for static type checkers - 'if TYPE_CHECKING:', - # Scripts - 'if __name__ == .__main__.:', + # Re-enable the standard pragma (with extra strictness) + '# pragma: no cover\b', + # Code for static type checkers + 'if TYPE_CHECKING:', + # Scripts + 'if __name__ == .__main__.:', ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytoolconfig-1.2.6/tests/test_enum.py new/pytoolconfig-1.3.1/tests/test_enum.py --- old/pytoolconfig-1.2.6/tests/test_enum.py 1970-01-01 01:00:00.000000000 +0100 +++ new/pytoolconfig-1.3.1/tests/test_enum.py 2024-01-11 17:24:56.728668200 +0100 @@ -0,0 +1,25 @@ +from dataclasses import dataclass +from enum import Enum + +from pytoolconfig.pytoolconfig import PyToolConfig + + +class Demo(Enum): + DISABLED = False + ENABLED = True + ALT = "alternate" + + +@dataclass +class EnumModel: + option1: Demo = Demo.DISABLED + option2: Demo = Demo.DISABLED + option3: Demo = Demo.DISABLED + + +def test_simple(cwd): + config = PyToolConfig("pytoolconfig2", cwd, EnumModel) + result = config.parse() + assert result.option1 == Demo.DISABLED + assert result.option2 == Demo.ENABLED + assert result.option3 == Demo.ALT