From 3dfe8ff2b989e91352e008ea9bc6853a86dfe31c Mon Sep 17 00:00:00 2001 From: Theodore Ni <3806110+tjni@users.noreply.github.com> Date: Mon, 7 Aug 2023 00:19:06 -0700 Subject: [PATCH] python3.pkgs.oldest-supported-numpy: init at 2023.8.3 (#247073) The main purpose of this package is to be used as a dependency in projects that depend upon it without having to patch their build dependency requirements. --- .../oldest-supported-numpy/default.nix | 40 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 42 insertions(+) create mode 100644 pkgs/development/python-modules/oldest-supported-numpy/default.nix diff --git a/pkgs/development/python-modules/oldest-supported-numpy/default.nix b/pkgs/development/python-modules/oldest-supported-numpy/default.nix new file mode 100644 index 0000000000000..a7b99614aef8b --- /dev/null +++ b/pkgs/development/python-modules/oldest-supported-numpy/default.nix @@ -0,0 +1,40 @@ +{ lib +, buildPythonPackage +, fetchPypi +, numpy +}: + +buildPythonPackage rec { + pname = "oldest-supported-numpy"; + version = "2023.8.3"; + format = "setuptools"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-yJp+wzsihagnI3crGPDBo+CqbVO4Xhxulj/o/NitxU0="; + }; + + # The purpose of oldest-supported-numpy is to build a project against the + # oldest version of numpy for a given Python distribution in order to build + # a binary that is compatible with the largest possible versons of numpy. + # We only build against one version of numpy in nixpkgs, so instead we only + # want to make sure that we have a version above the minimum. + # + postPatch = '' + substituteInPlace setup.cfg \ + --replace 'numpy==' 'numpy>=' + ''; + + nativeBuildInputs = [ + numpy + ]; + + doCheck = false; + + meta = with lib; { + description = "Meta-package providing the oldest supported Numpy for a given Python version and platform"; + homepage = "https://github.com/scipy/oldest-supported-numpy"; + license = licenses.bsd2; + maintainers = with maintainers; [ tjni ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index eba8a51d256b9..145bccd7ad7e9 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7288,6 +7288,8 @@ self: super: with self; { okta = callPackage ../development/python-modules/okta { }; + oldest-supported-numpy = callPackage ../development/python-modules/oldest-supported-numpy { }; + olefile = callPackage ../development/python-modules/olefile { }; oletools = callPackage ../development/python-modules/oletools { };