forked from pool/python-dynaconf
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
This commit is contained in:
committed by
Git OBS Bridge
parent
42ab3f267d
commit
80d13f36e2
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:bc46feb686e8a7e850582652f0fe3c7a24761d3628b66aef81921e89499795ef
|
||||
size 170804
|
||||
@@ -1,78 +0,0 @@
|
||||
From fa726b66fc4da0765790d8d0ca27866c331ef087 Mon Sep 17 00:00:00 2001
|
||||
From: Bruno Rocha <rochacbruno@gmail.com>
|
||||
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,
|
||||
+ }
|
||||
)
|
||||
|
||||
|
||||
3
dynaconf-3.0.0.tar.gz
Normal file
3
dynaconf-3.0.0.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:dcdc2627b8cd197e341040067d47f3e7ab4d931e34b4dd59db3f79f4d8097051
|
||||
size 1342241
|
||||
@@ -1,3 +1,14 @@
|
||||
-------------------------------------------------------------------
|
||||
Sun Aug 9 10:53:55 UTC 2020 - John Vandenberg <jayvdb@gmail.com>
|
||||
|
||||
- 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 <pgajdos@suse.com>
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
33
redis-server-url.patch
Normal file
33
redis-server-url.patch
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user