1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/development/python-modules/mail-parser/default.nix
R. RyanTM 822c2daac7 python37Packages.mail-parser: 3.9.2 -> 3.9.3
Semi-automatic update generated by
https://github.com/ryantm/nixpkgs-update tools. This update was made
based on information from
https://repology.org/metapackage/python3.7-mail-parser/versions

(cherry picked from commit 1c6f89efca)
2019-04-07 13:53:44 +02:00

42 lines
1.3 KiB
Nix

{ lib, buildPythonPackage, python, pythonOlder, glibcLocales, fetchFromGitHub, ipaddress, six, simplejson }:
buildPythonPackage rec {
pname = "mail-parser";
version = "3.9.3";
# no tests in PyPI tarball
src = fetchFromGitHub {
owner = "SpamScope";
repo = pname;
rev = "v${version}";
sha256 = "0v6hgsz6yvp6csgx4y440ksqj24rdsd06vyfqcihiy3dfvp9229y";
};
LC_ALL = "en_US.utf-8";
# ipaddress is part of the standard library of Python 3.3+
prePatch = lib.optionalString (!pythonOlder "3.3") ''
substituteInPlace requirements.txt \
--replace "ipaddress" ""
'';
nativeBuildInputs = [ glibcLocales ];
propagatedBuildInputs = [ simplejson six ] ++ lib.optional (pythonOlder "3.3") ipaddress;
# Taken from .travis.yml
checkPhase = ''
${python.interpreter} tests/test_main.py
${python.interpreter} -m mailparser -v
${python.interpreter} -m mailparser -h
${python.interpreter} -m mailparser -f tests/mails/mail_malformed_3 -j
cat tests/mails/mail_malformed_3 | ${python.interpreter} -m mailparser -k -j
'';
meta = with lib; {
description = "A mail parser for python 2 and 3";
homepage = https://github.com/SpamScope/mail-parser;
license = licenses.asl20;
maintainers = with maintainers; [ psyanticy ];
};
}