mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 14:54:29 +01:00
Merge pull request #40353 from Assassinkin/mail-parser
pythonPackages.mail-parser: init at 3.3.1
This commit is contained in:
commit
2c91ab54c9
3 changed files with 48 additions and 0 deletions
|
@ -3051,6 +3051,11 @@
|
|||
email = "philipp@xndr.de";
|
||||
name = "Philipp Steinpaß";
|
||||
};
|
||||
psyanticy = {
|
||||
email = "iuns@outlook.fr";
|
||||
github = "Assassinkin";
|
||||
name = "Psyanticy";
|
||||
};
|
||||
puffnfresh = {
|
||||
email = "brian@brianmckenna.org";
|
||||
github = "puffnfresh";
|
||||
|
|
41
pkgs/development/python-modules/mail-parser/default.nix
Normal file
41
pkgs/development/python-modules/mail-parser/default.nix
Normal file
|
@ -0,0 +1,41 @@
|
|||
{ lib, buildPythonPackage, python, pythonOlder, glibcLocales, fetchFromGitHub, ipaddress, six, simplejson }:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "mail-parser";
|
||||
version = "3.3.1";
|
||||
|
||||
# no tests in PyPI tarball
|
||||
src = fetchFromGitHub {
|
||||
owner = "SpamScope";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "1b1v61zwgdx2xjzds3hp6bv53yq424hhlrhf445n4faj1l0c4lkg";
|
||||
};
|
||||
|
||||
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 ];
|
||||
};
|
||||
}
|
|
@ -277,6 +277,8 @@ in {
|
|||
|
||||
logster = callPackage ../development/python-modules/logster { };
|
||||
|
||||
mail-parser = callPackage ../development/python-modules/mail-parser { };
|
||||
|
||||
mpi4py = callPackage ../development/python-modules/mpi4py {
|
||||
mpi = pkgs.openmpi;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue