2022-04-20 07:25:45 +00:00
|
|
|
#
|
|
|
|
# spec file for package python-email-validator
|
|
|
|
#
|
2024-06-06 07:39:25 +00:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2022-04-20 07:25:45 +00:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2023-05-25 07:24:02 +00:00
|
|
|
%{?sle15_python_module_pythons}
|
2022-04-20 07:25:45 +00:00
|
|
|
Name: python-email-validator
|
2024-06-19 07:08:46 +00:00
|
|
|
Version: 2.1.2
|
2022-04-20 07:25:45 +00:00
|
|
|
Release: 0
|
|
|
|
Summary: A robust email syntax and deliverability validation library for Python
|
|
|
|
License: CC0-1.0
|
|
|
|
URL: https://github.com/JoshData/python-email-validator
|
|
|
|
Source: https://github.com/JoshData/python-email-validator/archive/refs/tags/v%{version}.tar.gz#/email_validator-%{version}.tar.gz
|
2022-09-08 07:28:34 +00:00
|
|
|
# PATCH-FIX-OPENSUSE Ignore DeprecationWarning until requests-toolbelt is fixed
|
|
|
|
# (Pulled in by dnspython)
|
|
|
|
Patch0: ignore-urllib3-pyopenssl-warning.patch
|
2023-11-16 10:03:49 +00:00
|
|
|
BuildRequires: %{python_module base >= 3.8}
|
2022-04-20 07:25:45 +00:00
|
|
|
BuildRequires: %{python_module dnspython >= 1.15.0}
|
|
|
|
BuildRequires: %{python_module idna >= 2.0.0}
|
|
|
|
BuildRequires: %{python_module pytest >= 5.0}
|
|
|
|
BuildRequires: %{python_module setuptools}
|
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: python-rpm-macros
|
|
|
|
Requires: python-dnspython >= 1.15.0
|
|
|
|
Requires: python-idna >= 2.0.0
|
|
|
|
Requires: python-setuptools
|
|
|
|
Requires(post): update-alternatives
|
2024-06-06 07:39:25 +00:00
|
|
|
Requires(postun): update-alternatives
|
2022-04-20 07:25:45 +00:00
|
|
|
Provides: python-email_validator = %{version}-%{release}
|
|
|
|
Obsoletes: python-email_validator < %{version}-%{release}
|
|
|
|
BuildArch: noarch
|
|
|
|
%python_subpackages
|
|
|
|
|
|
|
|
%description
|
|
|
|
A robust email address syntax and deliverability validation library
|
|
|
|
for Python 2.7/3.4 by Joshua Tauberer.
|
|
|
|
|
|
|
|
This library validates that address are of the form ``x@y.com``. This is
|
|
|
|
the sort of validation you would want for a login form on a website.
|
|
|
|
|
|
|
|
Key features:
|
|
|
|
|
|
|
|
* Good for validating email addresses used for logins/identity.
|
|
|
|
* Friendly error messages when validation fails (appropriate to show to end users).
|
|
|
|
* (optionally) Checks deliverability: Does the domain name resolve?
|
|
|
|
* Supports internationalized domain names and (optionally) internationalized local parts.
|
|
|
|
* Normalizes email addresses (super important for internationalized addresses! see below).
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%autosetup -p1 -n python-email-validator-%{version}
|
|
|
|
|
|
|
|
%build
|
|
|
|
%python_build
|
|
|
|
|
|
|
|
%install
|
|
|
|
%python_install
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/email_validator
|
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
|
|
|
|
%check
|
- Add dont-require-resolv-tests.patch to make tests run without an
existing /etc/resolv.conf file
- Update to 2.0.0:
This is a major update to the library, but since email address specs
haven't changed there should be no significant changes to which
email addresses are considered valid or invalid with default
options. There are new options for accepting unusual email addresses
that were previously always rejected, some changes to how DNS errors
are handled, many changes in error message text, and major internal
improvements including the addition of type annotations. Python 3.7+
is now required. Details follow:
* Python 2.x and 3.x versions through 3.6, and dnspython 1.x, are no
longer supported. Python 3.7+ with dnspython 2.x are now required.
* The dnspython package is no longer required if DNS checks are not
used, although it will install automatically.
* NoNameservers and NXDOMAIN DNS errors are now handled differently:
NoNameservers no longer fails validation, and NXDOMAIN now skips
checking for an A/AAAA fallback and goes straight to failing
validation.
* Some syntax error messages have changed because they are now
checked explicitly rather than as a part of other checks.
* The quoted-string local part syntax (e.g. multiple @-signs,
spaces, etc. if surrounded by quotes) and domain-literal addresses
(e.g. @[192.XXX...] or @[IPv6:...]) are now parsed but not
considered valid by default. Better error messages are now given
for these addresses since it can be confusing for a technically
valid address to be rejected, and new allow_quoted_local and
allow_domain_literal options are added to allow these addresses if
you really need them.
* Some other error messages have changed to not repeat the email
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-email-validator?expand=0&rev=11
2023-05-25 08:33:48 +00:00
|
|
|
echo "nameserver 1.1.1.1" > resolv.conf
|
|
|
|
export RESOLV_FILE=$PWD/resolv.conf
|
2023-05-25 08:53:50 +00:00
|
|
|
# test_caching_dns_resolver fails when running with kvm
|
|
|
|
donttest="test_caching_dns_resolver"
|
|
|
|
%pytest tests -k "not ($donttest)"
|
2022-04-20 07:25:45 +00:00
|
|
|
|
|
|
|
%post
|
|
|
|
%python_install_alternative email_validator
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%python_uninstall_alternative email_validator
|
|
|
|
|
|
|
|
%files %{python_files}
|
|
|
|
%license LICENSE
|
|
|
|
%doc README.md
|
|
|
|
%python_alternative %{_bindir}/email_validator
|
|
|
|
%{python_sitelib}/email_validator
|
|
|
|
%{python_sitelib}/email_validator-%{version}*-info
|
|
|
|
|
|
|
|
%changelog
|