Unverified Commit c3131620 authored by Fabian Affolter's avatar Fabian Affolter Committed by GitHub
Browse files

python313Packages.pyfma: add patch for numpy > 2 (#373054)

parents b240909c 51335e4a
Loading
Loading
Loading
Loading
+16 −5
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  fetchpatch,
  importlib-metadata,
  numpy,
  pybind11,
@@ -13,21 +14,30 @@
buildPythonPackage rec {
  pname = "pyfma";
  version = "0.1.6";
  format = "pyproject";
  pyproject = true;

  disabled = pythonOlder "3.7";

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

  nativeBuildInputs = [ setuptools ];
  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 ];

  propagatedBuildInputs = [ numpy ] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ];
  dependencies = [ numpy ] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ];

  nativeCheckInputs = [ pytestCheckHook ];

@@ -36,6 +46,7 @@ buildPythonPackage rec {
  meta = with lib; {
    description = "Fused multiply-add for Python";
    homepage = "https://github.com/nschloe/pyfma";
    changelog = "https://github.com/nschloe/pyfma/releases/tag/${version}";
    license = licenses.mit;
    maintainers = [ ];
  };