From 53c8f97a537abb85fb35e88cb4801fa62692813f Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 8 Jun 2022 11:00:01 +0200 Subject: [PATCH] autoflake: switch to pytestCheckHook - add pythonImportsCheck - disable failing test --- .../tools/analysis/autoflake/default.nix | 30 ++++++++++++++----- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/pkgs/development/tools/analysis/autoflake/default.nix b/pkgs/development/tools/analysis/autoflake/default.nix index 03e01aadb716..adc861588dd5 100644 --- a/pkgs/development/tools/analysis/autoflake/default.nix +++ b/pkgs/development/tools/analysis/autoflake/default.nix @@ -1,22 +1,36 @@ -{ lib, python3Packages }: +{ lib +, python3 +}: -with python3Packages; -buildPythonApplication rec { +python3.pkgs.buildPythonApplication rec { pname = "autoflake"; version = "1.4"; - src = fetchPypi { + src = python3.pkgs.fetchPypi { inherit pname version; - sha256 = "61a353012cff6ab94ca062823d1fb2f692c4acda51c76ff83a8d77915fba51ea"; + hash = "sha256-YaNTASz/arlMoGKCPR+y9pLErNpRx2/4Oo13kV+6Ueo="; }; - propagatedBuildInputs = [ pyflakes ]; + propagatedBuildInputs = with python3.pkgs; [ + pyflakes + ]; - doCheck = true; + checkInputs = with python3.pkgs; [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "autoflake" + ]; + + disabledTests = [ + # AssertionError: True is not false + "test_is_literal_or_name" + ]; meta = with lib; { + description = "Tool to remove unused imports and unused variables"; homepage = "https://github.com/myint/autoflake"; - description = "A simple program which removes unused imports and unused variables as reported by pyflakes"; license = licenses.mit; maintainers = with maintainers; [ yuriaisaka ]; };