nixpkgs/pkgs/development/python-modules/mail-parser/default.nix
polygon 652e738eef mail-parser: Remove invalid requirements.txt patch
Upstream modified requirements.txt and is no longer pinning
dependencies to exact versions. Instead, it provides version
bounds. Also, the ipaddress dependency is now limited already
in requirements.txt to Python versions < 3.3.

Removed all the patching since it generated an invalid
requirements.txt that caused the build to fail.
2021-05-13 20:26:21 +02:00

36 lines
1.1 KiB
Nix

{ lib, buildPythonPackage, python, pythonOlder, glibcLocales, fetchFromGitHub, ipaddress, six, simplejson }:
buildPythonPackage rec {
pname = "mail-parser";
version = "3.15.0";
# no tests in PyPI tarball
src = fetchFromGitHub {
owner = "SpamScope";
repo = pname;
rev = "v${version}";
sha256 = "0da2qr4p8jnjw6jdhbagm6slfcjnjyyjkszwfcfqvcywh1zm1sdw";
};
LC_ALL = "en_US.utf-8";
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 ];
};
}