From efc1197dd6a74e1c7db7cb6bdc13e0bb7737f765 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 11 Apr 2021 17:20:21 +0200 Subject: [PATCH] python3Packages.karton-classifier: init at 1.0.0 --- .../karton-classifier/default.nix | 48 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 50 insertions(+) create mode 100644 pkgs/development/python-modules/karton-classifier/default.nix diff --git a/pkgs/development/python-modules/karton-classifier/default.nix b/pkgs/development/python-modules/karton-classifier/default.nix new file mode 100644 index 00000000000..a623486f03c --- /dev/null +++ b/pkgs/development/python-modules/karton-classifier/default.nix @@ -0,0 +1,48 @@ +{ lib +, buildPythonPackage +, chardet +, fetchFromGitHub +, karton-core +, python +, python_magic +}: + +buildPythonPackage rec { + pname = "karton-classifier"; + version = "1.0.0"; + + src = fetchFromGitHub { + owner = "CERT-Polska"; + repo = pname; + rev = "v${version}"; + sha256 = "05pxv0smrzgmljykc6yx0rx8b85ck7fa09xjkjw0dd7lb6bb19a6"; + }; + + propagatedBuildInputs = [ + chardet + karton-core + python_magic + ]; + + postPatch = '' + substituteInPlace requirements.txt \ + --replace "chardet==3.0.4" "chardet" \ + --replace "karton-core==4.0.4" "karton-core" \ + --replace "python-magic==0.4.18" "python-magic" + ''; + + checkPhase = '' + runHook preCheck + ${python.interpreter} -m unittest discover + runHook postCheck + ''; + + pythonImportsCheck = [ "karton.classifier" ]; + + meta = with lib; { + description = "File type classifier for the Karton framework"; + homepage = "https://github.com/CERT-Polska/karton-classifier"; + license = with licenses; [ bsd3 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 3c440c9f0b2..c07bd711a35 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3667,6 +3667,8 @@ in { kaptan = callPackage ../development/python-modules/kaptan { }; + karton-classifier = callPackage ../development/python-modules/karton-classifier { }; + karton-core = callPackage ../development/python-modules/karton-core { }; kazoo = callPackage ../development/python-modules/kazoo { };