From a3c77c45b9b253aaaf158e509281a5a39270287d6fe135db8ea2b4d548ecdeca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 13 Dec 2024 11:22:52 +0100 Subject: [PATCH] Sync from SUSE:SLFO:Main python-email-validator revision a81d826b496063a8ba7992980dfe5072 --- dont-require-resolv-tests.patch | 59 ------------------------- email_validator-2.0.0.tar.gz | 3 -- email_validator-2.2.0.tar.gz | 3 ++ python-email-validator.changes | 78 ++++++++++++++++++++++++++++++++- python-email-validator.spec | 10 ++--- 5 files changed, 84 insertions(+), 69 deletions(-) delete mode 100644 dont-require-resolv-tests.patch delete mode 100644 email_validator-2.0.0.tar.gz create mode 100644 email_validator-2.2.0.tar.gz diff --git a/dont-require-resolv-tests.patch b/dont-require-resolv-tests.patch deleted file mode 100644 index 45efa13..0000000 --- a/dont-require-resolv-tests.patch +++ /dev/null @@ -1,59 +0,0 @@ -Index: python-email-validator-2.0.0/email_validator/deliverability.py -=================================================================== ---- python-email-validator-2.0.0.orig/email_validator/deliverability.py -+++ python-email-validator-2.0.0/email_validator/deliverability.py -@@ -6,11 +6,11 @@ import dns.resolver - import dns.exception - - --def caching_resolver(*, timeout: Optional[int] = None, cache=None): -+def caching_resolver(*, timeout: Optional[int] = None, cache=None, resolv=None): - if timeout is None: - from . import DEFAULT_TIMEOUT - timeout = DEFAULT_TIMEOUT -- resolver = dns.resolver.Resolver() -+ resolver = dns.resolver.Resolver(filename=resolv or '/etc/resolv.conf') - resolver.cache = cache or dns.resolver.LRUCache() # type: ignore - resolver.lifetime = timeout # type: ignore # timeout, in seconds - return resolver -Index: python-email-validator-2.0.0/tests/mocked_dns_response.py -=================================================================== ---- python-email-validator-2.0.0.orig/tests/mocked_dns_response.py -+++ python-email-validator-2.0.0/tests/mocked_dns_response.py -@@ -1,5 +1,6 @@ - import dns.resolver - import json -+import os - import os.path - import pytest - -@@ -32,7 +33,8 @@ class MockedDnsResponseData: - - # Return a new dns.resolver.Resolver configured for caching - # using the singleton instance. -- return caching_resolver(cache=MockedDnsResponseData.INSTANCE) -+ return caching_resolver(cache=MockedDnsResponseData.INSTANCE, -+ resolv=os.environ.get('RESOLV_FILE')) - - def __init__(self): - self.data = {} -Index: python-email-validator-2.0.0/tests/test_deliverability.py -=================================================================== ---- python-email-validator-2.0.0.orig/tests/test_deliverability.py -+++ python-email-validator-2.0.0/tests/test_deliverability.py -@@ -1,5 +1,6 @@ - import pytest - import re -+import os - - from email_validator import EmailUndeliverableError, \ - validate_email, caching_resolver -@@ -73,7 +74,7 @@ def test_caching_dns_resolver(): - self.cache[key] = value - - cache = TestCache() -- resolver = caching_resolver(timeout=1, cache=cache) -+ resolver = caching_resolver(timeout=1, cache=cache, resolv=os.environ.get('RESOLV_FILE')) - validate_email("test@gmail.com", dns_resolver=resolver) - assert len(cache.cache) == 1 - diff --git a/email_validator-2.0.0.tar.gz b/email_validator-2.0.0.tar.gz deleted file mode 100644 index b166b8f..0000000 --- a/email_validator-2.0.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0cd656b4c2cba10bcb518808f800bdde74af0c01a2522a9d475b3b1954d98f01 -size 39142 diff --git a/email_validator-2.2.0.tar.gz b/email_validator-2.2.0.tar.gz new file mode 100644 index 0000000..3329a77 --- /dev/null +++ b/email_validator-2.2.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:27aeaf92492d8d86d42f858ee2abf7fe2ec69b0724e8bfa25d0dbcb59cbd47ee +size 43055 diff --git a/python-email-validator.changes b/python-email-validator.changes index 90afade..4f04d3d 100644 --- a/python-email-validator.changes +++ b/python-email-validator.changes @@ -1,3 +1,79 @@ +------------------------------------------------------------------- +Sat Jun 29 16:02:19 UTC 2024 - Dirk Müller + +- update to 2.2.0: + * Email addresses with internationalized local parts could, + with rare Unicode characters, be returned as valid but + actually be invalid in their normalized form (returned in the + `normalized` field). Local parts now re-validated after + Unicode NFC normalization to ensure that invalid characters + cannot be injected into the normalized address and that + characters with length-increasing NFC normalizations cannot + cause a local part to exceed the maximum length after + normalization. + * The length check for email addresses with internationalized + local parts is now also applied to the original address + string prior to Unicode NFC normalization, which may be + longer and could exceed the maximum email address length, to + protect callers who do not use the returned normalized + address. + * Improved error message for IDNA domains that are too long or + have invalid characters after Unicode normalization. + * A new option to parse `My Name ` strings, + i.e. a display name plus an email address in angle brackets, + is now available. It is off by default. + * Improvements to Python typing. + * Some additional tests added. + +------------------------------------------------------------------- +Wed Jun 19 07:08:36 UTC 2024 - Dirk Müller + +- update to 2.1.2: + * The domain name length limit is corrected from 255 to 253 + IDNA ASCII characters. I misread the RFCs. + * When a domain name has no MX record but does have an A or + AAAA record, if none of the IP addresses in the response are + globally reachable (i.e. not Private-Use, Loopback, etc.), + the response is treated as if there was no A/AAAA response + and the email address will fail the deliverability check. + * When a domain name has no MX record but does have an A or + AAAA record, the mx field in the object returned by + validate_email incorrectly held the IP addresses rather than + the domain itself. + * Fixes in tests. + +------------------------------------------------------------------- +Thu Jun 6 07:38:28 UTC 2024 - Dirk Müller + +- update to 2.1.1: + * Fixed typo 'marking' instead of 'marketing' in case- + insensitive mailbox name list. + * When DNS-based deliverability checks fail, in some cases + exceptions are now thrown with `raise ... from` for better + nested exception tracking. + * Fixed tests to work when no local resolver can be configured. + * This project is now licensed under the Unlicense (instead of + CC0). + * Minor improvements to tests. + * Minor improvements to code style. +- drop dont-require-resolv-tests.patch: obsolete + +------------------------------------------------------------------- +Thu Nov 16 10:02:55 UTC 2023 - Dirk Müller + +- update to 2.1.0: + * Python 3.8+ is now required (support for Python 3.7 was + dropped). + * The old `email` field on the returned `ValidatedEmail` + object, which in the previous version was superseded by + `normalized`, will now raise a deprecation warning if used. + See https://stackoverflow.com/q/879173 for strategies to + suppress the DeprecationWarning. + * A `__version__` module attribute is added. + * The email address argument to validate_email is now marked as + positional-only to better reflect the documented usage using + the new Python 3.8 feature. + ------------------------------------------------------------------- Thu May 25 08:23:47 UTC 2023 - Daniel Garcia @@ -95,7 +171,7 @@ Thu Sep 8 07:24:18 UTC 2022 - Steve Kowalik TEST_ENVIRONMENT, and DEFAULT_TIMEOUT can be used to change the default values of the keyword arguments. - Add patch ignore-urllib3-pyopenssl-warning.patch: - * Ignore warning as error from requests-toolbelt via dnspython. + * Ignore warning as error from requests-toolbelt via dnspython. ------------------------------------------------------------------- Tue Apr 19 17:42:44 UTC 2022 - Matej Cepl diff --git a/python-email-validator.spec b/python-email-validator.spec index 394bd15..90c91b3 100644 --- a/python-email-validator.spec +++ b/python-email-validator.spec @@ -1,7 +1,7 @@ # # spec file for package python-email-validator # -# 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 @@ -17,9 +17,8 @@ %{?sle15_python_module_pythons} -%define skip_python2 1 Name: python-email-validator -Version: 2.0.0 +Version: 2.2.0 Release: 0 Summary: A robust email syntax and deliverability validation library for Python License: CC0-1.0 @@ -28,8 +27,7 @@ Source: https://github.com/JoshData/python-email-validator/archive/refs/ # PATCH-FIX-OPENSUSE Ignore DeprecationWarning until requests-toolbelt is fixed # (Pulled in by dnspython) Patch0: ignore-urllib3-pyopenssl-warning.patch -# PATCH-FIX-OPENSUSE do not require /etc/resolv.conf for testing -Patch1: dont-require-resolv-tests.patch +BuildRequires: %{python_module base >= 3.8} BuildRequires: %{python_module dnspython >= 1.15.0} BuildRequires: %{python_module idna >= 2.0.0} BuildRequires: %{python_module pytest >= 5.0} @@ -40,7 +38,7 @@ Requires: python-dnspython >= 1.15.0 Requires: python-idna >= 2.0.0 Requires: python-setuptools Requires(post): update-alternatives -Requires(postun):update-alternatives +Requires(postun): update-alternatives Provides: python-email_validator = %{version}-%{release} Obsoletes: python-email_validator < %{version}-%{release} BuildArch: noarch