about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMartin Weinelt <mweinelt@users.noreply.github.com>2021-04-24 13:38:42 +0200
committerGitHub <noreply@github.com>2021-04-24 13:38:42 +0200
commitabd57b544e59b54a24f930899329508aa3ec3b17 (patch)
treebfb883a235583a28ded2db0f015b27fcbf273f6a
parent68e02d17576d420b10eb5a92c53b02054bc6712e (diff)
parent2cbebb37425d06396c70a08f5df2e65b03801d1e (diff)
Merge pull request #120276 from mweinelt/python/some-libs
-rw-r--r--pkgs/development/python-modules/pycocotools/default.nix37
-rw-r--r--pkgs/development/python-modules/seqeval/default.nix49
-rw-r--r--pkgs/top-level/python-packages.nix4
3 files changed, 90 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/pycocotools/default.nix b/pkgs/development/python-modules/pycocotools/default.nix
new file mode 100644
index 0000000000000..a6cdf877a07ba
--- /dev/null
+++ b/pkgs/development/python-modules/pycocotools/default.nix
@@ -0,0 +1,37 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, cython
+, matplotlib
+}:
+
+buildPythonPackage rec {
+  pname = "pycocotools";
+  version = "2.0.2";
+  format = "setuptools";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "06hz0iz4kqxhqby4j7bah8l41kg68bb118jawp172i4vg497lw94";
+  };
+
+  propagatedBuildInputs = [
+    cython
+    matplotlib
+  ];
+
+  pythonImportsCheck = [
+    "pycocotools.coco"
+    "pycocotools.cocoeval"
+  ];
+
+  # has no tests
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Official APIs for the MS-COCO dataset";
+    homepage = "https://github.com/cocodataset/cocoapi/tree/master/PythonAPI";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ hexa piegames ];
+  };
+}
diff --git a/pkgs/development/python-modules/seqeval/default.nix b/pkgs/development/python-modules/seqeval/default.nix
new file mode 100644
index 0000000000000..15322632ad7d7
--- /dev/null
+++ b/pkgs/development/python-modules/seqeval/default.nix
@@ -0,0 +1,49 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, numpy
+, scikitlearn
+, perl
+, pytestCheckHook
+}:
+
+buildPythonPackage rec {
+  pname = "seqeval";
+  version = "1.2.2";
+  format = "setuptools";
+
+  src = fetchFromGitHub {
+    owner = "chakki-works";
+    repo = "seqeval";
+    rev = "v${version}";
+    sha256 = "0qv05gn54kc4wpmwnflmfqw4gwwb8lxqhkiihl0pvl7s2i7qzx2j";
+  };
+
+  postPatch = ''
+    substituteInPlace setup.py \
+      --replace "use_scm_version=True," "version='${version}'," \
+      --replace "setup_requires=['setuptools_scm']," "setup_requires=[],"
+  '';
+
+  propagatedBuildInputs = [
+    numpy
+    scikitlearn
+  ];
+
+  checkInputs = [
+    pytestCheckHook
+  ];
+
+  disabledTests = [
+    # tests call perl script and get stuck in there
+    "test_statistical_tests"
+    "test_by_ground_truth"
+  ];
+
+  meta = with lib; {
+    description = "A Python framework for sequence labeling evaluation";
+    homepage = "https://github.com/chakki-works/seqeval";
+    license = licenses.mit;
+    maintainers = with maintainers; [ hexa ];
+  };
+}
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index ce472c130a0b4..0671f45f80df5 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -5742,6 +5742,8 @@ in {
 
   pycmarkgfm = callPackage ../development/python-modules/pycmarkgfm { };
 
+  pycocotools = callPackage ../development/python-modules/pycocotools { };
+
   pycodestyle = callPackage ../development/python-modules/pycodestyle { };
 
   pycognito = callPackage ../development/python-modules/pycognito { };
@@ -7829,6 +7831,8 @@ in {
 
   seqdiag = callPackage ../development/python-modules/seqdiag { };
 
+  seqeval = callPackage ../development/python-modules/seqeval { };
+
   sequoia = disabledIf (isPyPy || !isPy3k) (toPythonModule (pkgs.sequoia.override {
     pythonPackages = self;
     pythonSupport = true;