depot/third_party/nixpkgs/pkgs/development/python-modules/safety/default.nix
Default email 02cf88bb76 Project import generated by Copybara.
GitOrigin-RevId: c4a0efdd5a728e20791b8d8d2f26f90ac228ee8d
2022-08-12 15:06:08 +03:00

72 lines
1.4 KiB
Nix

{ lib
, buildPythonPackage
, pythonOlder
, fetchPypi
, setuptools
, click
, requests
, packaging
, dparse
, ruamel-yaml
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "safety";
version = "2.1.1";
disabled = pythonOlder "3.6";
format = "pyproject";
src = fetchPypi {
inherit pname version;
hash = "sha256-28Xf+i5H2nbMQ9/oy7v8qZ0pEY0MbFTfz6EcK9NJ3/Y=";
};
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 ];
};
}