summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pyfma/default.nix
blob: f27b9e8d504a9f114ec8318afe3d452fca75f87f (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
42
43
44
45
46
47
48
49
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  fetchpatch,
  numpy,
  pybind11,
  pytestCheckHook,
  setuptools,
}:

buildPythonPackage rec {
  pname = "pyfma";
  version = "0.1.6";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "nschloe";
    repo = "pyfma";
    rev = version;
    hash = "sha256-1qNa+FcIAP1IMzdNKrEbTVPo6gTOSCvhTRIHm6REJoo=";
  };

  patches = [
    # Replace deprecated np.find_common_type calls with np.promote_types, https://github.com/nschloe/pyfma/pull/17
    (fetchpatch {
      url = "https://github.com/nschloe/pyfma/commit/e12d69d97a97657ab4fec3e8f2b2859f4360bc03.patch";
      hash = "sha256-BsQe4hpo+Cripa0FRGFnRBs1oQ1GZA1+ZYzycy5M4Ek=";
    })
  ];

  build-system = [ setuptools ];

  buildInputs = [ pybind11 ];

  dependencies = [ numpy ];

  nativeCheckInputs = [ pytestCheckHook ];

  pythonImportsCheck = [ "pyfma" ];

  meta = {
    description = "Fused multiply-add for Python";
    homepage = "https://github.com/nschloe/pyfma";
    changelog = "https://github.com/nschloe/pyfma/releases/tag/${version}";
    license = lib.licenses.mit;
    maintainers = [ ];
  };
}