From 80d13f36e2fb8ea7cc7a971fff36d6d2c4c8783067cd5b96c451fbd5ce17f9e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Mon, 10 Aug 2020 11:17:10 +0000 Subject: [PATCH] Accepting request 825159 from home:jayvdb:branches:devel:languages:python - Devendor the runtime package - Activate redis tests using redis-server-url.patch - Remove box-4.0.patch merged upstream - Update to v3.0.0 * Breaking change: Envless by default * See https://github.com/rochacbruno/dynaconf/blob/master/CHANGELOG.md for other changes OBS-URL: https://build.opensuse.org/request/show/825159 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dynaconf?expand=0&rev=14 --- 2.2.3.tar.gz | 3 -- box-4.0.patch | 78 ----------------------------------------- dynaconf-3.0.0.tar.gz | 3 ++ python-dynaconf.changes | 11 ++++++ python-dynaconf.spec | 16 ++++++--- redis-server-url.patch | 33 +++++++++++++++++ 6 files changed, 59 insertions(+), 85 deletions(-) delete mode 100644 2.2.3.tar.gz delete mode 100644 box-4.0.patch create mode 100644 dynaconf-3.0.0.tar.gz create mode 100644 redis-server-url.patch diff --git a/2.2.3.tar.gz b/2.2.3.tar.gz deleted file mode 100644 index 02ffded..0000000 --- a/2.2.3.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 5598e5e..0000000 --- a/box-4.0.patch +++ /dev/null @@ -1,78 +0,0 @@ -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/dynaconf-3.0.0.tar.gz b/dynaconf-3.0.0.tar.gz new file mode 100644 index 0000000..21c0ad6 --- /dev/null +++ b/dynaconf-3.0.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dcdc2627b8cd197e341040067d47f3e7ab4d931e34b4dd59db3f79f4d8097051 +size 1342241 diff --git a/python-dynaconf.changes b/python-dynaconf.changes index 92aae28..d6aa0c1 100644 --- a/python-dynaconf.changes +++ b/python-dynaconf.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Sun Aug 9 10:53:55 UTC 2020 - John Vandenberg + +- Devendor the runtime package +- Activate redis tests using redis-server-url.patch +- Remove box-4.0.patch merged upstream +- Update to v3.0.0 + * Breaking change: Envless by default + * See https://github.com/rochacbruno/dynaconf/blob/master/CHANGELOG.md + for other changes + ------------------------------------------------------------------- Tue May 26 07:22:48 UTC 2020 - Petr Gajdos diff --git a/python-dynaconf.spec b/python-dynaconf.spec index 54f8b7f..01e77e4 100644 --- a/python-dynaconf.spec +++ b/python-dynaconf.spec @@ -19,13 +19,13 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-dynaconf -Version: 2.2.3 +Version: 3.0.0 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 -Patch0: box-4.0.patch +Source: https://github.com/rochacbruno/dynaconf/archive/%{version}.tar.gz#/dynaconf-%{version}.tar.gz +Patch0: redis-server-url.patch BuildRequires: %{python_module setuptools >= 38.6.0} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -53,6 +53,7 @@ BuildRequires: %{python_module python-box} BuildRequires: %{python_module python-dotenv} BuildRequires: %{python_module redis} BuildRequires: %{python_module toml} +BuildRequires: redis # /SECTION %python_subpackages @@ -64,9 +65,10 @@ The dynamic configurator for your Python Project %patch0 -p1 # require running docker with the server -rm tests/test_redis.py rm tests/test_vault.py +rm -r dynaconf/vendor/ + %build %python_build @@ -76,6 +78,12 @@ rm tests/test_vault.py %python_expand %fdupes %{buildroot}%{$python_sitelib} %check +mkdir ~/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 & +export REDIS_URL=http://127.0.0.1:6379 %pytest tests/ %post diff --git a/redis-server-url.patch b/redis-server-url.patch new file mode 100644 index 0000000..cb955bd --- /dev/null +++ b/redis-server-url.patch @@ -0,0 +1,33 @@ +diff --git a/tests/test_redis.py b/tests/test_redis.py +index 34e7c2e..7e3005c 100644 +--- a/tests/test_redis.py ++++ b/tests/test_redis.py +@@ -15,14 +15,20 @@ def custom_checker(ip_address, port): + return True + + +-@pytest.fixture(scope="module") +-def docker_redis(docker_services): +- docker_services.start("redis") +- public_port = docker_services.wait_for_service( +- "redis", 6379, check_server=custom_checker +- ) +- url = f"http://{docker_services.docker_ip}:{public_port}" +- return url ++REDIS_URL = os.environ.get('REDIS_URL', None) ++if REDIS_URL: ++ @pytest.fixture(scope="module") ++ def docker_redis(): ++ return REDIS_URL ++else: ++ @pytest.fixture(scope="module") ++ def docker_redis(docker_services): ++ docker_services.start("redis") ++ public_port = docker_services.wait_for_service( ++ "redis", 6379, check_server=custom_checker ++ ) ++ url = f"http://{docker_services.docker_ip}:{public_port}" ++ return url + + + @pytest.mark.integration