- Update to 2.10.1
* Fix UnboundLocalError error in _replace_field_names_case_insensitively * Remove unknown file reference in documentation * Prepare release 2.10.1 - Update to 2.10.0 * Fix running tests when azure-keyvault-secrets is not installed * Fix running tests when google-cloud-secret-manager is not installed * Support loading a specific nested key from YAML in YamlConfigSettingsSource * Fix CLI suppression for model group help * Fix missing DEFAULT_PATH import * Fix case-insensitive handling of nested aliases in EnvironmentSettingsSource * Azure Key Vault case insensitive support and dash-underscore translation * fix: Respect 'cli_parse_args' from model_config with settings_customise_sources * Bump astral-sh/setup-uv * Update packages by * Update README.md * Fix CI badge * Update dependencies * Fix coverage report * Fix _consume_object_or_array on unbalanced brackets in JSON strings * add region as a parameter to aws secret manager * Expose GCP Secret Manager case sensitive option * Update deps * feat: Add cli_shortcuts to CLI settings * Expose AWS Secrets Manager case sensitive option * Prepare release 2.10.0 - remove otional test dependencies OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pydantic-settings?expand=0&rev=18
This commit is contained in:
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@@ -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
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.osc
|
3
_multibuild
Normal file
3
_multibuild
Normal file
@@ -0,0 +1,3 @@
|
||||
<multibuild>
|
||||
<package>test</package>
|
||||
</multibuild>
|
32
clear-environment.patch
Normal file
32
clear-environment.patch
Normal file
@@ -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
|
26
fix-settings-dump.patch
Normal file
26
fix-settings-dump.patch
Normal file
@@ -0,0 +1,26 @@
|
||||
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.
|
BIN
pydantic_settings-2.10.1.tar.gz
(Stored with Git LFS)
Normal file
BIN
pydantic_settings-2.10.1.tar.gz
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
pydantic_settings-2.3.4.tar.gz
(Stored with Git LFS)
Normal file
BIN
pydantic_settings-2.3.4.tar.gz
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
pydantic_settings-2.4.0.tar.gz
(Stored with Git LFS)
Normal file
BIN
pydantic_settings-2.4.0.tar.gz
(Stored with Git LFS)
Normal file
Binary file not shown.
3
pydantic_settings-2.7.1.tar.gz
Normal file
3
pydantic_settings-2.7.1.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:10c9caad35e64bfb3c2fbf70a078c0e25cc92499782e5200747f942a065dec93
|
||||
size 79920
|
BIN
pydantic_settings-2.8.1.tar.gz
(Stored with Git LFS)
Normal file
BIN
pydantic_settings-2.8.1.tar.gz
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
pydantic_settings-2.9.1.tar.gz
(Stored with Git LFS)
Normal file
BIN
pydantic_settings-2.9.1.tar.gz
(Stored with Git LFS)
Normal file
Binary file not shown.
187
python-pydantic-settings.changes
Normal file
187
python-pydantic-settings.changes
Normal file
@@ -0,0 +1,187 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Jul 1 08:46:12 UTC 2025 - Nico Krapp <nico.krapp@suse.com>
|
||||
|
||||
- Update to 2.10.1
|
||||
* Fix UnboundLocalError error in _replace_field_names_case_insensitively
|
||||
* Remove unknown file reference in documentation
|
||||
* Prepare release 2.10.1
|
||||
- Update to 2.10.0
|
||||
* Fix running tests when azure-keyvault-secrets is not installed
|
||||
* Fix running tests when google-cloud-secret-manager is not installed
|
||||
* Support loading a specific nested key from YAML in YamlConfigSettingsSource
|
||||
* Fix CLI suppression for model group help
|
||||
* Fix missing DEFAULT_PATH import
|
||||
* Fix case-insensitive handling of nested aliases in EnvironmentSettingsSource
|
||||
* Azure Key Vault case insensitive support and dash-underscore translation
|
||||
* fix: Respect 'cli_parse_args' from model_config with settings_customise_sources
|
||||
* Bump astral-sh/setup-uv
|
||||
* Update packages by
|
||||
* Update README.md
|
||||
* Fix CI badge
|
||||
* Update dependencies
|
||||
* Fix coverage report
|
||||
* Fix _consume_object_or_array on unbalanced brackets in JSON strings
|
||||
* add region as a parameter to aws secret manager
|
||||
* Expose GCP Secret Manager case sensitive option
|
||||
* Update deps
|
||||
* feat: Add cli_shortcuts to CLI settings
|
||||
* Expose AWS Secrets Manager case sensitive option
|
||||
* Prepare release 2.10.0
|
||||
- remove otional test dependencies
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Apr 24 05:53:47 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- 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 <steven.kowalik@suse.com>
|
||||
|
||||
- Update to 2.8.1:
|
||||
* Fix for init source kwarg alias resolution
|
||||
* Revert usage of positional only argument in BaseSettings.__init__
|
||||
* Revert use of object instead of Any
|
||||
* CLI support for optional and variadic positional args
|
||||
* Improve env_prefix config doc
|
||||
* Add env_nested_max_split setting
|
||||
* Avoid using Any in BaseSettings signature to avoid mypy errors
|
||||
* Asynchronous CLI methods in CliApp
|
||||
* Don't explode env vars if env_nested_delimiter is empty
|
||||
- Add patch use-typing_objects.patch:
|
||||
* Use typing_inspection.typing_objects rather than isinstance.
|
||||
- Refreshed patch fix-settings-dump.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jan 28 02:23:01 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- Update to 2.7.1:
|
||||
* Move preferred alias resolution to private method
|
||||
* Fix test_protected_namespace_defaults with -Wdefault
|
||||
* Make tests more robust to the running environment
|
||||
* Fix rendering of annotations in code example
|
||||
* Fix alias resolution for default settings source.
|
||||
* Use the class name in the __repr__ implementations
|
||||
* Fix default help text for union of submodels.
|
||||
* Add support for CliMutuallyExclusiveGroup.
|
||||
* Disable abbreviations on internal parser.
|
||||
* Fix Secret field parsing
|
||||
* Fix alias resolution to use preferred key.
|
||||
* Strip annotated when getting submodels during CLI parsing.
|
||||
* Removing return type from the function in test
|
||||
* Relax default protected_namespaces
|
||||
* Add support for CLI kebab case flag.
|
||||
* Change reference of default values validation in documentation
|
||||
* Improve field value parsing by adding NoDecode and ForceDecode
|
||||
annotations
|
||||
* Fix attribute error on Python 3.9 with typing.Sequence
|
||||
* Add Python 3.13 support
|
||||
* Adding support for populate_by_name
|
||||
* Refactor path_type_label
|
||||
* Fix nested model field with alias parsing
|
||||
* Fix PathType typing in case of sequence
|
||||
* Add cli_ignore_unknown_args config option.
|
||||
* Fix AzureKeyVaultSettingsSource problem in case of field with underscore
|
||||
* Add cli_flag_prefix_char config option.
|
||||
* Fix nested model AliasChoices in validation alias
|
||||
* Add CLI App Support
|
||||
* Fix a regression in dotenv optional nested field
|
||||
* Put tests for non-default sources in separate files
|
||||
* Update nested model partial update docs example.
|
||||
* Add support for suppressing fields from CLI help.
|
||||
* Fix bug in dotenv source when there is env with and without prefix
|
||||
* Fix a bug in nested vanila dataclass
|
||||
* CLI Improve Docstring Help Text
|
||||
* Cli fix default or none object help text
|
||||
* Determine RootModel complexity from root type
|
||||
* Add CLI bool flags
|
||||
* CLI arg list whitespaces fix.
|
||||
* Add nested_model_default_partial_update flag and DefaultSettingsSource
|
||||
* Parse enum fixes.
|
||||
* Fixes CLI help text for function types
|
||||
* Add get_subcommand function.
|
||||
* Cli prefix validation alias fix
|
||||
* CLI ignore external parser list fix
|
||||
* Enable multiple secrets dirs
|
||||
* Add CLI subcommand union and alias support
|
||||
* Fix dotenv settings source problem in handling extra variables with
|
||||
same prefix in name
|
||||
- Drop patch clear-environment.patch, fixed by upstream in a different way.
|
||||
- Add patch fix-settings-dump.patch:
|
||||
* Support changes introduced by Pydantic 2.10.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Oct 28 09:52:17 UTC 2024 - Daniel Garcia <daniel.garcia@suse.com>
|
||||
|
||||
- Remove azure BuildRequires
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Sep 12 05:57:59 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- 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
|
||||
- Add in multibuild.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jul 1 17:55:58 UTC 2024 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
- 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 <ecsos@opensuse.org>
|
||||
|
||||
- Add %{?sle15_python_module_pythons}
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Mar 11 03:19:14 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- Initial release of 2.2.1
|
91
python-pydantic-settings.spec
Normal file
91
python-pydantic-settings.spec
Normal file
@@ -0,0 +1,91 @@
|
||||
#
|
||||
# spec file for package python-pydantic-settings
|
||||
#
|
||||
# Copyright (c) 2025 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/
|
||||
#
|
||||
|
||||
|
||||
%global flavor @BUILD_FLAVOR@%{nil}
|
||||
%if "%{flavor}" == "test"
|
||||
%define psuffix -test
|
||||
%bcond_without test
|
||||
%else
|
||||
%define psuffix %{nil}
|
||||
%bcond_with test
|
||||
%endif
|
||||
%{?sle15_python_module_pythons}
|
||||
Name: python-pydantic-settings%{psuffix}
|
||||
Version: 2.10.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
|
||||
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-identity}
|
||||
BuildRequires: %{python_module google-auth}
|
||||
BuildRequires: %{python_module pydantic-settings = %{version}}
|
||||
BuildRequires: %{python_module pytest-examples}
|
||||
BuildRequires: %{python_module pytest-mock}
|
||||
BuildRequires: %{python_module pytest}
|
||||
%endif
|
||||
# /SECTION
|
||||
BuildRequires: fdupes
|
||||
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-tomli >= 2.0.1
|
||||
Suggests: python-google-cloud-secret-manager >= 2.23.1
|
||||
Suggests: python-azure-keyvault-secrets >= 4.8
|
||||
Suggests: python-azure-identity
|
||||
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
|
||||
%if !%{with test}
|
||||
%pyproject_install
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||
%endif
|
||||
|
||||
%check
|
||||
%if %{with test}
|
||||
# This test requires azure
|
||||
skiptest="test_docs_examples[docs/index.md:1847-1890]"
|
||||
%pytest -k "not ($skiptest)"
|
||||
%endif
|
||||
|
||||
%if !%{with test}
|
||||
%files %{python_files}
|
||||
%license LICENSE
|
||||
%doc README.md
|
||||
%{python_sitelib}/pydantic_settings
|
||||
%{python_sitelib}/pydantic_settings-%{version}.dist-info
|
||||
%endif
|
||||
|
||||
%changelog
|
33
use-typing_objects.patch
Normal file
33
use-typing_objects.patch
Normal file
@@ -0,0 +1,33 @@
|
||||
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']
|
||||
|
Reference in New Issue
Block a user