diff --git a/pkgs/development/python-modules/diff-cover/default.nix b/pkgs/development/python-modules/diff-cover/default.nix new file mode 100644 index 000000000000..7a9e1205979a --- /dev/null +++ b/pkgs/development/python-modules/diff-cover/default.nix @@ -0,0 +1,57 @@ +{ lib +, buildPythonPackage +, chardet +, fetchPypi +, inflect +, jinja2 +, jinja2_pluralize +, pycodestyle +, pyflakes +, pygments +, pylint +, pytest-mock +, pytestCheckHook +, pythonOlder +}: + +buildPythonPackage rec { + pname = "diff-cover"; + version = "5.4.0"; + disabled = pythonOlder "3.6"; + + src = fetchPypi { + pname = "diff_cover"; + inherit version; + sha256 = "sha256-4iQ9/QcXh/lW8HE6wFZWc6Y57xhAEWu2TQnIUZJNAMs="; + }; + + propagatedBuildInputs = [ + chardet + inflect + jinja2 + jinja2_pluralize + pygments + ]; + + checkInputs = [ + pycodestyle + pyflakes + pylint + pytest-mock + pytestCheckHook + ]; + + disabledTests = [ + "added_file_pylint_console" + "file_does_not_exist" + ]; + + pythonImportsCheck = [ "diff_cover" ]; + + meta = with lib; { + description = "Automatically find diff lines that need test coverage"; + homepage = "https://github.com/Bachmann1234/diff-cover"; + license = licenses.asl20; + maintainers = with maintainers; [ dzabraev ]; + }; +} diff --git a/pkgs/development/python-modules/diff_cover/default.nix b/pkgs/development/python-modules/diff_cover/default.nix deleted file mode 100644 index 7eeb378ff417..000000000000 --- a/pkgs/development/python-modules/diff_cover/default.nix +++ /dev/null @@ -1,46 +0,0 @@ -{ lib, buildPythonPackage, fetchPypi -, chardet -, inflect -, jinja2 -, jinja2_pluralize -, pygments -, six -# test dependencies -, coverage -, mock -, nose -, pycodestyle -, pyflakes -, pylint -, pytest -}: - -buildPythonPackage rec { - pname = "diff_cover"; - version = "5.2.0"; - - preCheck = '' - export LC_ALL=en_US.UTF-8; - ''; - - src = fetchPypi { - inherit pname version; - sha256 = "a1cd54232d2e48bd4c1eabc96cfe4a8727a9a92fd2556b52ff8f65bb8adf8768"; - }; - - propagatedBuildInputs = [ chardet jinja2 jinja2_pluralize pygments six inflect ]; - - checkInputs = [ mock coverage pytest nose pylint pyflakes pycodestyle ]; - - # ignore tests which try to write files - checkPhase = '' - pytest -k 'not added_file_pylint_console and not file_does_not_exist' - ''; - - meta = with lib; { - description = "Automatically find diff lines that need test coverage"; - homepage = "https://github.com/Bachmann1234/diff-cover"; - license = licenses.asl20; - maintainers = with maintainers; [ dzabraev ]; - }; -} diff --git a/pkgs/top-level/python-aliases.nix b/pkgs/top-level/python-aliases.nix index 7ea357116233..09a77cfe6bd7 100644 --- a/pkgs/top-level/python-aliases.nix +++ b/pkgs/top-level/python-aliases.nix @@ -36,6 +36,7 @@ mapAliases ({ blockdiagcontrib-cisco = throw "blockdiagcontrib-cisco is not compatible with blockdiag 2.0.0 and has been removed."; # Added 2020-11-29 bugseverywhere = throw "bugseverywhere has been removed: Abandoned by upstream."; # Added 2019-11-27 detox = throw "detox is no longer maintained, and was broken since may 2019"; # added 2020-07-04 + diff_cover = diff-cover; # added 2021-07-02 dns = dnspython; # Alias for compatibility, 2017-12-10 faulthandler = throw "faulthandler is built into ${python.executable}"; gitdb2 = throw "gitdb2 has been deprecated, use gitdb instead."; # added 2020-03-14 diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f4ed5fedd16b..89cfeeeaad1d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1919,7 +1919,7 @@ in { dicttoxml = callPackage ../development/python-modules/dicttoxml { }; - diff_cover = callPackage ../development/python-modules/diff_cover { }; + diff-cover = callPackage ../development/python-modules/diff-cover { }; diff-match-patch = callPackage ../development/python-modules/diff-match-patch { };