From e562c1a88d13152dde97185f4fffea683766c07c Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 18 May 2024 18:09:59 +0200 Subject: [PATCH 1/2] python311Packages.pefile: fetch from pypi The GitHub repository contains a large chunk of unusable test fixtures and there is no point in fetching >60 MB of source, that we cannot use. --- pkgs/development/python-modules/pefile/default.nix | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/pefile/default.nix b/pkgs/development/python-modules/pefile/default.nix index 55bd8c0cc07d..97b3419d7b55 100644 --- a/pkgs/development/python-modules/pefile/default.nix +++ b/pkgs/development/python-modules/pefile/default.nix @@ -1,7 +1,7 @@ { lib , buildPythonPackage , future -, fetchFromGitHub +, fetchPypi , setuptools-scm , pythonOlder }: @@ -13,11 +13,10 @@ buildPythonPackage rec { disabled = pythonOlder "3.6"; - src = fetchFromGitHub { - owner = "erocarrera"; - repo = pname; - rev = "refs/tags/v${version}"; - hash = "sha256-lD8GpNl+cVNYTZUKFRF1/2kDwEbn/ekRBNBTYuFmFW0="; + # DON'T fetch from github, the repo is >60 MB due to test artifacts, which we cannot use + src = fetchPypi { + inherit pname version; + hash = "sha256-guYRQASz1pEcd8OVPjg4ZUsEURuLZuhYPbcMZZmAF9w="; }; nativeBuildInputs = [ @@ -28,7 +27,7 @@ buildPythonPackage rec { future ]; - # Test data encrypted + # Test data contains properitary executables and malware, and is therefore encrypted doCheck = false; pythonImportsCheck = [ From e5d4072b74f6aca3cbacbadf13311dd05152aea0 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 18 May 2024 19:35:09 +0200 Subject: [PATCH 2/2] python311Packages.virt-firmware: fix tests --- .../python-modules/virt-firmware/default.nix | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/virt-firmware/default.nix b/pkgs/development/python-modules/virt-firmware/default.nix index d5da9d57c40f..f319de6370fb 100644 --- a/pkgs/development/python-modules/virt-firmware/default.nix +++ b/pkgs/development/python-modules/virt-firmware/default.nix @@ -1,4 +1,6 @@ { lib +, pkgs +, stdenv , buildPythonPackage , fetchPypi , setuptools @@ -10,7 +12,6 @@ buildPythonPackage rec { pname = "virt-firmware"; version = "24.4"; - pyproject = true; src = fetchPypi { @@ -18,23 +19,28 @@ buildPythonPackage rec { hash = "sha256-rqhaKDOQEOj6bcRz3qZJ+a4yG1qTC9SUjuxMhZlnmwU="; }; - pythonImportsCheck = [ "virt.firmware.efi" ]; - - nativeBuildInputs = [ + build-system = [ setuptools ]; - nativeCheckInputs = [ - pytestCheckHook - ]; - pytestFlagsArray = ["tests/tests.py"]; - - propagatedBuildInputs = [ + dependencies = [ setuptools cryptography pefile ]; + # tests require systemd-detect-virt + doCheck = lib.meta.availableOn stdenv.hostPlatform pkgs.systemd; + + nativeCheckInputs = [ + pytestCheckHook + pkgs.systemd + ]; + + pytestFlagsArray = [ "tests/tests.py" ]; + + pythonImportsCheck = [ "virt.firmware.efi" ]; + meta = with lib; { description = "Tools for virtual machine firmware volumes"; homepage = "https://gitlab.com/kraxel/virt-firmware";