Unverified Commit 827d5658 authored by Mario Rodas's avatar Mario Rodas Committed by GitHub
Browse files

Merge pull request #235477 from rhoriguchi/python3Packages.pysmart

python3Packages.pysmart: 1.2.3 -> 1.2.5
parents d32ea984 456dfbb5
Loading
Loading
Loading
Loading
+14 −5
Original line number Diff line number Diff line
{ lib
, buildPythonPackage
, fetchFromGitHub
, smartmontools
, chardet
, humanfriendly
, pytestCheckHook
, pythonOlder
, setuptools-scm
, smartmontools
}:

buildPythonPackage rec {
  pname = "pysmart";
  version = "1.2.3";
  format = "setuptools";
  version = "1.2.5";
  format = "pyproject";

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "truenas";
    repo = "py-SMART";
    rev = "refs/tags/v${version}";
    hash = "sha256-5VoZEgHWmHUDkm2KhBP0gfmhOJUYJUqDLWBp/kU1404=";
    rev = "v${version}";
    hash = "sha256-NqE7Twl1kxXrASyxw35xIOTB+LThU0a45NCxh8SUxfI=";
  };

  SETUPTOOLS_SCM_PRETEND_VERSION = version;

  postPatch = ''
    substituteInPlace pySMART/utils.py \
      --replace "which('smartctl')" '"${smartmontools}/bin/smartctl"'
  '';

  propagatedBuildInputs = [
    chardet
    humanfriendly
  ];

  nativeBuildInputs = [
    setuptools-scm
  ];

  nativeCheckInputs = [
    pytestCheckHook
  ];