From 68cd7c83482b4f54fe2bebad85b7465e1b22d9f8 Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Costa Date: Sun, 12 Oct 2025 06:27:22 +0000 Subject: [PATCH] pycobertura: init at 4.1.0 --- .../python-modules/pycobertura/default.nix | 73 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + pkgs/top-level/python-packages.nix | 2 + 3 files changed, 77 insertions(+) create mode 100644 pkgs/development/python-modules/pycobertura/default.nix diff --git a/pkgs/development/python-modules/pycobertura/default.nix b/pkgs/development/python-modules/pycobertura/default.nix new file mode 100644 index 000000000000..dd2b6b42a202 --- /dev/null +++ b/pkgs/development/python-modules/pycobertura/default.nix @@ -0,0 +1,73 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + pythonOlder, + setuptools, + setuptools-git, + click, + jinja2, + lxml, + tabulate, + ruamel-yaml, + pytestCheckHook, + mock, +}: + +buildPythonPackage rec { + pname = "pycobertura"; + version = "4.1.0"; + pyproject = true; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "aconrad"; + repo = "pycobertura"; + tag = "v${version}"; + hash = "sha256-OzOxoF3OmgtzWuNNyecyxFRcPq8gAPQZ2XAdrkJjnhk="; + }; + + postPatch = '' + # Remove build-system requirements as we handle them through Nix + sed -i '/\[build-system\]/,/build-backend/d' pyproject.toml + ''; + + build-system = [ + setuptools + setuptools-git + ]; + + dependencies = [ + click + jinja2 + lxml + tabulate + ruamel-yaml + ]; + + nativeCheckInputs = [ + pytestCheckHook + mock + ]; + + disabledTests = [ + # Tests require git and a git repository + "test_filesystem_git_integration" + "test_filesystem_git_integration__not_found" + "test_filesystem_git_has_file_integration" + "test_filesystem_git_has_file_integration__not_found" + "test_filesystem_factory" + ]; + + pythonImportsCheck = [ "pycobertura" ]; + + meta = { + description = "Cobertura coverage parser that can diff reports and show coverage progress"; + homepage = "https://github.com/aconrad/pycobertura"; + changelog = "https://github.com/aconrad/pycobertura/blob/${version}/CHANGES.md"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ lovesegfault ]; + mainProgram = "pycobertura"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c9a1f523aa80..b3b83e63e587 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6810,6 +6810,8 @@ with pkgs; premake = premake4; + pycobertura = with python3Packages; toPythonApplication pycobertura; + pycritty = with python3Packages; toPythonApplication pycritty; qtcreator = qt6Packages.callPackage ../development/tools/qtcreator { diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 781d7cedb9bd..e55c5126e77a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -12766,6 +12766,8 @@ self: super: with self; { pycmus = callPackage ../development/python-modules/pycmus { }; + pycobertura = callPackage ../development/python-modules/pycobertura { }; + pycocotools = callPackage ../development/python-modules/pycocotools { }; pycodestyle = callPackage ../development/python-modules/pycodestyle { };