5aba99242e
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.
75 lines
1.5 KiB
Nix
75 lines
1.5 KiB
Nix
{
|
|
lib,
|
|
buildPythonPackage,
|
|
fetchPypi,
|
|
fetchpatch,
|
|
deprecation,
|
|
hatchling,
|
|
pythonOlder,
|
|
packaging,
|
|
pytestCheckHook,
|
|
pytest-timeout,
|
|
setuptools,
|
|
tomlkit,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "jupyter-packaging";
|
|
version = "0.12.3";
|
|
disabled = pythonOlder "3.7";
|
|
format = "pyproject";
|
|
|
|
src = fetchPypi {
|
|
pname = "jupyter_packaging";
|
|
inherit version;
|
|
hash = "sha256-nZsrY7l//WeovFORwypCG8QVsmSjLJnk2NjdMdqunPQ=";
|
|
};
|
|
|
|
patches = [
|
|
(fetchpatch {
|
|
name = "setuptools-68-test-compatibility.patch";
|
|
url = "https://github.com/jupyter/jupyter-packaging/commit/e963fb27aa3b58cd70c5ca61ebe68c222d803b7e.patch";
|
|
hash = "sha256-NlO07wBCutAJ1DgoT+rQFkuC9Y+DyF1YFlTwWpwsJzo=";
|
|
})
|
|
];
|
|
|
|
nativeBuildInputs = [ hatchling ];
|
|
|
|
propagatedBuildInputs = [
|
|
deprecation
|
|
packaging
|
|
setuptools
|
|
tomlkit
|
|
];
|
|
|
|
nativeCheckInputs = [
|
|
pytestCheckHook
|
|
pytest-timeout
|
|
];
|
|
|
|
pytestFlagsArray = [ "-Wignore::DeprecationWarning" ];
|
|
|
|
preCheck = ''
|
|
export HOME=$(mktemp -d)
|
|
'';
|
|
|
|
disabledTests = [
|
|
# disable tests depending on network connection
|
|
"test_develop"
|
|
"test_install"
|
|
# Avoid unmaintained "mocker" fixture library, and calls to dependent "build" module
|
|
"test_build"
|
|
"test_npm_build"
|
|
"test_create_cmdclass"
|
|
"test_ensure_with_skip_npm"
|
|
];
|
|
|
|
pythonImportsCheck = [ "jupyter_packaging" ];
|
|
|
|
meta = with lib; {
|
|
description = "Jupyter Packaging Utilities";
|
|
homepage = "https://github.com/jupyter/jupyter-packaging";
|
|
license = licenses.bsd3;
|
|
};
|
|
}
|