From d4ac3d8e5c75e9164010ff47928aea70aafccfd1b388c1790abe88be5b2a5f4e Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Thu, 24 Apr 2025 05:54:41 +0000 Subject: [PATCH] - Update to 2.9.1: * Drop support for Python 3.8 * Switch to typing-inspection * Refactor sources.py into a subpackage * Add support for AWS Secrets Manager * Fix minor typo: conotations => connotations * Azure Key Vault: Don't load disabled secret * Add support for GCP Secret Manager * CLI JSON Optional Default * Fix for env nested enum * CLI submodel suppress * Cli retrieve unknown args * Update pydantic - Drop patches: * fix-settings-dump.patch * use-typing_objects.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pydantic-settings?expand=0&rev=16 --- fix-settings-dump.patch | 26 ------------------------- pydantic_settings-2.8.1.tar.gz | 3 --- pydantic_settings-2.9.1.tar.gz | 3 +++ python-pydantic-settings.changes | 20 +++++++++++++++++++ python-pydantic-settings.spec | 18 +++++++++-------- use-typing_objects.patch | 33 -------------------------------- 6 files changed, 33 insertions(+), 70 deletions(-) delete mode 100644 fix-settings-dump.patch delete mode 100644 pydantic_settings-2.8.1.tar.gz create mode 100644 pydantic_settings-2.9.1.tar.gz delete mode 100644 use-typing_objects.patch diff --git a/fix-settings-dump.patch b/fix-settings-dump.patch deleted file mode 100644 index 3b001eb..0000000 --- a/fix-settings-dump.patch +++ /dev/null @@ -1,26 +0,0 @@ -Index: pydantic_settings-2.8.1/docs/index.md -=================================================================== ---- pydantic_settings-2.8.1.orig/docs/index.md -+++ pydantic_settings-2.8.1/docs/index.md -@@ -72,9 +72,9 @@ print(Settings().model_dump()) - { - 'auth_key': 'xxx', - 'api_key': 'xxx', -- 'redis_dsn': Url('redis://user:pass@localhost:6379/1'), -- 'pg_dsn': MultiHostUrl('postgres://user:pass@localhost:5432/foobar'), -- 'amqp_dsn': Url('amqp://user:pass@localhost:5672/'), -+ 'redis_dsn': RedisDsn('redis://user:pass@localhost:6379/1'), -+ 'pg_dsn': PostgresDsn('postgres://user:pass@localhost:5432/foobar'), -+ 'amqp_dsn': AmqpDsn('amqp://user:pass@localhost:5672/'), - 'special_function': math.cos, - 'domains': set(), - 'more_settings': {'foo': 'bar', 'apple': 1}, -@@ -2075,7 +2075,7 @@ class Settings(BaseSettings): - - - print(Settings(database_dsn='postgres://postgres@localhost:5432/kwargs_db')) --#> database_dsn=MultiHostUrl('postgres://postgres@localhost:5432/kwargs_db') -+#> database_dsn=PostgresDsn('postgres://postgres@localhost:5432/kwargs_db') - ``` - - By flipping `env_settings` and `init_settings`, environment variables now have precedence over `__init__` kwargs. diff --git a/pydantic_settings-2.8.1.tar.gz b/pydantic_settings-2.8.1.tar.gz deleted file mode 100644 index 95bbc6c..0000000 --- a/pydantic_settings-2.8.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d5c663dfbe9db9d5e1c646b2e161da12f0d734d422ee56f567d0ea2cee4e8585 -size 83550 diff --git a/pydantic_settings-2.9.1.tar.gz b/pydantic_settings-2.9.1.tar.gz new file mode 100644 index 0000000..548220e --- /dev/null +++ b/pydantic_settings-2.9.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c509bf79d27563add44e8446233359004ed85066cd096d8b510f715e6ef5d268 +size 163234 diff --git a/python-pydantic-settings.changes b/python-pydantic-settings.changes index 9305387..d2346e9 100644 --- a/python-pydantic-settings.changes +++ b/python-pydantic-settings.changes @@ -1,3 +1,23 @@ +------------------------------------------------------------------- +Thu Apr 24 05:53:47 UTC 2025 - Steve Kowalik + +- Update to 2.9.1: + * Drop support for Python 3.8 + * Switch to typing-inspection + * Refactor sources.py into a subpackage + * Add support for AWS Secrets Manager + * Fix minor typo: conotations => connotations + * Azure Key Vault: Don't load disabled secret + * Add support for GCP Secret Manager + * CLI JSON Optional Default + * Fix for env nested enum + * CLI submodel suppress + * Cli retrieve unknown args + * Update pydantic +- Drop patches: + * fix-settings-dump.patch + * use-typing_objects.patch + ------------------------------------------------------------------- Fri Apr 4 04:53:17 UTC 2025 - Steve Kowalik diff --git a/python-pydantic-settings.spec b/python-pydantic-settings.spec index a033d20..a67ea33 100644 --- a/python-pydantic-settings.spec +++ b/python-pydantic-settings.spec @@ -26,21 +26,21 @@ %endif %{?sle15_python_module_pythons} Name: python-pydantic-settings%{psuffix} -Version: 2.8.1 +Version: 2.9.1 Release: 0 Summary: Settings management using Pydantic License: MIT URL: https://github.com/pydantic/pydantic-settings Source: https://files.pythonhosted.org/packages/source/p/pydantic-settings/pydantic_settings-%{version}.tar.gz -# PATCH-FIX-OPENSUSE Support Pydantic 2.10 changes. -Patch0: fix-settings-dump.patch -# PATCH-FIX-OPENSUSE Use typing_inspection.typing_objects (adapted from upstream) -Patch1: use-typing_objects.patch +BuildRequires: %{python_module base >= 3.9} BuildRequires: %{python_module hatchling} BuildRequires: %{python_module pip} BuildRequires: python-rpm-macros # SECTION test requirements %if %{with test} +BuildRequires: %{python_module azure-keyvault-secrets >= 4.8} +BuildRequires: %{python_module google-auth} +BuildRequires: %{python_module google-cloud-secret-manager >= 2.23.1} BuildRequires: %{python_module pydantic-settings = %{version}} BuildRequires: %{python_module pytest-examples} BuildRequires: %{python_module pytest-mock} @@ -48,11 +48,13 @@ BuildRequires: %{python_module pytest} %endif # /SECTION BuildRequires: fdupes -Requires: python-pydantic >= 2.3.0 +Requires: python-pydantic >= 2.7.0 Requires: python-python-dotenv >= 0.21.0 Requires: python-typing-inspection >= 0.4.0 -Suggests: python-pyyaml >= 6.0.1 +Suggests: python-PyYAML >= 6.0.1 Suggests: python-tomli >= 2.0.1 +Suggests: python-google-cloud-secret-manager >= 2.23.1 +Suggests: python-azure-keyvault-secrets >= 4.8 BuildArch: noarch %python_subpackages @@ -74,7 +76,7 @@ Settings management using Pydantic, this is the new official home of Pydantic's %check %if %{with test} # This test requires azure -skiptest="test_docs_examples[docs/index.md:1803-1847]" +skiptest="test_docs_examples[docs/index.md:1847-1890]" %pytest -k "not ($skiptest)" %endif diff --git a/use-typing_objects.patch b/use-typing_objects.patch deleted file mode 100644 index 97fe454..0000000 --- a/use-typing_objects.patch +++ /dev/null @@ -1,33 +0,0 @@ -Index: pydantic_settings-2.8.1/pydantic_settings/sources.py -=================================================================== ---- pydantic_settings-2.8.1.orig/pydantic_settings/sources.py -+++ pydantic_settings-2.8.1/pydantic_settings/sources.py -@@ -45,6 +45,7 @@ from pydantic.dataclasses import is_pyda - from pydantic.fields import FieldInfo - from pydantic_core import PydanticUndefined - from typing_extensions import Annotated, _AnnotatedAlias, get_args, get_origin -+from typing_inspection import typing_objects - - from pydantic_settings.utils import path_type_label - -@@ -1996,7 +1997,7 @@ class CliSettingsSource(EnvSettingsSourc - return '...' - elif isinstance(obj, Representation): - return repr(obj) -- elif isinstance(obj, typing_extensions.TypeAliasType): -+ elif typing_objects.is_typealiastype(obj): - return str(obj) - - if not isinstance(obj, (typing_base, WithArgsTypes, type)): -Index: pydantic_settings-2.8.1/pyproject.toml -=================================================================== ---- pydantic_settings-2.8.1.orig/pyproject.toml -+++ pydantic_settings-2.8.1/pyproject.toml -@@ -43,6 +43,7 @@ requires-python = '>=3.8' - dependencies = [ - 'pydantic>=2.7.0', - 'python-dotenv>=0.21.0', -+ 'typing-inspection>=0.4.0', - ] - dynamic = ['version'] -