about summary refs log tree commit diff
path: root/pkgs/development/python-modules/safety/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/safety/default.nix')
-rw-r--r--pkgs/development/python-modules/safety/default.nix33
1 files changed, 33 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/safety/default.nix b/pkgs/development/python-modules/safety/default.nix
new file mode 100644
index 000000000000..c268f2699595
--- /dev/null
+++ b/pkgs/development/python-modules/safety/default.nix
@@ -0,0 +1,33 @@
+{ lib, buildPythonPackage, fetchPypi, requests, dparse, click, setuptools, pytestCheckHook }:
+
+buildPythonPackage rec {
+  pname = "safety";
+  version = "1.9.0";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "23bf20690d4400edc795836b0c983c2b4cbbb922233108ff925b7dd7750f00c9";
+  };
+
+  propagatedBuildInputs = [ requests dparse click setuptools ];
+
+  # Disable tests depending on online services
+  checkInputs = [ pytestCheckHook ];
+  dontUseSetuptoolsCheck = true;
+  disabledTests = [
+    "test_check_live"
+    "test_check_live_cached"
+  ];
+
+  preCheck = ''
+    export HOME=$(mktemp -d)
+  '';
+
+  meta = with lib; {
+    description =
+      "Safety checks your installed dependencies for known security vulnerabilities";
+    homepage = "https://github.com/pyupio/safety";
+    license = licenses.mit;
+    maintainers = with maintainers; [ thomasdesr ];
+  };
+}