diff --git a/pkgs/development/python-modules/pysmart-smartx/default.nix b/pkgs/development/python-modules/pysmart-smartx/default.nix deleted file mode 100644 index 66b789668a0..00000000000 --- a/pkgs/development/python-modules/pysmart-smartx/default.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ lib -, buildPythonPackage -, fetchFromGitHub -, isPy3k -, future -, pytestCheckHook -, mock -}: - -buildPythonPackage rec { - pname = "pysmart-smartx"; - version = "0.3.10"; - - src = fetchFromGitHub { - owner = "smartxworks"; - repo = "pySMART"; - rev = "v${version}"; - sha256 = "1irl4nlgz3ds3aikraa9928gzn6hz8chfh7jnpmq2q7d2vqbdrjs"; - }; - - propagatedBuildInputs = [ future ]; - - # tests require contextlib.nested - doCheck = !isPy3k; - - checkInputs = [ pytestCheckHook mock ]; - - pythonImportsCheck = [ "pySMART" ]; - - meta = with lib; { - description = "It's a fork of pySMART with lots of bug fix and enhances"; - homepage = "https://github.com/smartxworks/pySMART"; - maintainers = with maintainers; [ rhoriguchi ]; - license = licenses.gpl2Only; - }; -} diff --git a/pkgs/development/python-modules/pysmart/default.nix b/pkgs/development/python-modules/pysmart/default.nix new file mode 100644 index 00000000000..3bd5fa50a13 --- /dev/null +++ b/pkgs/development/python-modules/pysmart/default.nix @@ -0,0 +1,37 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, smartmontools +, humanfriendly +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "pysmart"; + version = "1.1.0"; + + src = fetchFromGitHub { + owner = "truenas"; + repo = "py-SMART"; + rev = "v${version}"; + sha256 = "sha256-e46ALiYg0Db/gOzqLmVc1vi9ObhfxzqwfQk9/9pz+r0="; + }; + + postPatch = '' + substituteInPlace pySMART/utils.py \ + --replace "which('smartctl')" '"${smartmontools}/bin/smartctl"' + ''; + + propagatedBuildInputs = [ humanfriendly ]; + + checkInputs = [ pytestCheckHook ]; + + pythonImportsCheck = [ "pySMART" ]; + + meta = with lib; { + description = "Wrapper for smartctl (smartmontools)"; + homepage = "https://github.com/truenas/py-SMART"; + maintainers = with maintainers; [ nyanloutre ]; + license = licenses.lgpl21Only; + }; +} diff --git a/pkgs/top-level/python-aliases.nix b/pkgs/top-level/python-aliases.nix index 9e24ea29e7f..87eff1a02f0 100644 --- a/pkgs/top-level/python-aliases.nix +++ b/pkgs/top-level/python-aliases.nix @@ -62,6 +62,7 @@ mapAliases ({ prompt_toolkit = prompt-toolkit; pylibgen = throw "pylibgen is unmaintained upstreamed, and removed from nixpkgs"; # added 2020-06-20 pymssql = throw "pymssql has been abandoned upstream."; # added 2020-05-04 + pysmart-smartx = pysmart; # added 2021-10-22 pytestcov = pytest-cov; # added 2021-01-04 pytest-pep8 = pytestpep8; # added 2021-01-04 pytestpep8 = throw "pytestpep8 was removed because it is abandoned and no longer compatible with pytest v6.0"; # added 2020-12-10 diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 61cadea5f26..77dc6d7f02f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6989,7 +6989,7 @@ in { pysmappee = callPackage ../development/python-modules/pysmappee { }; - pysmart-smartx = callPackage ../development/python-modules/pysmart-smartx { }; + pysmart = callPackage ../development/python-modules/pysmart { }; pysmartapp = callPackage ../development/python-modules/pysmartapp { };