From 68a4f5300e3be232ffba94bba53849ea1303b383 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Thu, 26 Jan 2023 19:57:27 +0100 Subject: [PATCH 1/3] python310Packages.scooby: 0.7.0 -> 0.7.1 --- pkgs/development/python-modules/scooby/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/scooby/default.nix b/pkgs/development/python-modules/scooby/default.nix index bdcc62963a73..255342186229 100644 --- a/pkgs/development/python-modules/scooby/default.nix +++ b/pkgs/development/python-modules/scooby/default.nix @@ -6,11 +6,11 @@ buildPythonPackage rec { pname = "scooby"; - version = "0.7.0"; + version = "0.7.1"; src = fetchPypi { inherit pname version; - sha256 = "sha256-scD/uuAtepatt8Yn7b6PJMfSj9AT7iOy0HuVHyVvEhk="; + hash = "sha256-UgFPRoG8wylZMuDz2Utp5A5hlaaWWzTmiUExLOa2Nt4="; }; nativeBuildInputs = [ From 1a96861bb3dcc60300cbce93091f7e8fe1c7a371 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 26 Jan 2023 20:01:50 +0100 Subject: [PATCH 2/3] python310Packages.scooby: add changelog to meta --- pkgs/development/python-modules/scooby/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/python-modules/scooby/default.nix b/pkgs/development/python-modules/scooby/default.nix index 255342186229..968ba1dde1e9 100644 --- a/pkgs/development/python-modules/scooby/default.nix +++ b/pkgs/development/python-modules/scooby/default.nix @@ -22,6 +22,7 @@ buildPythonPackage rec { meta = with lib; { homepage = "https://github.com/banesullivan/scooby"; description = "A lightweight tool for reporting Python package versions and hardware resources"; + changelog = "https://github.com/banesullivan/scooby/releases/tag/v${version}"; license = licenses.mit; maintainers = with maintainers; [ wegank ]; }; From 58cf6e1a2f5217fe3c67f682f84c54da8ac75c30 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 27 Jan 2023 09:52:57 +0100 Subject: [PATCH 3/3] python310Packages.scooby: enable tests --- .../python-modules/scooby/default.nix | 51 ++++++++++++++++--- 1 file changed, 44 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/scooby/default.nix b/pkgs/development/python-modules/scooby/default.nix index 968ba1dde1e9..0bd037a74fc7 100644 --- a/pkgs/development/python-modules/scooby/default.nix +++ b/pkgs/development/python-modules/scooby/default.nix @@ -1,28 +1,65 @@ { lib +, beautifulsoup4 , buildPythonPackage -, fetchPypi +, fetchFromGitHub +, numpy +, pytest-console-scripts +, pytestCheckHook +, pythonOlder +, pyvips +, scipy , setuptools-scm }: buildPythonPackage rec { pname = "scooby"; version = "0.7.1"; + format = "setuptools"; - src = fetchPypi { - inherit pname version; - hash = "sha256-UgFPRoG8wylZMuDz2Utp5A5hlaaWWzTmiUExLOa2Nt4="; + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "banesullivan"; + repo = pname; + rev = "refs/tags/v${version}"; + hash = "sha256-wKbCIA6Xp+VYhcQ5ZpHo5usB+ksnMAJyv5naBvl4Cxo="; }; + SETUPTOOLS_SCM_PRETEND_VERSION = version; + nativeBuildInputs = [ setuptools-scm ]; - pythonImportsCheck = [ "scooby" ]; + nativeCheckInputs = [ + beautifulsoup4 + numpy + pytest-console-scripts + pytestCheckHook + pyvips + scipy + ]; + + preCheck = '' + export PATH="$PATH:$out/bin"; + ''; + + pythonImportsCheck = [ + "scooby" + ]; + + disabledTests = [ + # Tests have additions requirements (e.g., time and module) + "test_get_version" + "test_tracking" + "test_import_os_error" + "test_import_time" + ]; meta = with lib; { - homepage = "https://github.com/banesullivan/scooby"; - description = "A lightweight tool for reporting Python package versions and hardware resources"; changelog = "https://github.com/banesullivan/scooby/releases/tag/v${version}"; + description = "A lightweight tool for reporting Python package versions and hardware resources"; + homepage = "https://github.com/banesullivan/scooby"; license = licenses.mit; maintainers = with maintainers; [ wegank ]; };