1{ lib
2, buildPythonPackage
3, dnspython
4, fetchFromGitHub
5, idna
6, pytestCheckHook
7, pythonOlder
8}:
9
10buildPythonPackage rec {
11 pname = "email-validator";
12 version = "1.3.1";
13 format = "setuptools";
14
15 disabled = pythonOlder "3.7";
16
17 src = fetchFromGitHub {
18 owner = "JoshData";
19 repo = "python-${pname}";
20 rev = "refs/tags/v${version}";
21 hash = "sha256-JW6Yrotm3HjUOUtNFxRorkrJKjzuwIXwjpUuMWEyLV0=";
22 };
23
24 propagatedBuildInputs = [
25 dnspython
26 idna
27 ];
28
29 nativeCheckInputs = [
30 pytestCheckHook
31 ];
32
33 disabledTests = [
34 # fails with dns.resolver.NoResolverConfiguration due to network sandboxing
35 "test_deliverability_no_records"
36 "test_deliverability_found"
37 "test_deliverability_fails"
38 "test_deliverability_dns_timeout"
39 "test_email_example_reserved_domain"
40 "test_main_single_good_input"
41 "test_main_multi_input"
42 "test_main_input_shim"
43 "test_validate_email__with_caching_resolver"
44 "test_validate_email__with_configured_resolver"
45 ];
46
47 pythonImportsCheck = [
48 "email_validator"
49 ];
50
51 meta = with lib; {
52 description = "Email syntax and deliverability validation library";
53 homepage = "https://github.com/JoshData/python-email-validator";
54 changelog = "https://github.com/JoshData/python-email-validator/releases/tag/v${version}";
55 license = licenses.cc0;
56 maintainers = with maintainers; [ siddharthist ];
57 };
58}