6 # optional-dependencies
14 nbqa = python3.pkgs.buildPythonApplication rec {
19 src = fetchFromGitHub {
22 rev = "refs/tags/${version}";
23 hash = "sha256-9s+q2unh+jezU0Er7ZH0tvgntmPFts9OmsgAMeQXRrY=";
26 build-system = with python3.pkgs; [
30 optional-dependencies.toolchain =
45 dependencies = with python3.pkgs; [
53 # Force using the Ruff executable rather than the Python package
54 substituteInPlace nbqa/__main__.py --replace 'if shell:' 'if shell or main_command == "ruff":'
58 # Allow the tests to run `nbqa` itself from the path
59 export PATH="$out/bin":"$PATH"
72 ++ lib.flatten (lib.attrValues optional-dependencies)
73 ++ [ versionCheckHook ];
77 "test_black_multiple_files"
78 "test_black_return_code"
80 "test_jupytext_on_folder"
82 "test_running_in_different_dir_works"
83 "test_unable_to_reconstruct_message_pythonpath"
84 "test_with_subcommand"
90 "tests/test_include_exclude.py"
94 # selector is a function mapping pythonPackages to a list of code quality
95 # tools, e.g. nbqa.withTools (ps: [ ps.black ])
98 nbqa.overridePythonAttrs (
99 { dependencies, ... }:
101 dependencies = dependencies ++ selector python3.pkgs;
108 homepage = "https://github.com/nbQA-dev/nbQA";
109 changelog = "https://nbqa.readthedocs.io/en/latest/history.html";
110 description = "Run ruff, isort, pyupgrade, mypy, pylint, flake8, black, blacken-docs, and more on Jupyter Notebooks";
111 license = lib.licenses.mit;
112 maintainers = with lib.maintainers; [ l0b0 ];
113 mainProgram = "nbqa";