Made with
```shell
git restore .
fd '\.nix$' pkgs/ --type f -j1 -x bash -xc "$(cat <<"EOF"
typos --no-check-filenames --write-changes "$1"
git diff --exit-code "$1" && exit
#( git diff "$1" | grep -qE "^\+ +[^# ]") && git restore "$1"
count1="$( bat --language nix --diff --style changes "$1" --theme "Monokai Extended" --color always | aha --no-header | grep -E '^<span style="color:olive;">~</span> ' | wc -l )"
count2="$( bat --language nix --diff --style changes "$1" --theme "Monokai Extended" --color always | aha --no-header | grep -E '^<span style="color:olive;">~</span> (<span style="color:#f8f8f2;"> *</span>)?<span style="color:#75715e;">.*</span>$' | wc -l )"
[[ $count1 -ne $count2 ]] && git restore "$1"
EOF
)" -- {}
```
and filtered with `GIT_DIFF_OPTS='--unified=15' git -c interactive.singleKey=true add --patch`
I initially tried using the tree-sitter cli, python bindings and even ast-grep through various means, but this is what I ended up with.
41 lines
1.1 KiB
Nix
41 lines
1.1 KiB
Nix
{
|
|
lib,
|
|
buildPythonPackage,
|
|
fetchPypi,
|
|
numpy,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "oldest-supported-numpy";
|
|
version = "2023.12.21";
|
|
format = "setuptools";
|
|
|
|
src = fetchPypi {
|
|
inherit pname version;
|
|
hash = "sha256-cdicMbtWeBTkfi4mjrLpK2+Z9c529MPbMIM2JOnvKeA=";
|
|
};
|
|
|
|
# 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 versions 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>='
|
|
'';
|
|
|
|
propagatedBuildInputs = [ numpy ];
|
|
|
|
# package has no tests
|
|
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 ];
|
|
};
|
|
}
|