git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #120276 from mweinelt/python/some-libs
commitabd57b544e59b54a24f930899329508aa3ec3b17 authorMartin Weinelt <mweinelt@users.noreply.github.com> dateSat 24 Apr 2021, 13:38 (6 years ago) parent68e02d12cbebb3
3 files changed+90
pkgs/development/python-modules/pycocotools/default.nix+37 pkgs/development/python-modules/seqeval/default.nix+49 pkgs/top-level/python-packages.nix+4
pkgs/development/python-modules/pycocotools/default.nixnew file+37
@@ -0,0 +1,37 @@
1+{ lib
2+, buildPythonPackage
3+, fetchPypi
4+, cython
5+, matplotlib
6+}:
7+
8+buildPythonPackage rec {
9+ pname = "pycocotools";
10+ version = "2.0.2";
11+ format = "setuptools";
12+
13+ src = fetchPypi {
14+ inherit pname version;
15+ sha256 = "06hz0iz4kqxhqby4j7bah8l41kg68bb118jawp172i4vg497lw94";
16+ };
17+
18+ propagatedBuildInputs = [
19+ cython
20+ matplotlib
21+ ];
22+
23+ pythonImportsCheck = [
24+ "pycocotools.coco"
25+ "pycocotools.cocoeval"
26+ ];
27+
28+ # has no tests
29+ doCheck = false;
30+
31+ meta = with lib; {
32+ description = "Official APIs for the MS-COCO dataset";
33+ homepage = "https://github.com/cocodataset/cocoapi/tree/master/PythonAPI";
34+ license = licenses.bsd2;
35+ maintainers = with maintainers; [ hexa piegames ];
36+ };
37+}
pkgs/development/python-modules/seqeval/default.nixnew file+49
@@ -0,0 +1,49 @@
1+{ lib
2+, buildPythonPackage
3+, fetchFromGitHub
4+, numpy
5+, scikitlearn
6+, perl
7+, pytestCheckHook
8+}:
9+
10+buildPythonPackage rec {
11+ pname = "seqeval";
12+ version = "1.2.2";
13+ format = "setuptools";
14+
15+ src = fetchFromGitHub {
16+ owner = "chakki-works";
17+ repo = "seqeval";
18+ rev = "v${version}";
19+ sha256 = "0qv05gn54kc4wpmwnflmfqw4gwwb8lxqhkiihl0pvl7s2i7qzx2j";
20+ };
21+
22+ postPatch = ''
23+ substituteInPlace setup.py \
24+ --replace "use_scm_version=True," "version='${version}'," \
25+ --replace "setup_requires=['setuptools_scm']," "setup_requires=[],"
26+ '';
27+
28+ propagatedBuildInputs = [
29+ numpy
30+ scikitlearn
31+ ];
32+
33+ checkInputs = [
34+ pytestCheckHook
35+ ];
36+
37+ disabledTests = [
38+ # tests call perl script and get stuck in there
39+ "test_statistical_tests"
40+ "test_by_ground_truth"
41+ ];
42+
43+ meta = with lib; {
44+ description = "A Python framework for sequence labeling evaluation";
45+ homepage = "https://github.com/chakki-works/seqeval";
46+ license = licenses.mit;
47+ maintainers = with maintainers; [ hexa ];
48+ };
49+}
pkgs/top-level/python-packages.nix+4
@@ -5742,6 +5742,8 @@ in {
57425742
57435743 pycmarkgfm = callPackage ../development/python-modules/pycmarkgfm { };
57445744
5745+ pycocotools = callPackage ../development/python-modules/pycocotools { };
5746+
57455747 pycodestyle = callPackage ../development/python-modules/pycodestyle { };
57465748
57475749 pycognito = callPackage ../development/python-modules/pycognito { };
@@ -7829,6 +7831,8 @@ in {
78297831
78307832 seqdiag = callPackage ../development/python-modules/seqdiag { };
78317833
7834+ seqeval = callPackage ../development/python-modules/seqeval { };
7835+
78327836 sequoia = disabledIf (isPyPy || !isPy3k) (toPythonModule (pkgs.sequoia.override {
78337837 pythonPackages = self;
78347838 pythonSupport = true;