From 32b68a6f83341eecebda7bd667a9a5f6ad0d6721df41a7e75176968f5f21d719 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Tue, 10 Sep 2024 04:58:20 +0000 Subject: [PATCH] - Update to 2.4.0: * Fix regex flags accidentally passed as count * Deprecate read_env_file and move it to DotEnvSettingsSource * Fix a bug when loading empty yaml file * feat: Enable access to the current state in settings sources * Add support for short options * Add Azure Key Vault settings source * Add cli_exit_on_error config option OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pydantic-settings?expand=0&rev=7 --- .gitattributes | 23 +++++++++++ .gitignore | 1 + clear-environment.patch | 32 +++++++++++++++ pydantic_settings-2.3.4.tar.gz | 3 ++ pydantic_settings-2.4.0.tar.gz | 3 ++ python-pydantic-settings.changes | 55 +++++++++++++++++++++++++ python-pydantic-settings.spec | 70 ++++++++++++++++++++++++++++++++ 7 files changed, 187 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 clear-environment.patch create mode 100644 pydantic_settings-2.3.4.tar.gz create mode 100644 pydantic_settings-2.4.0.tar.gz create mode 100644 python-pydantic-settings.changes create mode 100644 python-pydantic-settings.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/clear-environment.patch b/clear-environment.patch new file mode 100644 index 0000000..2b50784 --- /dev/null +++ b/clear-environment.patch @@ -0,0 +1,32 @@ +Index: pydantic_settings-2.3.4/tests/test_settings.py +=================================================================== +--- pydantic_settings-2.3.4.orig/tests/test_settings.py ++++ pydantic_settings-2.3.4/tests/test_settings.py +@@ -10,6 +10,7 @@ from datetime import datetime, timezone + from enum import IntEnum + from pathlib import Path + from typing import Any, Callable, Dict, Generic, Hashable, List, Optional, Set, Tuple, Type, TypeVar, Union ++from unittest import mock + + import pytest + import typing_extensions +@@ -1116,7 +1117,8 @@ def test_multiple_env_file(tmp_path): + + model_config = SettingsConfigDict(env_file=[base_env, prod_env]) + +- s = Settings() ++ with mock.patch.dict('os.environ', {}, clear=True): ++ s = Settings() + assert s.debug_mode is False + assert s.host == 'https://example.com/services' + assert s.port == 8000 +@@ -1135,7 +1137,8 @@ def test_model_env_file_override_model_c + + model_config = SettingsConfigDict(env_file=prod_env) + +- s = Settings(_env_file=base_env) ++ with mock.patch.dict('os.environ', {}, clear=True): ++ s = Settings(_env_file=base_env) + assert s.debug_mode is True + assert s.host == 'localhost' + assert s.port == 8000 diff --git a/pydantic_settings-2.3.4.tar.gz b/pydantic_settings-2.3.4.tar.gz new file mode 100644 index 0000000..cb6b4dc --- /dev/null +++ b/pydantic_settings-2.3.4.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c5802e3d62b78e82522319bbc9b8f8ffb28ad1c988a99311d04f2a6051fca0a7 +size 59231 diff --git a/pydantic_settings-2.4.0.tar.gz b/pydantic_settings-2.4.0.tar.gz new file mode 100644 index 0000000..5a0e760 --- /dev/null +++ b/pydantic_settings-2.4.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ed81c3a0f46392b4d7c0a565c05884e6e54b3456e6f0fe4d8814981172dc9a88 +size 63033 diff --git a/python-pydantic-settings.changes b/python-pydantic-settings.changes new file mode 100644 index 0000000..e6e5e63 --- /dev/null +++ b/python-pydantic-settings.changes @@ -0,0 +1,55 @@ +------------------------------------------------------------------- +Tue Sep 10 04:57:57 UTC 2024 - Steve Kowalik + +- Update to 2.4.0: + * Fix regex flags accidentally passed as count + * Deprecate read_env_file and move it to DotEnvSettingsSource + * Fix a bug when loading empty yaml file + * feat: Enable access to the current state in settings sources + * Add support for short options + * Add Azure Key Vault settings source + * Add cli_exit_on_error config option + +------------------------------------------------------------------- +Mon Jul 1 17:55:58 UTC 2024 - Dirk Müller + +- update to 2.3.4: + * add in-place reloading in docs + * Nested pydantic dataclasses and doc fixes. + * Remove leftover docstring causing warning on `pydantic` docs + build +- update to 2.3.3: + * Fix an intriduced bug in parsing json field with + discriminated union + * Add CliSettingsSource alias handling for AliasChoices and + AliasPath. +- update to 2.3.2: + * Initialize CLI source on demand. + * Fix command line help from `argparse` formatting problem + * Fix issue with nested model uppercase field name in case + insensitive mode +- update to 2.3.1: + * Fix a regression in parsing env value for nested dict +- update to 2.3.0: + * Add environment parsing support for enums. + * Improve `explode_env_vars` for better dict handling + * add `PyprojectTomlConfigSettingsSource` + * Fix broken link in AliasChoices class + * Update Pydantic + * fix: superfluous deep env conflicts with non-dict model leaf + * fix: a second level of environment nesting expected a dict + * Fix an issue when inner types of a discriminated union with a + callable discriminator were not correctly identified as + complex. + * Fix a bug when we have case insentive field in nested model + * Add CLI Settings Source + +------------------------------------------------------------------- +Wed Mar 27 15:37:56 UTC 2024 - ecsos + +- Add %{?sle15_python_module_pythons} + +------------------------------------------------------------------- +Mon Mar 11 03:19:14 UTC 2024 - Steve Kowalik + +- Initial release of 2.2.1 diff --git a/python-pydantic-settings.spec b/python-pydantic-settings.spec new file mode 100644 index 0000000..6a86ff0 --- /dev/null +++ b/python-pydantic-settings.spec @@ -0,0 +1,70 @@ +# +# spec file for package python-pydantic-settings +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%{?sle15_python_module_pythons} +Name: python-pydantic-settings +Version: 2.4.0 +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 Clear the environment before two test cases +Patch0: clear-environment.patch +BuildRequires: %{python_module hatchling} +BuildRequires: %{python_module pip} +BuildRequires: python-rpm-macros +# SECTION test requirements +BuildRequires: %{python_module pydantic >= 2.3.0} +BuildRequires: %{python_module azure-identity >= 1.16} +BuildRequires: %{python_module pytest-examples} +BuildRequires: %{python_module pytest-mock} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module python-dotenv >= 0.21.0} +# /SECTION +BuildRequires: fdupes +Requires: python-pydantic >= 2.3.0 +Requires: python-python-dotenv >= 0.21.0 +Suggests: python-pyyaml >= 6.0.1 +Suggests: python-tomli >= 2.0.1 +BuildArch: noarch +%python_subpackages + +%description +Settings management using Pydantic, this is the new official home of Pydantic's `BaseSettings`. + +%prep +%autosetup -p1 -n pydantic_settings-%{version} + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +%pytest + +%files %{python_files} +%license LICENSE +%doc README.md +%{python_sitelib}/pydantic_settings +%{python_sitelib}/pydantic_settings-%{version}.dist-info + +%changelog