summary refs log tree commit diff
path: root/pkgs/development/python-modules/py-cpuinfo/default.nix
blob: ae2f5ae9d6db77df5d41ae4a6e4cb460f3217ded (plain) (blame)
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
{ lib
, fetchFromGitHub
, buildPythonPackage
, pytest
}:

buildPythonPackage rec {
  pname = "py-cpuinfo";
  version = "5.0.0";

  src = fetchFromGitHub {
     owner = "workhorsy";
     repo = pname;
     rev = "v${version}";
     sha256 = "0lxl9n6djaz5h1zrb2jca4qwl41c2plxy8chr7yhcxnzg0srddqi";
  };

  checkInputs = [
    pytest
  ];

  checkPhase = ''
    runHook preCheck
    pytest -k "not TestActual"
    runHook postCheck
  '';

  meta = {
    description = "Get CPU info with pure Python 2 & 3";
    longDescription = ''
      Py-cpuinfo gets CPU info with pure Python and should work without any
      extra programs or libraries, beyond what your OS provides. It does not
      require any compilation (C/C++, assembly, etc.) to use and works with
      Python 2 and 3.
    '';
    inherit (src.meta) homepage;
    changelog = "https://github.com/workhorsy/py-cpuinfo/blob/v${version}/ChangeLog";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ costrouc ];
  };
}