nixpkgs/pkgs/development/python-modules/safety/default.nix
2026-05-26 18:11:40 -07:00

95 lines
1.6 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
hatchling,
click,
packaging,
dparse,
ruamel-yaml,
jinja2,
marshmallow,
nltk,
authlib,
typer,
pydantic,
safety-schemas,
typing-extensions,
filelock,
httpx,
tenacity,
tomlkit,
truststore,
git,
pytestCheckHook,
tomli,
writableTmpDirAsHomeHook,
}:
buildPythonPackage (finalAttrs: {
pname = "safety";
version = "3.8.0";
pyproject = true;
src = fetchFromGitHub {
owner = "pyupio";
repo = "safety";
tag = finalAttrs.version;
hash = "sha256-/iLxcVku8ogVZyhQI0/U+m1RyECDYWxLix+S83HHrS4=";
};
patches = [
./disable-telemetry.patch
];
build-system = [ hatchling ];
pythonRelaxDeps = [
"safety-schemas"
];
dependencies = [
click
packaging
dparse
ruamel-yaml
jinja2
marshmallow
nltk
authlib
typer
pydantic
safety-schemas
typing-extensions
filelock
httpx
tenacity
tomlkit
truststore
];
nativeCheckInputs = [
git
pytestCheckHook
tomli
writableTmpDirAsHomeHook
];
disabledTestPaths = [
# Failed to initialize SafetyPlatformClient: [Errno -3] Temporary failure in name resolution
"tests/firewall/test_command.py"
"tests/test_cli.py"
];
meta = {
description = "Checks installed dependencies for known vulnerabilities";
mainProgram = "safety";
homepage = "https://github.com/pyupio/safety";
changelog = "https://github.com/pyupio/safety/blob/${finalAttrs.src.tag}/CHANGELOG.md";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
thomasdesr
dotlambda
];
};
})