2022-06-16 17:23:12 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
|
|
|
, fetchPypi
|
|
|
|
, setuptools
|
|
|
|
, click
|
|
|
|
, requests
|
|
|
|
, packaging
|
|
|
|
, dparse
|
2022-07-14 12:49:19 +00:00
|
|
|
, ruamel-yaml
|
2022-06-16 17:23:12 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
}:
|
2020-05-15 21:57:56 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "safety";
|
2022-07-14 12:49:19 +00:00
|
|
|
version = "2.0.0";
|
2020-05-15 21:57:56 +00:00
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
format = "pyproject";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2020-05-15 21:57:56 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-07-14 12:49:19 +00:00
|
|
|
sha256 = "d739d00a9e4203cfaba34540c822a73ca1d327159ed7776b3dce09391f81c35d";
|
2020-05-15 21:57:56 +00:00
|
|
|
};
|
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace safety/safety.py \
|
|
|
|
--replace "telemetry=True" "telemetry=False"
|
|
|
|
substituteInPlace safety/cli.py \
|
|
|
|
--replace "telemetry', default=True" "telemetry', default=False"
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
click
|
|
|
|
requests
|
|
|
|
packaging
|
|
|
|
dparse
|
2022-07-14 12:49:19 +00:00
|
|
|
ruamel-yaml
|
2022-06-16 17:23:12 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
2020-05-15 21:57:56 +00:00
|
|
|
|
|
|
|
# Disable tests depending on online services
|
|
|
|
disabledTests = [
|
2022-07-14 12:49:19 +00:00
|
|
|
"test_announcements_if_is_not_tty"
|
2020-05-15 21:57:56 +00:00
|
|
|
"test_check_live"
|
|
|
|
"test_check_live_cached"
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2022-06-16 17:23:12 +00:00
|
|
|
description = "Checks installed dependencies for known vulnerabilities";
|
2020-05-15 21:57:56 +00:00
|
|
|
homepage = "https://github.com/pyupio/safety";
|
2022-07-14 12:49:19 +00:00
|
|
|
changelog = "https://github.com/pyupio/safety/blob/${version}/CHANGELOG.md";
|
2020-05-15 21:57:56 +00:00
|
|
|
license = licenses.mit;
|
2022-06-16 17:23:12 +00:00
|
|
|
maintainers = with maintainers; [ thomasdesr dotlambda ];
|
2020-05-15 21:57:56 +00:00
|
|
|
};
|
|
|
|
}
|