From ce0a1ae58110f0820e2e832d20920cbdb4a09fed6053d0c0157c7342b0207240 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Wed, 4 Dec 2024 06:05:03 +0000 Subject: [PATCH] - 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 --- python-pytest-testinfra.changes | 7 +++++++ python-pytest-testinfra.spec | 13 ++++++++----- support-python-313.patch | 31 +++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 support-python-313.patch diff --git a/python-pytest-testinfra.changes b/python-pytest-testinfra.changes index bf34fad..7cb49bf 100644 --- a/python-pytest-testinfra.changes +++ b/python-pytest-testinfra.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Dec 4 06:04:30 UTC 2024 - Steve Kowalik + +- 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 diff --git a/python-pytest-testinfra.spec b/python-pytest-testinfra.spec index 07a1eb1..af5cc9f 100644 --- a/python-pytest-testinfra.spec +++ b/python-pytest-testinfra.spec @@ -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 diff --git a/support-python-313.patch b/support-python-313.patch new file mode 100644 index 0000000..5c262a5 --- /dev/null +++ b/support-python-313.patch @@ -0,0 +1,31 @@ +From 20ef83970b24cd53ce7f5bf952360d8b99a0b7de Mon Sep 17 00:00:00 2001 +From: Martin Hoyer +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):