forked from pool/python-pyeapi
Accepting request 1147505 from devel:languages:python
- Switch to autosetup macro. - Add patch no-more-imp.patch: * Use importlib, rather than imp. OBS-URL: https://build.opensuse.org/request/show/1147505 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pyeapi?expand=0&rev=7
This commit is contained in:
33
no-more-imp.patch
Normal file
33
no-more-imp.patch
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
From d6fe3ef701e25ebb599bbfeec9d30649e37c9940 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Steve Kowalik <steven@wedontsleep.org>
|
||||||
|
Date: Mon, 19 Feb 2024 16:50:47 +1100
|
||||||
|
Subject: [PATCH] Switch to importlib for realoading
|
||||||
|
|
||||||
|
Since 3.7, importlib has supported a reload method, and since 3.12 has
|
||||||
|
removed the imp module entirely, we should switch to using importlib.
|
||||||
|
---
|
||||||
|
test/unit/test_client.py | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/test/unit/test_client.py b/test/unit/test_client.py
|
||||||
|
index 3472951..0136add 100644
|
||||||
|
--- a/test/unit/test_client.py
|
||||||
|
+++ b/test/unit/test_client.py
|
||||||
|
@@ -32,7 +32,7 @@
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
import unittest
|
||||||
|
-import imp
|
||||||
|
+import importlib
|
||||||
|
|
||||||
|
sys.path.append(os.path.join(os.path.dirname(__file__), '../lib'))
|
||||||
|
|
||||||
|
@@ -227,7 +227,7 @@ class TestClient(unittest.TestCase):
|
||||||
|
def setUp(self):
|
||||||
|
if 'EAPI_CONF' in os.environ:
|
||||||
|
del os.environ['EAPI_CONF']
|
||||||
|
- imp.reload(pyeapi.client)
|
||||||
|
+ importlib.reload(pyeapi.client)
|
||||||
|
|
||||||
|
def test_load_config_for_connection_with_filename(self):
|
||||||
|
conf = get_fixture('eapi.conf')
|
@@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Feb 19 06:06:04 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
|
||||||
|
|
||||||
|
- Switch to autosetup macro.
|
||||||
|
- Add patch no-more-imp.patch:
|
||||||
|
* Use importlib, rather than imp.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Jan 1 20:15:51 UTC 2024 - Dirk Müller <dmueller@suse.com>
|
Mon Jan 1 20:15:51 UTC 2024 - Dirk Müller <dmueller@suse.com>
|
||||||
|
|
||||||
|
@@ -23,9 +23,11 @@ Version: 1.0.2
|
|||||||
Release: 0
|
Release: 0
|
||||||
Summary: Python Client for eAPI
|
Summary: Python Client for eAPI
|
||||||
License: BSD-3-Clause
|
License: BSD-3-Clause
|
||||||
Group: Development/Languages/Python
|
|
||||||
URL: https://github.com/arista-eosplus/pyeapi
|
URL: https://github.com/arista-eosplus/pyeapi
|
||||||
Source: https://files.pythonhosted.org/packages/source/p/pyeapi/pyeapi-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/p/pyeapi/pyeapi-%{version}.tar.gz
|
||||||
|
# PATCH-FIX-UPSTREAM gh#arista-eosplus/pyeapi#292
|
||||||
|
Patch0: no-more-imp.patch
|
||||||
|
BuildRequires: %{python_module base >= 3.7}
|
||||||
BuildRequires: %{python_module netaddr}
|
BuildRequires: %{python_module netaddr}
|
||||||
BuildRequires: %{python_module pip}
|
BuildRequires: %{python_module pip}
|
||||||
BuildRequires: %{python_module pytest}
|
BuildRequires: %{python_module pytest}
|
||||||
@@ -51,7 +53,7 @@ implementation for working with the EOS configuration and is extensible for
|
|||||||
developing custom implementations.
|
developing custom implementations.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n pyeapi-%{version}
|
%autosetup -p1 -n pyeapi-%{version}
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%pyproject_wheel
|
%pyproject_wheel
|
||||||
|
Reference in New Issue
Block a user