summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/mnist/default.nix
blob: 23cb82eaf3073ef6ca3038cc2432e0b37ab4034d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{
  buildPythonPackage,
  fetchFromGitHub,
  isPy27,
  lib,
  mock,
  numpy,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "mnist";
  version = "0.2.2";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "datapythonista";
    repo = "mnist";
    rev = "${pname}-${version}";
    sha256 = "17r37pbxiv5dw857bmg990x836gq6sgww069w3q5jjg9m3xdm7dh";
  };

  propagatedBuildInputs = [ numpy ] ++ lib.optional isPy27 mock;

  nativeCheckInputs = [ pytestCheckHook ];

  # disable tests which fail due to socket related errors
  disabledTests = [
    "test_test_images_has_right_size"
    "test_test_labels_has_right_size"
    "test_train_images_has_right_size"
    "test_train_labels_has_right_size"
  ];

  meta = {
    description = "Python utilities to download and parse the MNIST dataset";
    homepage = "https://github.com/datapythonista/mnist";
    license = lib.licenses.bsd3;
    maintainers = [ ];
  };
}