From 3bd37979172ab8973de4dabcf3d03f7b3eac9faacd53afafe1ef196617215a60 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Tue, 28 Feb 2023 06:09:50 +0000 Subject: [PATCH] - Update to 3.1.11: * New data key casing must adapt to existing key casing (#795) * Parse negative numbers from envvar Fix #799 and Fix #585 (#802) * Fix get command with Django (#804) * Allow merge_unique on lists when merge_enabled=True (#810) * Rebind current env when forced for Pytest Fix #728 (#809) * AUTO_CAST can be enabled on instance (#811) * Fix #807 Use client.auth.approle.login instead of client.auth_approle (#808) * Fix #768 of kv property depreciation from client object (#769) * Feature/detect casting comb token from converters (#784) * Using filter_strategy in env_loader to fix #760 (#767) * Fix cli init command for flask (#705) (#774) * Add unique label when merging lists to fix issue #653 (#661) * Add new validation to fix issue #585 (#667) * Add support for Python 3.10 (#665) * Added `dynaconf get` command to cli (#730) * Fix FlaskConfig.setdefault (#706) * Force PYTHONIOENCODING to utf-8 to fix #664 (#672) * Fix Issue 662 Lazy validation (#675) * Load vault secrets from environment less stores or which are not written by dynaconf (#725) * Added validate_only_current_env to validator (issue #734) (#736) * Makes Django/Flask kwargs case insensitive (#721) * Fix #595 namedtuples are no more converted to BoxList (#623) * description and type annotation for validator (#634) * Add support for Python 3.9 (#618) * Add type annotations for dynaconf.utils (#450) * feat: add filter strategy with PrefixFilter (#625) * Add a warning if `--env` is passed to `init` (#629) - Add patch support-python-311.patch: OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dynaconf?expand=0&rev=18 --- dynaconf-3.1.11.tar.gz | 3 + dynaconf-3.1.4.tar.gz | 3 - python-dynaconf.changes | 35 +++++++++ python-dynaconf.spec | 15 ++-- support-python-311.patch | 158 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 201 insertions(+), 13 deletions(-) create mode 100644 dynaconf-3.1.11.tar.gz delete mode 100644 dynaconf-3.1.4.tar.gz create mode 100644 support-python-311.patch diff --git a/dynaconf-3.1.11.tar.gz b/dynaconf-3.1.11.tar.gz new file mode 100644 index 0000000..2bd88a6 --- /dev/null +++ b/dynaconf-3.1.11.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:45b532d16c603494a8d820aea49fab690e56d71ae05d89d2e188c2654cfdcc6a +size 3995831 diff --git a/dynaconf-3.1.4.tar.gz b/dynaconf-3.1.4.tar.gz deleted file mode 100644 index 1c4d45b..0000000 --- a/dynaconf-3.1.4.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:056837d4bc9c9ffa857d008bd5041c66d363c25df1d18f1c528fb0d83f24f6af -size 2691867 diff --git a/python-dynaconf.changes b/python-dynaconf.changes index 2310f8d..b05ef55 100644 --- a/python-dynaconf.changes +++ b/python-dynaconf.changes @@ -1,3 +1,38 @@ +------------------------------------------------------------------- +Tue Feb 28 06:08:59 UTC 2023 - Steve Kowalik + +- Update to 3.1.11: + * New data key casing must adapt to existing key casing (#795) + * Parse negative numbers from envvar Fix #799 and Fix #585 (#802) + * Fix get command with Django (#804) + * Allow merge_unique on lists when merge_enabled=True (#810) + * Rebind current env when forced for Pytest Fix #728 (#809) + * AUTO_CAST can be enabled on instance (#811) + * Fix #807 Use client.auth.approle.login instead of client.auth_approle (#808) + * Fix #768 of kv property depreciation from client object (#769) + * Feature/detect casting comb token from converters (#784) + * Using filter_strategy in env_loader to fix #760 (#767) + * Fix cli init command for flask (#705) (#774) + * Add unique label when merging lists to fix issue #653 (#661) + * Add new validation to fix issue #585 (#667) + * Add support for Python 3.10 (#665) + * Added `dynaconf get` command to cli (#730) + * Fix FlaskConfig.setdefault (#706) + * Force PYTHONIOENCODING to utf-8 to fix #664 (#672) + * Fix Issue 662 Lazy validation (#675) + * Load vault secrets from environment less stores or which are not + written by dynaconf (#725) + * Added validate_only_current_env to validator (issue #734) (#736) + * Makes Django/Flask kwargs case insensitive (#721) + * Fix #595 namedtuples are no more converted to BoxList (#623) + * description and type annotation for validator (#634) + * Add support for Python 3.9 (#618) + * Add type annotations for dynaconf.utils (#450) + * feat: add filter strategy with PrefixFilter (#625) + * Add a warning if `--env` is passed to `init` (#629) +- Add patch support-python-311.patch: + * Support Python 3.11. + ------------------------------------------------------------------- Fri Jul 8 05:10:21 UTC 2022 - Steve Kowalik diff --git a/python-dynaconf.spec b/python-dynaconf.spec index 4cb4745..8682fe6 100644 --- a/python-dynaconf.spec +++ b/python-dynaconf.spec @@ -1,7 +1,7 @@ # # spec file for package python-dynaconf # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,15 +16,15 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} -%define skip_python2 1 Name: python-dynaconf -Version: 3.1.4 +Version: 3.1.11 Release: 0 Summary: The dynamic configurator for your Python Project License: MIT URL: https://github.com/rochacbruno/dynaconf Source: https://github.com/rochacbruno/dynaconf/archive/%{version}.tar.gz#/dynaconf-%{version}.tar.gz +# PATCH-FIX-UPSTREAM gh#dynaconf/dynaconf#830 +Patch0: support-python-311.patch BuildRequires: %{python_module setuptools >= 38.6.0} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -67,8 +67,6 @@ The dynamic configurator for your Python Project # require running docker with the server rm tests/test_vault.py -rm -r dynaconf/vendor_src/ - %build %python_build @@ -78,11 +76,8 @@ rm -r dynaconf/vendor_src/ %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -mkdir -p ~/bin -%python_expand cp -p %{buildroot}%{_bindir}/dynaconf-%{$python_bin_suffix} ~/bin/dynaconf -export PATH=~/bin:$PATH export LANG=en_US.UTF-8 -/usr/sbin/redis-server & +/usr/sbin/redis-server --stop-writes-on-bgsave-error no & export DYNACONF_TEST_REDIS_URL==http://127.0.0.1:6379 %pytest tests/ diff --git a/support-python-311.patch b/support-python-311.patch new file mode 100644 index 0000000..22743dd --- /dev/null +++ b/support-python-311.patch @@ -0,0 +1,158 @@ +From 6ff2192ef2dfd0e29c6889cc248353a57e3293dc Mon Sep 17 00:00:00 2001 +From: Bruno Rocha +Date: Mon, 7 Nov 2022 18:36:05 +0000 +Subject: [PATCH] Add Python 3.11 to CI + +Thanks @Riverfount +--- + .github/workflows/main.yml | 16 ++++++++-------- + dynaconf/base.py | 4 ++-- + setup.py | 5 ++--- + tests/test_base.py | 10 ++++------ + 4 files changed, 16 insertions(+), 19 deletions(-) + +diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml +index d512c15f..fe399891 100644 +--- a/.github/workflows/main.yml ++++ b/.github/workflows/main.yml +@@ -36,7 +36,7 @@ jobs: + strategy: + fail-fast: false + matrix: +- python-version: ["3.8", "3.9", "3.10"] ++ python-version: ["3.8", "3.9", "3.10", "3.11"] + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: +@@ -61,7 +61,7 @@ jobs: + strategy: + fail-fast: false + matrix: +- python-version: ["3.8", "3.10"] ++ python-version: ["3.8", "3.10", "3.11"] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + steps: +@@ -104,7 +104,7 @@ jobs: + strategy: + fail-fast: false + matrix: +- python-version: ["3.8", "3.10"] ++ python-version: ["3.8", "3.10", "3.11"] + os: [macos-latest] + runs-on: ${{ matrix.os }} + steps: +@@ -126,7 +126,7 @@ jobs: + strategy: + fail-fast: false + matrix: +- python-version: ["3.8", "3.10"] ++ python-version: ["3.8", "3.10", "3.11"] + os: [ubuntu-latest, macos-latest] + runs-on: ${{ matrix.os }} + steps: +@@ -146,7 +146,7 @@ jobs: + strategy: + fail-fast: false + matrix: +- python-version: ["3.8", "3.10"] ++ python-version: ["3.8", "3.10", "3.11"] + os: [windows-latest] + runs-on: ${{ matrix.os }} + steps: +@@ -167,7 +167,7 @@ jobs: + strategy: + fail-fast: false + matrix: +- python-version: ["3.8", "3.10"] ++ python-version: ["3.8", "3.10", "3.11"] + os: [windows-latest] + runs-on: ${{ matrix.os }} + steps: +@@ -188,7 +188,7 @@ jobs: + strategy: + fail-fast: false + matrix: +- python-version: ["3.8", "3.10"] ++ python-version: ["3.8", "3.10", "3.11"] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + services: +@@ -213,7 +213,7 @@ jobs: + strategy: + fail-fast: false + matrix: +- python-version: ["3.8", "3.10"] ++ python-version: ["3.8", "3.10", "3.11"] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + services: +diff --git a/dynaconf/base.py b/dynaconf/base.py +index 2858b549..15f3df46 100644 +--- a/dynaconf/base.py ++++ b/dynaconf/base.py +@@ -753,8 +753,8 @@ def setenv(self, env=None, clean=True, silent=True, filename=None): + """ + env = env or self.ENV_FOR_DYNACONF + +- if not isinstance(env, str): +- raise AttributeError("env should be a string") ++ if not isinstance(env, str) or "_" in env or " " in env: ++ raise ValueError("env should be a string without _ or spaces") + + env = env.upper() + +diff --git a/setup.py b/setup.py +index af82a877..223653b5 100644 +--- a/setup.py ++++ b/setup.py +@@ -1,8 +1,6 @@ + from __future__ import annotations + +-import io + import os +-import sys + + from setuptools import find_packages + from setuptools import setup +@@ -83,7 +81,7 @@ def read(*names, **kwargs): + "all": ["redis", "ruamel.yaml", "configobj", "hvac"], + "test": test_requirements, + }, +- python_requires=">=3.7", ++ python_requires=">=3.8", + entry_points={"console_scripts": ["dynaconf=dynaconf.cli:main"]}, + setup_requires=["setuptools>=38.6.0"], + classifiers=[ +@@ -100,6 +98,7 @@ def read(*names, **kwargs): + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", ++ "Programming Language :: Python :: 3.11", + "Topic :: Utilities", + "Topic :: Software Development :: Libraries", + "Topic :: Software Development :: Libraries :: Python Modules", +diff --git a/tests/test_base.py b/tests/test_base.py +index ae1fe9b9..18363ba6 100644 +--- a/tests/test_base.py ++++ b/tests/test_base.py +@@ -204,15 +204,13 @@ def test_as_json(settings): + + + def test_env_should_be_string(settings): +- with pytest.raises(AttributeError): +- with settings.setenv(123456): +- pass ++ with pytest.raises(ValueError): ++ settings.setenv(123456) + + + def test_env_should_not_have_underline(settings): +- with pytest.raises(AttributeError): +- with settings.setenv("COOL_env"): +- pass ++ with pytest.raises(ValueError): ++ settings.setenv("COOL_env") + + + def test_path_for(settings):