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-11-27 09:42:12 +00:00
|
|
|
version = "2.3.2";
|
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-11-27 09:42:12 +00:00
|
|
|
hash = "sha256-ftjXH1unWQ0cmr+iLHKmTeOJri4HxnMrHJCVWhaMVb8=";
|
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"
|
2022-11-21 17:40:18 +00:00
|
|
|
substituteInPlace safety/util.py \
|
|
|
|
--replace "telemetry=True" "telemetry=False"
|
2022-07-14 12:49:19 +00:00
|
|
|
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"
|
2022-08-12 12:06:08 +00:00
|
|
|
"test_check_vulnerabilities"
|
|
|
|
"test_license"
|
|
|
|
"test_chained_review"
|
2020-05-15 21:57:56 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|