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 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 349bc242ee1d..0e2c8645d201 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6414,6 +6414,8 @@ in safe = callPackage ../tools/security/safe { }; + safety-cli = with python3.pkgs; toPythonApplication safety; + safe-rm = callPackage ../tools/system/safe-rm { }; safeeyes = callPackage ../applications/misc/safeeyes { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b41a8c802307..e54a4e9fe456 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5670,6 +5670,8 @@ in { safe = callPackage ../development/python-modules/safe { }; + safety = callPackage ../development/python-modules/safety { }; + sampledata = callPackage ../development/python-modules/sampledata { }; sasmodels = callPackage ../development/python-modules/sasmodels { };