Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / safety / default.nix
blobbb367629b5a34af494cc8661ada8a68baf241942
1 { lib
2 , buildPythonPackage
3 , pythonOlder
4 , fetchPypi
5 , pythonRelaxDepsHook
6 , setuptools
7 , click
8 , requests
9 , packaging
10 , dparse
11 , ruamel-yaml
12 , pytestCheckHook
15 buildPythonPackage rec {
16   pname = "safety";
17   version = "2.3.5";
19   disabled = pythonOlder "3.6";
21   format = "pyproject";
23   src = fetchPypi {
24     inherit pname version;
25     hash = "sha256-pgwR+JUvQSy7Fl1wyx9nOjtDorqak84R+X5qTeg0qjo=";
26   };
28   postPatch = ''
29     substituteInPlace safety/safety.py \
30       --replace "telemetry=True" "telemetry=False"
31     substituteInPlace safety/util.py \
32       --replace "telemetry=True" "telemetry=False"
33     substituteInPlace safety/cli.py \
34       --replace "telemetry', default=True" "telemetry', default=False"
35   '';
37   nativeBuildInputs = [
38     pythonRelaxDepsHook
39     setuptools
40   ];
42   pythonRelaxDeps = [
43     "packaging"
44   ];
46   propagatedBuildInputs = [
47     setuptools
48     click
49     requests
50     packaging
51     dparse
52     ruamel-yaml
53   ];
55   nativeCheckInputs = [
56     pytestCheckHook
57   ];
59   # Disable tests depending on online services
60   disabledTests = [
61     "test_announcements_if_is_not_tty"
62     "test_check_live"
63     "test_check_live_cached"
64     "test_check_vulnerabilities"
65     "test_license"
66     "test_chained_review"
67   ];
69   preCheck = ''
70     export HOME=$(mktemp -d)
71   '';
73   meta = with lib; {
74     description = "Checks installed dependencies for known vulnerabilities";
75     homepage = "https://github.com/pyupio/safety";
76     changelog = "https://github.com/pyupio/safety/blob/${version}/CHANGELOG.md";
77     license = licenses.mit;
78     maintainers = with maintainers; [ thomasdesr dotlambda ];
79   };