From 16dba026f5a0e3674721f7ea4e3965b643c0d60b090feffe4042e1c6b45f4d54 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Mon, 11 Mar 2024 03:19:31 +0000 Subject: [PATCH] - Initial release of 2.2.1 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pydantic-settings?expand=0&rev=1 --- .gitattributes | 23 +++++++++++ .gitignore | 1 + clear-environment.patch | 32 +++++++++++++++ pydantic_settings-2.2.1.tar.gz | 3 ++ python-pydantic-settings.changes | 4 ++ python-pydantic-settings.spec | 68 ++++++++++++++++++++++++++++++++ 6 files changed, 131 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 clear-environment.patch create mode 100644 pydantic_settings-2.2.1.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..78af894 --- /dev/null +++ b/clear-environment.patch @@ -0,0 +1,32 @@ +Index: pydantic_settings-2.2.1/tests/test_settings.py +=================================================================== +--- pydantic_settings-2.2.1.orig/tests/test_settings.py ++++ pydantic_settings-2.2.1/tests/test_settings.py +@@ -6,6 +6,7 @@ import uuid + from datetime import datetime, timezone + from pathlib import Path + from typing import Any, Callable, Dict, Generic, List, Optional, Set, Tuple, Type, TypeVar, Union ++from unittest import mock + + import pytest + from annotated_types import MinLen +@@ -1050,7 +1051,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 +@@ -1069,7 +1071,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.2.1.tar.gz b/pydantic_settings-2.2.1.tar.gz new file mode 100644 index 0000000..d075812 --- /dev/null +++ b/pydantic_settings-2.2.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:00b9f6a5e95553590434c0fa01ead0b216c3e10bc54ae02e37f359948643c5ed +size 35495 diff --git a/python-pydantic-settings.changes b/python-pydantic-settings.changes new file mode 100644 index 0000000..2e11356 --- /dev/null +++ b/python-pydantic-settings.changes @@ -0,0 +1,4 @@ +------------------------------------------------------------------- +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..99ca108 --- /dev/null +++ b/python-pydantic-settings.spec @@ -0,0 +1,68 @@ +# +# 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/ +# + + +Name: python-pydantic-settings +Version: 2.2.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 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 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