From 3f2838e5f5a0dec2180b32e12e5a6b24b0f08d5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Mon, 30 May 2022 04:49:22 +0200 Subject: [PATCH] python310Packages.swagger-spec-validator: switch to pytestCheckHook, add imports check --- .../swagger-spec-validator/default.nix | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/pkgs/development/python-modules/swagger-spec-validator/default.nix b/pkgs/development/python-modules/swagger-spec-validator/default.nix index ce67e6689ace..ec15516b16b6 100644 --- a/pkgs/development/python-modules/swagger-spec-validator/default.nix +++ b/pkgs/development/python-modules/swagger-spec-validator/default.nix @@ -1,4 +1,4 @@ -{ lib, buildPythonPackage, fetchFromGitHub, pyyaml, jsonschema, six, pytest, mock }: +{ lib, buildPythonPackage, fetchFromGitHub, pyyaml, jsonschema, six, pytestCheckHook, mock }: buildPythonPackage rec { pname = "swagger-spec-validator"; @@ -7,25 +7,23 @@ buildPythonPackage rec { src = fetchFromGitHub { owner = "Yelp"; repo = "swagger_spec_validator"; - rev = "v" + version; + rev = "v${version}"; sha256 = "sha256-7+kFmtzeze0QlGf6z/M4J4F7z771a5NWewB1S3+bxn4="; }; - checkInputs = [ - pytest - mock - ]; - - checkPhase = '' - pytest tests - ''; - propagatedBuildInputs = [ pyyaml jsonschema six ]; + checkInputs = [ + pytestCheckHook + mock + ]; + + pythonImportsCheck = [ "swagger_spec_validator" ]; + meta = with lib; { homepage = "https://github.com/Yelp/swagger_spec_validator"; license = licenses.asl20; @@ -33,5 +31,3 @@ buildPythonPackage rec { maintainers = with maintainers; [ vanschelven ]; }; } - -