summary refs log tree commit diff
path: root/pkgs/development/python-modules/serverlessrepo/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/serverlessrepo/default.nix')
-rw-r--r--pkgs/development/python-modules/serverlessrepo/default.nix27
1 files changed, 22 insertions, 5 deletions
diff --git a/pkgs/development/python-modules/serverlessrepo/default.nix b/pkgs/development/python-modules/serverlessrepo/default.nix
index 2a8267710a0..d3cc7e9c633 100644
--- a/pkgs/development/python-modules/serverlessrepo/default.nix
+++ b/pkgs/development/python-modules/serverlessrepo/default.nix
@@ -1,16 +1,20 @@
 { lib
 , buildPythonPackage
 , fetchPypi
-, pytest
+, pytestCheckHook
 , boto3
 , six
 , pyyaml
 , mock
+, pythonOlder
 }:
 
 buildPythonPackage rec {
   pname = "serverlessrepo";
   version = "0.1.10";
+  format = "setuptools";
+
+  disabled = pythonOlder "3.7";
 
   src = fetchPypi {
     inherit pname version;
@@ -23,12 +27,25 @@ buildPythonPackage rec {
     pyyaml
   ];
 
-  checkInputs = [ pytest mock ];
+  checkInputs = [
+    pytestCheckHook
+    mock
+  ];
 
-  checkPhase = ''
-    pytest tests/unit
+  postPatch = ''
+    substituteInPlace setup.py \
+      --replace "pyyaml~=5.1" "pyyaml" \
+      --replace "boto3~=1.9, >=1.9.56" "boto3"
   '';
 
+  pytestFlagsArray = [
+    "tests/unit"
+  ];
+
+  pythonImportsCheck = [
+    "serverlessrepo"
+  ];
+
   meta = with lib; {
     homepage = "https://github.com/awslabs/aws-serverlessrepo-python";
     description = "Helpers for working with the AWS Serverless Application Repository";
@@ -36,7 +53,7 @@ buildPythonPackage rec {
       A Python library with convenience helpers for working with the
       AWS Serverless Application Repository.
     '';
-    license = lib.licenses.asl20;
+    license = licenses.asl20;
     maintainers = with maintainers; [ dhkl ];
   };
 }