From d76a2e59297d23af97942361a04c405e0bf4e08b Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 13 Jan 2022 13:25:41 +0100 Subject: [PATCH] python3Packages.schema: switch to pytestCheckHook --- .../python-modules/schema/default.nix | 33 +++++++++++++------ 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/schema/default.nix b/pkgs/development/python-modules/schema/default.nix index 3ace46489db5..dabe046e4861 100644 --- a/pkgs/development/python-modules/schema/default.nix +++ b/pkgs/development/python-modules/schema/default.nix @@ -1,28 +1,41 @@ -{ lib, buildPythonPackage, fetchPypi, contextlib2, pytest, mock }: +{ lib +, buildPythonPackage +, contextlib2 +, fetchPypi +, mock +, pytestCheckHook +, pythonOlder +}: buildPythonPackage rec { - pname = "schema"; version = "0.7.5"; + format = "setuptools"; + + disabled = pythonOlder "3.6"; src = fetchPypi { inherit pname version; - sha256 = "f06717112c61895cabc4707752b88716e8420a8819d71404501e114f91043197"; + hash = "sha256-8GcXESxhiVyrxHB3UriHFuhCCogZ1xQEUB4RT5EEMZc="; }; - preConfigure = '' - substituteInPlace requirements.txt --replace '==' '>=' - ''; + propagatedBuildInputs = [ + contextlib2 + ]; - propagatedBuildInputs = [ contextlib2 ]; + checkInputs = [ + mock + pytestCheckHook + ]; - checkInputs = [ pytest mock ]; - checkPhase = "pytest ./test_schema.py"; + pythonImportsCheck = [ + "schema" + ]; meta = with lib; { description = "Library for validating Python data structures"; homepage = "https://github.com/keleshev/schema"; license = licenses.mit; - maintainers = [ maintainers.tobim ]; + maintainers = with maintainers; [ tobim ]; }; }