mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-20 08:59:32 +03:00
73 lines
1.4 KiB
Nix
73 lines
1.4 KiB
Nix
{ lib
|
|
, buildPythonPackage
|
|
, pythonOlder
|
|
, fetchPypi
|
|
, setuptools
|
|
, click
|
|
, requests
|
|
, packaging
|
|
, dparse
|
|
, ruamel-yaml
|
|
, pytestCheckHook
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "safety";
|
|
version = "2.2.0";
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
format = "pyproject";
|
|
|
|
src = fetchPypi {
|
|
inherit pname version;
|
|
hash = "sha256-Z0XeEqy9YKWAAf5my1QDVRh9e5kbMBBNnvFP9OSCYHM=";
|
|
};
|
|
|
|
postPatch = ''
|
|
substituteInPlace safety/safety.py \
|
|
--replace "telemetry=True" "telemetry=False"
|
|
substituteInPlace safety/cli.py \
|
|
--replace "telemetry', default=True" "telemetry', default=False"
|
|
'';
|
|
|
|
nativeBuildInputs = [
|
|
setuptools
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
setuptools
|
|
click
|
|
requests
|
|
packaging
|
|
dparse
|
|
ruamel-yaml
|
|
];
|
|
|
|
checkInputs = [
|
|
pytestCheckHook
|
|
];
|
|
|
|
# Disable tests depending on online services
|
|
disabledTests = [
|
|
"test_announcements_if_is_not_tty"
|
|
"test_check_live"
|
|
"test_check_live_cached"
|
|
"test_check_vulnerabilities"
|
|
"test_license"
|
|
"test_chained_review"
|
|
];
|
|
|
|
preCheck = ''
|
|
export HOME=$(mktemp -d)
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Checks installed dependencies for known vulnerabilities";
|
|
homepage = "https://github.com/pyupio/safety";
|
|
changelog = "https://github.com/pyupio/safety/blob/${version}/CHANGELOG.md";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ thomasdesr dotlambda ];
|
|
};
|
|
}
|