diff --git a/fix-test-assertion-methods.patch b/fix-test-assertion-methods.patch new file mode 100644 index 0000000..9b4e872 --- /dev/null +++ b/fix-test-assertion-methods.patch @@ -0,0 +1,13 @@ +Index: xkcdpass-1.19.8/tests/test_xkcdpass.py +=================================================================== +--- xkcdpass-1.19.8.orig/tests/test_xkcdpass.py ++++ xkcdpass-1.19.8/tests/test_xkcdpass.py +@@ -58,7 +58,7 @@ class XkcdPasswordTests(unittest.TestCas + wordlist, numwords=numwords, random_delimiters=True + ) + # check that the result is the right length +- self.assertEquals(len(result), numwords * wordlength + (numwords - 1)) ++ self.assertEqual(len(result), numwords * wordlength + (numwords - 1)) + # check we have the right number of delimiters + self.assertEqual( + len([x for x in result if x in set(xkcd_password.DEFAULT_DELIMITERS)]), diff --git a/python-xkcdpass.changes b/python-xkcdpass.changes index 246a7b0..ab00ab3 100644 --- a/python-xkcdpass.changes +++ b/python-xkcdpass.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Mar 15 00:00:07 UTC 2024 - Steve Kowalik + +- Add patch fix-test-assertion-methods.patch, use correct assertion + methods. +- Switch to autosetup and pyproject macros. + ------------------------------------------------------------------- Wed Dec 13 10:11:38 UTC 2023 - Dirk Müller diff --git a/python-xkcdpass.spec b/python-xkcdpass.spec index 853cbf5..59fcbd0 100644 --- a/python-xkcdpass.spec +++ b/python-xkcdpass.spec @@ -1,7 +1,7 @@ # # spec file for package python-xkcdpass # -# 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 @@ -16,23 +16,23 @@ # -%define skip_python2 1 - Name: python-xkcdpass Version: 1.19.8 Release: 0 Summary: A flexible and scriptable password generator which generates strong passphrases License: BSD-3-Clause -Group: Development/Languages/Python URL: https://github.com/redacted/XKCD-password-generator Source: https://files.pythonhosted.org/packages/source/x/xkcdpass/xkcdpass-%{version}.tar.gz +Patch0: fix-test-assertion-methods.patch +BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros BuildArch: noarch Requires(post): update-alternatives -Requires(postun):update-alternatives +Requires(postun): update-alternatives %python_subpackages %description @@ -40,15 +40,15 @@ A flexible and scriptable password generator which generates strong passphrases, inspired by XKCD 936 (https://xkcd.com/936/) %prep -%setup -q -n xkcdpass-%{version} +%autosetup -p1 -n xkcdpass-%{version} # Remove the shebang sed -i -e '1d' xkcdpass/xkcd_password.py %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_clone -a %{buildroot}%{_bindir}/xkcdpass %python_expand %fdupes %{buildroot}%{$python_sitelib} @@ -69,6 +69,6 @@ pytest_python311_ignore="not test_entropy_printout_valid_input" %doc README.rst %python_alternative %{_bindir}/xkcdpass %{python_sitelib}/xkcdpass -%{python_sitelib}/xkcdpass-%{version}*-info +%{python_sitelib}/xkcdpass-%{version}.dist-info %changelog