forked from pool/python-environ-config
Accepting request 1146301 from devel:languages:python
- Add patch support-moto-5.patch: * Support moto 5.0 changes. OBS-URL: https://build.opensuse.org/request/show/1146301 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-environ-config?expand=0&rev=4
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Feb 13 05:40:17 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- Add patch support-moto-5.patch:
|
||||
* Support moto 5.0 changes.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon May 29 14:06:27 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-environ-config
|
||||
#
|
||||
# Copyright (c) 2023 SUSE LLC
|
||||
# Copyright (c) 2024 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -23,6 +23,8 @@ Summary: Boilerplate-free configuration with env variables
|
||||
License: MIT
|
||||
URL: https://github.com/hynek/environ_config
|
||||
Source: https://files.pythonhosted.org/packages/source/e/environ-config/environ_config-%{version}.tar.gz
|
||||
# PATCH-FIX-UPSTREAM Based on gh#hynek/environ-config#76
|
||||
Patch0: support-moto-5.patch
|
||||
BuildRequires: %{python_module hatch-fancy-pypi-readme}
|
||||
BuildRequires: %{python_module hatch_vcs}
|
||||
BuildRequires: %{python_module hatchling}
|
||||
@@ -46,7 +48,7 @@ BuildRequires: %{python_module urllib3 < 2}
|
||||
Boilerplate-free configuration with env variables.
|
||||
|
||||
%prep
|
||||
%setup -q -n environ_config-%{version}
|
||||
%autosetup -p1 -n environ_config-%{version}
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
|
||||
71
support-moto-5.patch
Normal file
71
support-moto-5.patch
Normal file
@@ -0,0 +1,71 @@
|
||||
From 2c51eda55d152d4bd59f51a033c5976bfe05a897 Mon Sep 17 00:00:00 2001
|
||||
From: Steve Kowalik <steven@wedontsleep.org>
|
||||
Date: Tue, 13 Feb 2024 15:53:34 +1100
|
||||
Subject: [PATCH 1/2] Support moto 5.0
|
||||
|
||||
moto 5.0 has been released, and the major change is to pull all of the
|
||||
mocking into one function. Use the new mock_aws function, but continue
|
||||
to support moto 4.2, since it's easy.
|
||||
---
|
||||
pyproject.toml | 2 +-
|
||||
tests/test_secrets_awssm.py | 9 ++++++---
|
||||
2 files changed, 7 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/tests/test_secrets_awssm.py b/tests/test_secrets_awssm.py
|
||||
index db999d1..90b863c 100644
|
||||
--- a/tests/test_secrets_awssm.py
|
||||
+++ b/tests/test_secrets_awssm.py
|
||||
@@ -23,7 +23,10 @@
|
||||
import boto3
|
||||
import pytest
|
||||
|
||||
-from moto import mock_secretsmanager
|
||||
+try:
|
||||
+ from moto import mock_aws
|
||||
+except ImportError:
|
||||
+ from moto import mock_secretsmanager as mock_aws
|
||||
|
||||
import environ
|
||||
|
||||
@@ -62,7 +65,7 @@ def _mock_aws_credentials(force_region):
|
||||
|
||||
@pytest.fixture(name="secretsmanager")
|
||||
def _secretsmanager():
|
||||
- with mock_secretsmanager():
|
||||
+ with mock_aws():
|
||||
yield boto3.client("secretsmanager", region_name="us-east-2")
|
||||
|
||||
|
||||
@@ -122,7 +125,7 @@ def test_secret_works_with_default_client_overridden(
|
||||
class Cfg:
|
||||
pw = sm.secret()
|
||||
|
||||
- with mock_secretsmanager():
|
||||
+ with mock_aws():
|
||||
# we need to make sure we're using the same region. It doesn't
|
||||
# matter which -- moto _and_ boto will try figure it out from the
|
||||
# environment -- but it has to be the same.
|
||||
|
||||
From 40a01bee6579d9265e731b9f12e6a890f68bf0c5 Mon Sep 17 00:00:00 2001
|
||||
From: "pre-commit-ci[bot]"
|
||||
<66853113+pre-commit-ci[bot]@users.noreply.github.com>
|
||||
Date: Tue, 13 Feb 2024 04:56:33 +0000
|
||||
Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks
|
||||
|
||||
for more information, see https://pre-commit.ci
|
||||
---
|
||||
tests/test_secrets_awssm.py | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/tests/test_secrets_awssm.py b/tests/test_secrets_awssm.py
|
||||
index 90b863c..b109eb3 100644
|
||||
--- a/tests/test_secrets_awssm.py
|
||||
+++ b/tests/test_secrets_awssm.py
|
||||
@@ -23,6 +23,7 @@
|
||||
import boto3
|
||||
import pytest
|
||||
|
||||
+
|
||||
try:
|
||||
from moto import mock_aws
|
||||
except ImportError:
|
||||
Reference in New Issue
Block a user