Accepting request 1103988 from devel:languages:python
- add python312.patch to fix build with python 3.12 OBS-URL: https://build.opensuse.org/request/show/1103988 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-UkPostcodeParser?expand=0&rev=5
This commit is contained in:
commit
7cd903ef66
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Aug 15 07:31:36 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
||||||
|
|
||||||
|
- add python312.patch to fix build with python 3.12
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Fri Apr 21 12:21:28 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
Fri Apr 21 12:21:28 UTC 2023 - Dirk Müller <dmueller@suse.com>
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ License: MIT
|
|||||||
Group: Development/Languages/Python
|
Group: Development/Languages/Python
|
||||||
URL: https://github.com/hamstah/ukpostcodeparser
|
URL: https://github.com/hamstah/ukpostcodeparser
|
||||||
Source: https://files.pythonhosted.org/packages/source/U/UkPostcodeParser/UkPostcodeParser-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/U/UkPostcodeParser/UkPostcodeParser-%{version}.tar.gz
|
||||||
|
Patch1: python312.patch
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
@ -37,7 +38,7 @@ BuildArch: noarch
|
|||||||
United Kingdom Postcode parser.
|
United Kingdom Postcode parser.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n UkPostcodeParser-%{version}
|
%autosetup -p1 -n UkPostcodeParser-%{version}
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%python_build
|
%python_build
|
||||||
@ -55,6 +56,7 @@ sed -i 's/test_\(091\|097\|098\|125\|131\)/_test_\1/' ukpostcodeparser/test/pars
|
|||||||
%files %{python_files}
|
%files %{python_files}
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%doc README
|
%doc README
|
||||||
%{python_sitelib}/*
|
%{python_sitelib}/ukpostcodeparser
|
||||||
|
%{python_sitelib}/UkPostcodeParser-%{version}*-info
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
38
python312.patch
Normal file
38
python312.patch
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
--- a/ukpostcodeparser/test/parser.py
|
||||||
|
+++ b/ukpostcodeparser/test/parser.py
|
||||||
|
@@ -18,7 +18,7 @@
|
||||||
|
|
||||||
|
with self.assertRaises(ValueError) as cm:
|
||||||
|
parse_uk_postcode('N16', True, True)
|
||||||
|
- self.assertEquals(cm.exception.__class__, IncodeNotFoundError)
|
||||||
|
+ self.assertEqual(cm.exception.__class__, IncodeNotFoundError)
|
||||||
|
|
||||||
|
def test_max_length_exceeded_error_is_value_error(self):
|
||||||
|
"""
|
||||||
|
@@ -28,7 +28,7 @@
|
||||||
|
|
||||||
|
with self.assertRaises(ValueError) as cm:
|
||||||
|
parse_uk_postcode('N16 8QSSS', True, True)
|
||||||
|
- self.assertEquals(cm.exception.__class__, MaxLengthExceededError)
|
||||||
|
+ self.assertEqual(cm.exception.__class__, MaxLengthExceededError)
|
||||||
|
|
||||||
|
def test_invalid_postcode_error_is_value_error(self):
|
||||||
|
"""
|
||||||
|
@@ -38,7 +38,7 @@
|
||||||
|
|
||||||
|
with self.assertRaises(ValueError) as cm:
|
||||||
|
parse_uk_postcode('xx0 2yr', True, True)
|
||||||
|
- self.assertEquals(cm.exception.__class__, InvalidPostcodeError)
|
||||||
|
+ self.assertEqual(cm.exception.__class__, InvalidPostcodeError)
|
||||||
|
|
||||||
|
|
||||||
|
class PostcodeTestCase(unittest.TestCase):
|
||||||
|
@@ -68,7 +68,7 @@
|
||||||
|
m = 'Expected {!r} but got {!r} for postcode={!r}, strict={!r} and ' \
|
||||||
|
'incode_mandatory={!r}'
|
||||||
|
|
||||||
|
- self.assertEquals(
|
||||||
|
+ self.assertEqual(
|
||||||
|
expected,
|
||||||
|
result,
|
||||||
|
m.format(
|
Loading…
Reference in New Issue
Block a user