6 # optional-dependencies
16 nbqa = python3Packages.buildPythonApplication rec {
21 src = fetchFromGitHub {
24 rev = "refs/tags/${version}";
25 hash = "sha256-qVNJ8f8vUlTCi5DbvG70orcSnulH60UcI5iABtXYUog=";
28 build-system = with python3Packages; [
32 optional-dependencies.toolchain =
33 (with python3Packages; [
47 dependencies = with python3Packages; [
55 # Force using the Ruff executable rather than the Python package
56 substituteInPlace nbqa/__main__.py --replace 'if shell:' 'if shell or main_command == "ruff":'
60 # Allow the tests to run `nbqa` itself from the path
61 export PATH="$out/bin":"$PATH"
65 (with python3Packages; [
74 ++ lib.flatten (lib.attrValues optional-dependencies)
75 ++ [ versionCheckHook ];
76 versionCheckProgramArg = [ "--version" ];
80 "test_black_multiple_files"
81 "test_black_return_code"
83 "test_jupytext_on_folder"
85 "test_running_in_different_dir_works"
86 "test_unable_to_reconstruct_message_pythonpath"
87 "test_with_subcommand"
93 "tests/test_include_exclude.py"
97 # selector is a function mapping pythonPackages to a list of code quality
98 # tools, e.g. nbqa.withTools (ps: [ ps.black ])
101 nbqa.overridePythonAttrs (
102 { dependencies, ... }:
104 dependencies = dependencies ++ selector python3Packages;
109 updateScript = nix-update-script { };
113 homepage = "https://github.com/nbQA-dev/nbQA";
114 changelog = "https://nbqa.readthedocs.io/en/latest/history.html";
115 description = "Run ruff, isort, pyupgrade, mypy, pylint, flake8, black, blacken-docs, and more on Jupyter Notebooks";
116 license = lib.licenses.mit;
117 maintainers = with lib.maintainers; [ l0b0 ];
118 mainProgram = "nbqa";