nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix

python3Packages.email-validator: fix build, enable tests

+34 -7
+34 -7
pkgs/development/python-modules/email-validator/default.nix
··· 1 - { lib, buildPythonPackage, fetchPypi, isPy3k, dnspython, idna, ipaddress }: 1 + { lib 2 + , buildPythonPackage 3 + , fetchFromGitHub 4 + , dnspython 5 + , idna 6 + , pytestCheckHook 7 + }: 2 8 3 9 buildPythonPackage rec { 4 10 pname = "email-validator"; 5 11 version = "1.1.3"; 6 12 7 - src = fetchPypi { 8 - inherit pname version; 9 - sha256 = "aa237a65f6f4da067119b7df3f13e89c25c051327b2b5b66dc075f33d62480d7"; 13 + src = fetchFromGitHub { 14 + owner = "JoshData"; 15 + repo = "python-${pname}"; 16 + rev = "v${version}"; 17 + sha256 = "19n6p75m96kwg38bpfsa7ksj26aki02p5pr5f36q8wv3af84s61c"; 10 18 }; 11 - 12 - doCheck = false; 13 19 14 20 propagatedBuildInputs = [ 15 21 dnspython 16 22 idna 17 - ] ++ (if isPy3k then [ ] else [ ipaddress ]); 23 + ]; 24 + 25 + checkInputs = [ 26 + pytestCheckHook 27 + ]; 28 + 29 + disabledTests = [ 30 + # fails with dns.resolver.NoResolverConfiguration due to network sandboxing 31 + "test_deliverability_no_records" 32 + "test_deliverability_found" 33 + "test_deliverability_fails" 34 + "test_deliverability_dns_timeout" 35 + "test_main_single_good_input" 36 + "test_main_multi_input" 37 + "test_main_input_shim" 38 + "test_validate_email__with_caching_resolver" 39 + "test_validate_email__with_configured_resolver" 40 + ]; 41 + 42 + pythonImportsCheck = [ 43 + "email_validator" 44 + ]; 18 45 19 46 meta = with lib; { 20 47 description = "A robust email syntax and deliverability validation library for Python 2.x/3.x.";