From ca32ee22b838e82e41211f88d701efa0022f4a78421f831627dda499943531d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Wed, 8 Apr 2020 08:12:56 +0000 Subject: [PATCH] - Add patch from git upstream to work with latest box releases: * box-4.0.patch - Update to 2.2.3: * Fix #236 added .local. files loading and module impersonation docs (#239) * Replace key.upper with `upperfy` function that keeps `__` attributes (#240) * Fix #241 new merge standards (#243) * Add support for PRELOAD_ setting. (#244) * Fixing how filename.local.* files are loaded (#238) * fix crash on empty settings (#242) * Fix #251 recursive call was using mutable memoized data (#254) * Fix #266 created new variable FORCE_ENV to override ENV_FOR_DYNACONF * Fix coverage for validators * Add support for detecting duplicate validators being added (and ignore them) (#256) * fix: env_loader.write: quote_mode for non-string values * : added line break * fix str comparison * changing quote logic * fix open error @py3.5 * Fix #258 custom message for validators * Close #178. Included integration tests redis/vault * Fix #273 add Flask load extensions method. * Fix #145 allow lazy format using os.environ and settings values. * Overriding strategy test * Fix #203 document the usage with pytest (with examples) OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dynaconf?expand=0&rev=10 --- 2.1.1.tar.gz | 3 -- 2.2.3.tar.gz | 3 ++ box-4.0.patch | 78 +++++++++++++++++++++++++++++++++++++++++ python-dynaconf.changes | 32 +++++++++++++++++ python-dynaconf.spec | 17 ++++++--- 5 files changed, 126 insertions(+), 7 deletions(-) delete mode 100644 2.1.1.tar.gz create mode 100644 2.2.3.tar.gz create mode 100644 box-4.0.patch diff --git a/2.1.1.tar.gz b/2.1.1.tar.gz deleted file mode 100644 index 2eb77a5..0000000 --- a/2.1.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6951786599409c63c92fbe011da3d48156d17d53ec0f092c091b48863982e8fd -size 155063 diff --git a/2.2.3.tar.gz b/2.2.3.tar.gz new file mode 100644 index 0000000..02ffded --- /dev/null +++ b/2.2.3.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bc46feb686e8a7e850582652f0fe3c7a24761d3628b66aef81921e89499795ef +size 170804 diff --git a/box-4.0.patch b/box-4.0.patch new file mode 100644 index 0000000..5598e5e --- /dev/null +++ b/box-4.0.patch @@ -0,0 +1,78 @@ +From fa726b66fc4da0765790d8d0ca27866c331ef087 Mon Sep 17 00:00:00 2001 +From: Bruno Rocha +Date: Thu, 27 Feb 2020 20:03:10 -0300 +Subject: [PATCH] Unpinning python-box, removing box_it_up and default_box + arguments + +--- + dynaconf/base.py | 6 +++--- + setup.py | 3 +-- + tests/test_dynabox.py | 3 +-- + 5 files changed, 14 insertions(+), 16 deletions(-) + +diff --git a/dynaconf/base.py b/dynaconf/base.py +index 99b44ba..ccb1368 100644 +--- a/dynaconf/base.py ++++ b/dynaconf/base.py +@@ -172,7 +172,7 @@ def __init__(self, settings_module=None, **kwargs): # pragma: no cover + self._loaded_envs = [] + self._loaded_files = [] + self._deleted = set() +- self._store = DynaBox(box_it_up=True) ++ self._store = DynaBox() + self._env_cache = {} + self._loaded_by_loaders = {} + self._loaders = [] +@@ -656,7 +656,7 @@ def _dotted_set(self, dotted_key, value, tomlfy=False, **kwargs): + + split_keys = dotted_key.split(".") + existing_data = self.get(split_keys[0], {}) +- new_data = DynaBox(default_box=True) ++ new_data = DynaBox() + + tree = new_data + for k in split_keys[:-1]: +@@ -744,7 +744,7 @@ def set( + value = self._merge_before_set(key, existing, value, is_secret) + + if isinstance(value, dict): +- value = DynaBox(value, box_it_up=True) ++ value = DynaBox(value) + + setattr(self, key, value) + self.store[key] = value +diff --git a/setup.py b/setup.py +index 2043a5a..6a2a01b 100644 +--- a/setup.py ++++ b/setup.py +@@ -44,7 +44,7 @@ def read(*names, **kwargs): + include_package_data=True, + zip_safe=False, + platforms="any", +- install_requires=["python-box<4.0.0", "python-dotenv", "toml", "click"], ++ install_requires=["python-box", "python-dotenv", "toml", "click"], + tests_require=[ + "pytest", + "pytest-cov", +@@ -84,7 +84,6 @@ def read(*names, **kwargs): + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", +- "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Topic :: Utilities", +diff --git a/tests/test_dynabox.py b/tests/test_dynabox.py +index 3fbb683..0e4ffab 100644 +--- a/tests/test_dynabox.py ++++ b/tests/test_dynabox.py +@@ -12,8 +12,7 @@ + "token": {"TYPE": 1, "value": 2}, + }, + } +- }, +- box_it_up=True, ++ } + ) + + diff --git a/python-dynaconf.changes b/python-dynaconf.changes index 1724b2b..90daa01 100644 --- a/python-dynaconf.changes +++ b/python-dynaconf.changes @@ -1,3 +1,35 @@ +------------------------------------------------------------------- +Wed Apr 8 08:06:54 UTC 2020 - Tomáš Chvátal + +- Add patch from git upstream to work with latest box releases: + * box-4.0.patch + +------------------------------------------------------------------- +Wed Apr 8 07:21:09 UTC 2020 - Tomáš Chvátal + +- Update to 2.2.3: + * Fix #236 added .local. files loading and module impersonation docs (#239) + * Replace key.upper with `upperfy` function that keeps `__` attributes (#240) + * Fix #241 new merge standards (#243) + * Add support for PRELOAD_ setting. (#244) + * Fixing how filename.local.* files are loaded (#238) + * fix crash on empty settings (#242) + * Fix #251 recursive call was using mutable memoized data (#254) + * Fix #266 created new variable FORCE_ENV to override ENV_FOR_DYNACONF + * Fix coverage for validators + * Add support for detecting duplicate validators being added (and ignore them) (#256) + * fix: env_loader.write: quote_mode for non-string values + * : added line break + * fix str comparison + * changing quote logic + * fix open error @py3.5 + * Fix #258 custom message for validators + * Close #178. Included integration tests redis/vault + * Fix #273 add Flask load extensions method. + * Fix #145 allow lazy format using os.environ and settings values. + * Overriding strategy test + * Fix #203 document the usage with pytest (with examples) + ------------------------------------------------------------------- Thu Sep 26 11:14:00 UTC 2019 - Tomáš Chvátal diff --git a/python-dynaconf.spec b/python-dynaconf.spec index 204e4e3..0277e44 100644 --- a/python-dynaconf.spec +++ b/python-dynaconf.spec @@ -1,7 +1,7 @@ # # spec file for package python-dynaconf # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,21 +19,23 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-dynaconf -Version: 2.1.1 +Version: 2.2.3 Release: 0 Summary: The dynamic configurator for your Python Project License: MIT -Group: Development/Languages/Python URL: https://github.com/rochacbruno/dynaconf Source: https://github.com/rochacbruno/dynaconf/archive/%{version}.tar.gz +Patch0: box-4.0.patch BuildRequires: %{python_module setuptools >= 38.6.0} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-PyYAML Requires: python-click Requires: python-configobj +Requires: python-hvac Requires: python-python-box Requires: python-python-dotenv +Requires: python-redis Requires: python-setuptools Requires: python-toml BuildArch: noarch @@ -42,10 +44,12 @@ BuildRequires: %{python_module Flask >= 0.12} BuildRequires: %{python_module PyYAML} BuildRequires: %{python_module click} BuildRequires: %{python_module configobj} +BuildRequires: %{python_module hvac} BuildRequires: %{python_module pytest-mock} BuildRequires: %{python_module pytest} BuildRequires: %{python_module python-box} BuildRequires: %{python_module python-dotenv} +BuildRequires: %{python_module redis} BuildRequires: %{python_module toml} # /SECTION %python_subpackages @@ -55,6 +59,11 @@ The dynamic configurator for your Python Project %prep %setup -q -n dynaconf-%{version} +%patch0 -p1 + +# require running docker with the server +rm tests/test_redis.py +rm tests/test_vault.py %build %python_build @@ -64,7 +73,7 @@ The dynamic configurator for your Python Project %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -%pytest +%pytest tests/ %files %{python_files} %doc CHANGELOG.md README.md