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.
47 lines
1.0 KiB
Nix
47 lines
1.0 KiB
Nix
{
|
|
lib,
|
|
fetchPypi,
|
|
fetchpatch,
|
|
buildPythonPackage,
|
|
dos2unix,
|
|
pyasn1,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "ldap3";
|
|
version = "2.9.1";
|
|
format = "setuptools";
|
|
|
|
src = fetchPypi {
|
|
inherit pname version;
|
|
sha256 = "f3e7fc4718e3f09dda568b57100095e0ce58633bcabbed8667ce3f8fbaa4229f";
|
|
};
|
|
|
|
prePatch = ''
|
|
# patch fails to apply because of line endings
|
|
dos2unix ldap3/utils/asn1.py
|
|
'';
|
|
|
|
patches = [
|
|
# fix pyasn1 0.5.0 compatibility
|
|
# https://github.com/cannatag/ldap3/pull/983
|
|
(fetchpatch {
|
|
url = "https://github.com/cannatag/ldap3/commit/ca689f4893b944806f90e9d3be2a746ee3c502e4.patch";
|
|
hash = "sha256-A8qI0t1OV3bkKaSdhVWHFBC9MoSkWynqxpgznV+5gh8=";
|
|
})
|
|
];
|
|
|
|
nativeBuildInputs = [ dos2unix ];
|
|
|
|
propagatedBuildInputs = [ pyasn1 ];
|
|
|
|
doCheck = false; # requires network
|
|
|
|
meta = with lib; {
|
|
homepage = "https://pypi.python.org/pypi/ldap3";
|
|
description = "Strictly RFC 4510 conforming LDAP V3 pure Python client library";
|
|
license = licenses.lgpl3;
|
|
maintainers = [ ];
|
|
};
|
|
}
|