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.
73 lines
1.7 KiB
Nix
73 lines
1.7 KiB
Nix
{
|
|
lib,
|
|
buildPythonPackage,
|
|
fetchFromGitHub,
|
|
fetchpatch,
|
|
freezegun,
|
|
isodate,
|
|
lxml,
|
|
pytestCheckHook,
|
|
pythonOlder,
|
|
poetry-core,
|
|
xmlsec,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "python3-saml";
|
|
version = "1.16.0";
|
|
pyproject = true;
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "onelogin";
|
|
repo = "python3-saml";
|
|
tag = "v${version}";
|
|
hash = "sha256-KyDGmqhg/c29FaXPKK8rWKSBP6BOCpKKpOujCavXUcc=";
|
|
};
|
|
|
|
patches = [
|
|
# Fix build system, https://github.com/SAML-Toolkits/python3-saml/pull/341
|
|
(fetchpatch {
|
|
name = "switch-to-poetry-core.patch";
|
|
url = "https://github.com/SAML-Toolkits/python3-saml/commit/231a7e19543138fdd7424c01435dfe3f82bbe9ce.patch";
|
|
hash = "sha256-MvX1LXhf3LJUy3O7L0/ySyVY4KDGc/GKJud4pOkwVIk=";
|
|
})
|
|
];
|
|
|
|
nativeBuildInputs = [ poetry-core ];
|
|
|
|
propagatedBuildInputs = [
|
|
isodate
|
|
lxml
|
|
xmlsec
|
|
];
|
|
|
|
nativeCheckInputs = [
|
|
freezegun
|
|
pytestCheckHook
|
|
];
|
|
|
|
pythonImportsCheck = [ "onelogin.saml2" ];
|
|
|
|
disabledTests = [
|
|
# Tests require network access or additions files
|
|
"OneLogin_Saml2_Metadata_Test"
|
|
"OneLogin_Saml2_Response_Test"
|
|
"OneLogin_Saml2_Utils_Test"
|
|
"OneLogin_Saml2_Settings_Test"
|
|
"OneLogin_Saml2_Auth_Test"
|
|
"OneLogin_Saml2_Authn_Request_Test"
|
|
"OneLogin_Saml2_IdPMetadataParser_Test"
|
|
"OneLogin_Saml2_Logout_Request_Test"
|
|
];
|
|
|
|
meta = with lib; {
|
|
description = "OneLogin's SAML Python Toolkit";
|
|
homepage = "https://github.com/onelogin/python3-saml";
|
|
changelog = "https://github.com/SAML-Toolkits/python3-saml/blob/v${version}/changelog.md";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ zhaofengli ];
|
|
};
|
|
}
|