- Add patch support-python-313.patch:

* Do not use crypt for testing.
- Switch to pyproject macros.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-testinfra?expand=0&rev=18
This commit is contained in:
2024-12-04 06:05:03 +00:00
committed by Git OBS Bridge
parent 5c7a69a6c0
commit ce0a1ae581
3 changed files with 46 additions and 5 deletions

View File

@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Dec 4 06:04:30 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch support-python-313.patch:
* Do not use crypt for testing.
- Switch to pyproject macros.
-------------------------------------------------------------------
Fri Jun 7 07:02:49 UTC 2024 - Dirk Müller <dmueller@suse.com>

View File

@@ -22,17 +22,20 @@ Version: 10.1.1
Release: 0
Summary: Python module to test infrastructures
License: Apache-2.0
Group: Development/Languages/Python
URL: https://github.com/pytest-dev/pytest-testinfra
Source: https://files.pythonhosted.org/packages/source/p/pytest-testinfra/pytest-testinfra-%{version}.tar.gz
# PATCH-FIX-OPENSUSE testinfra-parametrize-backends-test.patch -- make backends deselectable which are not available for testing
Patch1: testinfra-parametrize-backends-test.patch
Patch0: testinfra-parametrize-backends-test.patch
# PATCH-FIX-UPSTREAM gh#pytest-dev/pytest-testinfra#764
Patch1: support-python-313.patch
BuildRequires: %{python_module paramiko}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module pywinrm}
BuildRequires: %{python_module setuptools_scm}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module tornado}
BuildRequires: %{python_module wheel}
BuildRequires: ansible
BuildRequires: fdupes
BuildRequires: python-rpm-macros
@@ -59,10 +62,10 @@ sed -i -e '/\[tool:pytest\]/ a markers = \
destructive' setup.cfg
%build
%python_build
%pyproject_wheel
%install
%python_install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}/testinfra
%check
@@ -79,6 +82,6 @@ fi
%doc CHANGELOG.rst README.rst
%license LICENSE
%{python_sitelib}/testinfra
%{python_sitelib}/pytest_testinfra-%{version}*-info
%{python_sitelib}/pytest_testinfra-%{version}.dist-info
%changelog

31
support-python-313.patch Normal file
View File

@@ -0,0 +1,31 @@
From 20ef83970b24cd53ce7f5bf952360d8b99a0b7de Mon Sep 17 00:00:00 2001
From: Martin Hoyer <mhoyer@redhat.com>
Date: Tue, 7 May 2024 15:55:07 +0200
Subject: [PATCH] Remove crypt lib from testing
---
test/test_modules.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/test_modules.py b/test/test_modules.py
index 23a1f2f2..15416344 100644
--- a/test/test_modules.py
+++ b/test/test_modules.py
@@ -10,7 +10,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-import crypt
import datetime
import os
import re
@@ -257,7 +256,8 @@ def test_nonexistent_user(host):
def test_current_user(host):
assert host.user().name == "root"
pw = host.user().password
- assert crypt.crypt("foo", pw) == pw
+ assert pw.startswith("$")
+ assert len(pw) == 73
def test_group(host):