commit fb31b4b0154e3985511f9d03bd319bdadef9f7ac Author: tigro Date: Sat Jan 4 20:58:33 2025 +0300 import python-email-validator-2.2.0-3.el10 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..554fc6e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/python-email-validator-2.2.0.tar.gz diff --git a/.python-email-validator.metadata b/.python-email-validator.metadata new file mode 100644 index 0000000..7c09261 --- /dev/null +++ b/.python-email-validator.metadata @@ -0,0 +1 @@ +a47221108597438ed956f5626c9639ea7f990431 SOURCES/python-email-validator-2.2.0.tar.gz diff --git a/SOURCES/143.patch b/SOURCES/143.patch new file mode 100644 index 0000000..3f46d40 --- /dev/null +++ b/SOURCES/143.patch @@ -0,0 +1,91 @@ +From 6d32d7a7bb3682891656ab91562c5df379cdf66f Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Fri, 21 Jun 2024 10:11:47 -0400 +Subject: [PATCH 1/3] Fix a minor typo in README.md (validing/validating) + +--- + README.md | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/README.md b/README.md +index 895dfa9..5c1af43 100644 +--- a/README.md ++++ b/README.md +@@ -12,7 +12,7 @@ users by their email address like on a registration form. + Key features: + + * Checks that an email address has the correct syntax --- great for +- email-based registration/login forms or validing data. ++ email-based registration/login forms or validating data. + * Gives friendly English error messages when validation fails that you + can display to end-users. + * Checks deliverability (optional): Does the domain name resolve? + +From 1b2be12df83498144b5d30b05d49ad9798a681e8 Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Fri, 21 Jun 2024 10:12:38 -0400 +Subject: [PATCH 2/3] Fix a minor typo in CHANGELOG.md (Verison/Version) + +--- + CHANGELOG.md | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CHANGELOG.md b/CHANGELOG.md +index 2aea055..4bf9451 100644 +--- a/CHANGELOG.md ++++ b/CHANGELOG.md +@@ -77,7 +77,7 @@ Version 1.2.1 (May 1, 2022) + * example.com/net/org are removed from the special-use reserved domain names list so that they do not raise exceptions if check_deliverability is off. + * Improved README. + +-Verison 1.2.0 (April 24, 2022) ++Version 1.2.0 (April 24, 2022) + ------------------------------ + + * Reject domains with NULL MX records (when deliverability checks + +From 8e1f67e47d789cd88ac6e016b187bbf9be805729 Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Fri, 21 Jun 2024 10:13:34 -0400 +Subject: [PATCH 3/3] Fix minor typos in code comments + +--- + email_validator/__main__.py | 2 +- + email_validator/syntax.py | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/email_validator/__main__.py b/email_validator/__main__.py +index 52791c7..caa111b 100644 +--- a/email_validator/__main__.py ++++ b/email_validator/__main__.py +@@ -38,7 +38,7 @@ def main(dns_resolver: Optional[_Resolver] = None) -> None: + options[varname.lower()] = float(os.environ[varname]) + + if len(sys.argv) == 1: +- # Validate the email addresses pased line-by-line on STDIN. ++ # Validate the email addresses passed line-by-line on STDIN. + dns_resolver = dns_resolver or caching_resolver() + for line in sys.stdin: + email = line.strip() +diff --git a/email_validator/syntax.py b/email_validator/syntax.py +index c655451..f53fd5b 100644 +--- a/email_validator/syntax.py ++++ b/email_validator/syntax.py +@@ -57,7 +57,7 @@ def split_string_at_unquoted_special(text: str, specials: Tuple[str, ...]) -> Tu + for i, c in enumerate(text): + # < plus U+0338 (Combining Long Solidus Overlay) normalizes to + # ≮ U+226E (Not Less-Than), and it would be confusing to treat +- # the < as the start of "" syntax in that case. Liekwise, ++ # the < as the start of "" syntax in that case. Likewise, + # if anything combines with an @ or ", we should probably not + # treat it as a special character. + if unicodedata.normalize("NFC", text[i:])[0] != c: +@@ -642,7 +642,7 @@ def validate_email_length(addrinfo: ValidatedEmail) -> None: + # form is checked first because it is the original input. + # 2) The normalized email address. We perform Unicode NFC normalization of + # the local part, we normalize the domain to internationalized characters +- # (if originaly IDNA ASCII) which also includes Unicode normalization, ++ # (if originally IDNA ASCII) which also includes Unicode normalization, + # and we may remove quotes in quoted local parts. We recommend that + # callers use this string, so it must be valid. + # 3) The email address with the IDNA ASCII representation of the domain diff --git a/SOURCES/email_validator.1 b/SOURCES/email_validator.1 new file mode 100644 index 0000000..6a9821f --- /dev/null +++ b/SOURCES/email_validator.1 @@ -0,0 +1,151 @@ +.TH EMAIL_VALIDATOR "1" "June 2024" "" "User Commands" +.SH NAME +.B email_validator +\(en Validate email addresses +.SH SYNOPSIS +.B email_validator +.I test@example.org +.P +.B email_validator < +.I LIST_OF_ADDRESSES.TXT +.SH DESCRIPTION +Provide email addresses to validate +either as a command-line argument or in +.I STDIN +separated by newlines. +Validation errors will be printed for invalid email addresses. +When passing an email address on the command line, +if the email address is valid, +information about it will be printed. +When using +.IR STDIN , +no output will be given for valid email addresses. +.P +Keyword arguments to the Python +.B email_validator.validate_email +function can be set in environment variables +of the same name but uppercase (see +.BR ENVIRONMENT ). +.SH ENVIRONMENT +.\" Supported environment variables can be read +.\" from near the beginning of the main() function +.\" in email_validator/__main__.py. +.\" +.\" Default values are in email_validator/__init__.py. +.\" +.\" Option descriptions are in README.md. +.SS "BOOLEAN" +For these environment variables, +any non-empty string value is interpreted as +.BR True , +the empty string is interpreted as +.BR False , +and a default value is used if the variable is unset. +.TP +.B ALLOW_SMPTUTF8 +Set to false to prohibit internationalized addresses +that would require the +.UR https://tools.ietf.org/html/rfc6531 +SMTPUTF8 +.UE +extension. +.IP +.IR default : +true +.\" Support ALLOW_DISPLAY_NAME and ALLOW_EMPTY_LOCAL in the CLI +.\" https://github.com/JoshData/python-email-validator/pull/145 +.\" .TP +.\" .B ALLOW_EMPTY_LOCAL +.\" Set to true to allow an empty local part +.\" (i.e. \fB@example.com\fR), +.\" e.g. for validating Postfix aliases. +.TP +.B ALLOW_QUOTED_LOCAL +Set to true to allow obscure and potentially problematic email addresses +in which the part of the address before the +.BR @ \-sign +contains spaces, +.BR @ \-signs, +or other surprising characters +when the local part is surrounded in quotes +(so-called quoted-string local parts). +In the object returned on successful validation, +the normalized local part removes any unnecessary backslash-escaping +and even removes the surrounding quotes +if the address would be valid without them. +.IP +.IR default : +false +.TP +.B ALLOW_DOMAIN_LITERAL +Set to true to allow bracketed IPv4 and "IPv6:"-prefixed IPv6 addresses +in the domain part of the email address. +No deliverability checks are performed for these addresses. +In the object returned on successful validation, +the normalized domain will use the condensed IPv6 format, if applicable. +The object\(cqs +.B domain_address +attribute will hold the parsed +.B ipaddress.IPv4Address +or +.B ipaddress.IPv6Address +object if applicable. +.IP +.IR default : +false +.\" Support ALLOW_DISPLAY_NAME and ALLOW_EMPTY_LOCAL in the CLI +.\" https://github.com/JoshData/python-email-validator/pull/145 +.\" .TP +.\" .B ALLOW_DISPLAY_NAME +.\" Set to true to allow a display name and bracketed address +.\" in the input string, like +.\" .BR My\ Name\ . +.\" It\(cqs implemented in the spirit but not the letter of RFC 5322 3.4, +.\" so it may be stricter or more relaxed than what you want. +.\" The display name, if present, is provided in the returned object\(cqs +.\" .Bdisplay_name +.\" field after being unquoted and unescaped. +.\" .IP +.\" .IR default : +.\" false +.TP +.B GLOBALLY_DELIVERABLE +.IP +.IR default : +true +.TP +.B CHECK_DELIVERABILITY +If true, DNS queries are made +to check that the domain name in the email address +(the part after the +.BR @ \-sign) +can receive mail\(embasically, +that the domain name in the email address has +a (non-Null) DNS MX record indicating that it can receive email. +If false, skip this DNS-based check. +It is recommended to set this to false +when performing validation for login pages +(but not account creation pages) +since re-validation of a previously validated domain in your database +by querying DNS at every login is probably undesirable. +.IP +.IR default : +true +.TP +.B TEST_ENVIRONMENT +If true, DNS-based deliverability checks are disabled and +.B test +and +.B **.test +domain names are permitted. +.IP +.IR default : +false +.SS "FLOATING-POINT" +For these environment variables, +any non-empty string is parsed as a floating-point value, +and a default value is used if the variable is unset. +.TP +.B DEFAULT_TIMEOUT +.IR default : +15 diff --git a/SPECS/python-email-validator.spec b/SPECS/python-email-validator.spec new file mode 100644 index 0000000..3db78fe --- /dev/null +++ b/SPECS/python-email-validator.spec @@ -0,0 +1,215 @@ +## START: Set by rpmautospec +## (rpmautospec version 0.7.2) +## RPMAUTOSPEC: autorelease, autochangelog +%define autorelease(e:s:pb:n) %{?-p:0.}%{lua: + release_number = 3; + base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); + print(release_number + base_release_number - 1); +}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} +## END: Set by rpmautospec + +Name: python-email-validator +Version: 2.2.0 +Release: %autorelease +Summary: A robust email syntax and deliverability validation library + +License: Unlicense +URL: https://github.com/JoshData/python-email-validator +Source0: %{url}/archive/v%{version}/python-email-validator-%{version}.tar.gz +# Man page hand-written for Fedora in groff_man(7) format, based closely on the +# comments in email_validator/__main__.py, email_validator/__init__.py, and +# README.md. +# +# Interest in a man page? +# https://github.com/JoshData/python-email-validator/issues/146 +Source1: email_validator.1 + +# Fix a few minor typos +# https://github.com/JoshData/python-email-validator/pull/143 +Patch: %{url}/pull/143.patch + +BuildArch: noarch + +BuildRequires: python3-devel +# test_requirements.txt pins exact versions and includes unwanted coverage and +# linting dependencies, so we fall back to manual BuildRequires: +BuildRequires: %{py3_dist pytest} + +%global _description %{expand: +This library validates that a string is of the form name@example.com and +optionally checks that the domain name is set up to receive email. This is the +sort of validation you would want when you are identifying users by their email +address like on a registration/login form (but not necessarily for composing an +email message). + +Key features: + + • Checks that an email address has the correct syntax – great for + email-based registration/login forms or validating data. + • Gives friendly English error messages when validation fails that you can + display to end-users. + • Checks deliverability (optional): Does the domain name resolve? (You can + override the default DNS resolver to add query caching.) + • Supports internationalized domain names and internationalized local parts. + • Rejects addresses with unsafe Unicode characters, obsolete email address + syntax that you’d find unexpected, special use domain names like + @localhost, and domains without a dot by default. This is an opinionated + library! + • Normalizes email addresses (important for internationalized and + quoted-string addresses!) + • Python type annotations are used.} + +%description %{_description} + +%package -n python3-email-validator +Summary: %{summary} + +%description -n python3-email-validator %{_description} + +%prep +%autosetup -n python-email-validator-%{version} -p1 + +%generate_buildrequires +%pyproject_buildrequires + +%build +%pyproject_wheel + +%install +%pyproject_install +%pyproject_save_files -l email_validator +install -t '%{buildroot}%{_mandir}/man1' -D -p -m 0644 '%{SOURCE1}' + +%check +%pytest -v tests -m 'not network' + +%files -n python3-email-validator -f %{pyproject_files} +%doc CHANGELOG.md README.md +%{_bindir}/email_validator +%{_mandir}/man1/email_validator.1* + +%changelog +* Sat Jan 04 2025 Arkady L. Shane - 2.2.0-3 +- Rebuilt for MSVSphere 10 + +## START: Generated by rpmautospec +* Fri Jul 19 2024 Fedora Release Engineering - 2.2.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Fri Jun 21 2024 Benjamin A. Beasley - 2.2.0-2 +- Add a man page for the email_validator command + +* Fri Jun 21 2024 Benjamin A. Beasley - 2.2.0-1 +- Update to 2.2.0 (close RHBZ#2293525) + +* Fri Jun 21 2024 Benjamin A. Beasley - 2.1.2-3 +- Apply a patch to fix typos +- This includes user-visible fixes for minor typos in README.md and + CHANGELOG.md + +* Fri Jun 21 2024 Benjamin A. Beasley - 2.1.2-2 +- Fix a minor typo in the description + +* Mon Jun 17 2024 Benjamin A. Beasley - 2.1.2-1 +- Update to 2.1.2 (close RHBZ#2292616) + +* Fri Jun 07 2024 Python Maint - 2.1.1-2 +- Rebuilt for Python 3.13 + +* Mon Feb 26 2024 Benjamin A. Beasley - 2.1.1-1 +- Update to 2.1.1 (close RHBZ#2266191) + +* Fri Jan 26 2024 Fedora Release Engineering - 2.1.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Mon Jan 22 2024 Fedora Release Engineering - 2.1.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Tue Jan 02 2024 Benjamin A. Beasley - 2.1.0-2 +- Assert %%pyproject_files contains a license file + +* Sun Oct 22 2023 Benjamin A. Beasley - 2.1.0-1 +- Update to 2.1.0 (close RHBZ#2245518) + +* Fri Jul 21 2023 Fedora Release Engineering - 2.0.0-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Thu Jul 13 2023 Benjamin A. Beasley - 2.0.0-6 +- Don’t package CONTRIBUTING.md; do package CHANGELOG.md + +* Thu Jul 13 2023 Benjamin A. Beasley - 2.0.0-5 +- Improve the package description + +* Thu Jul 13 2023 Benjamin A. Beasley - 2.0.0-4 +- Record that upstream was asked to consider relicensing + +* Thu Jul 13 2023 Benjamin A. Beasley - 2.0.0-3 +- Do not number the sole Source + +* Wed Jun 28 2023 Benjamin A. Beasley - 2.0.0-1 +- Update to 2.0.0 (close RHBZ#2203865) + +* Wed Jun 28 2023 Benjamin A. Beasley - 1.3.1-1 +- Update to 1.3.1 + +* Wed Jun 28 2023 Benjamin A. Beasley - 1.2.1-1 +- Update to 1.2.1 (includes breaking changes from 1.x) + +* Wed Jun 28 2023 Benjamin A. Beasley - 1.1.3-1 +- Update to 1.1.3 + +* Wed Jun 28 2023 Benjamin A. Beasley - 1.1.1-11 +- Update License to SPDX +- Fix up a few obsolete packaging practices +- Do not repeat the description text in the spec file +- Remove unnecessary and unwanted coverage dependencies +- Port to pyproject-rpm-macros + +* Thu Jun 15 2023 Python Maint - 1.1.1-10 +- Rebuilt for Python 3.12 + +* Fri Jan 20 2023 Fedora Release Engineering - 1.1.1-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Fri Jul 22 2022 Fedora Release Engineering - 1.1.1-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Tue Jun 14 2022 Python Maint - 1.1.1-7 +- Rebuilt for Python 3.11 + +* Fri Jan 21 2022 Fedora Release Engineering - 1.1.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Fri Jul 23 2021 Fedora Release Engineering - 1.1.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Fri Jun 04 2021 Python Maint - 1.1.1-4 +- Rebuilt for Python 3.10 + +* Wed Jan 27 2021 Fedora Release Engineering - 1.1.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Wed Jul 29 2020 Fedora Release Engineering - 1.1.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Wed Jun 03 2020 Fabian Affolter - 1.1.1-1 +- Enable tests +- Update to new upstream release 1.1.1 + +* Tue May 26 2020 Miro Hrončok - 1.0.5-4 +- Rebuilt for Python 3.9 + +* Thu Jan 30 2020 Fedora Release Engineering - 1.0.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Tue Jan 07 2020 Fabian Affolter - 1.0.5-2 +- Implement changes from rhbz#1787419 to match rhbz#1733683 + +* Mon Jan 06 2020 Susi Lehtola - 1.0.5-1 +- Update to 1.0.5. +- Review fixes. + +* Sat Jul 27 2019 Susi Lehtola - 1.0.4-1 +- Initial package. + +## END: Generated by rpmautospec