diff --git a/pkgs/development/python-modules/safety-schemas/default.nix b/pkgs/development/python-modules/safety-schemas/default.nix new file mode 100644 index 000000000000..0f9724e95f65 --- /dev/null +++ b/pkgs/development/python-modules/safety-schemas/default.nix @@ -0,0 +1,52 @@ +{ lib +, buildPythonPackage +, fetchPypi +, hatchling +, pythonRelaxDepsHook +, dparse +, packaging +, pydantic +, ruamel-yaml +, typing-extensions +}: + +buildPythonPackage rec { + pname = "safety-schemas"; + version = "0.0.2"; + pyproject = true; + + src = fetchPypi { + pname = "safety_schemas"; + inherit version; + hash = "sha256-fRsEDsBkgPBc/2tF6nqT4JyJQt+GT7DQHd62fDI8+ow="; + }; + + nativeBuildInputs = [ + hatchling + pythonRelaxDepsHook + ]; + + pythonRelaxDeps = [ + "dparse" + ]; + + propagatedBuildInputs = [ + dparse + packaging + pydantic + ruamel-yaml + typing-extensions + ]; + + pythonImportsCheck = [ "safety_schemas" ]; + + # upstream has no tests + doCheck = false; + + meta = { + description = "Schemas for Safety CLI"; + homepage = "https://pypi.org/project/safety-schemas/"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/development/python-modules/safety/default.nix b/pkgs/development/python-modules/safety/default.nix index bb367629b5a3..dee37f85eeb4 100644 --- a/pkgs/development/python-modules/safety/default.nix +++ b/pkgs/development/python-modules/safety/default.nix @@ -5,33 +5,46 @@ , pythonRelaxDepsHook , setuptools , click +, urllib3 , requests , packaging , dparse , ruamel-yaml +, jinja2 +, marshmallow +, authlib +, jwt +, rich +, typer +, pydantic +, safety-schemas +, typing-extensions , pytestCheckHook }: buildPythonPackage rec { pname = "safety"; - version = "2.3.5"; + version = "3.0.1"; - disabled = pythonOlder "3.6"; + disabled = pythonOlder "3.7"; - format = "pyproject"; + pyproject = true; src = fetchPypi { inherit pname version; - hash = "sha256-pgwR+JUvQSy7Fl1wyx9nOjtDorqak84R+X5qTeg0qjo="; + hash = "sha256-HyAA8DZS86C/xn+P0emLxXI8y3bhXLG91oVFw9gD3wE="; }; postPatch = '' substituteInPlace safety/safety.py \ - --replace "telemetry=True" "telemetry=False" + --replace-fail "telemetry=True" "telemetry=False" substituteInPlace safety/util.py \ - --replace "telemetry=True" "telemetry=False" + --replace-fail "telemetry = True" "telemetry = False" substituteInPlace safety/cli.py \ - --replace "telemetry', default=True" "telemetry', default=False" + --replace-fail "disable-optional-telemetry', default=False" \ + "disable-optional-telemetry', default=True" + substituteInPlace safety/scan/finder/handlers.py \ + --replace-fail "telemetry=True" "telemetry=False" ''; nativeBuildInputs = [ @@ -41,15 +54,28 @@ buildPythonPackage rec { pythonRelaxDeps = [ "packaging" + "dparse" + "authlib" + "pydantic" ]; propagatedBuildInputs = [ setuptools click + urllib3 requests packaging dparse ruamel-yaml + jinja2 + marshmallow + authlib + jwt + rich + typer + pydantic + safety-schemas + typing-extensions ]; nativeCheckInputs = [ @@ -61,9 +87,8 @@ buildPythonPackage rec { "test_announcements_if_is_not_tty" "test_check_live" "test_check_live_cached" - "test_check_vulnerabilities" - "test_license" - "test_chained_review" + "test_get_packages_licenses_without_api_key" + "test_validate_with_policy_file_using_invalid_keyword" ]; preCheck = '' diff --git a/pkgs/tools/package-management/poetry/plugins/poetry-audit-plugin.nix b/pkgs/tools/package-management/poetry/plugins/poetry-audit-plugin.nix index 85eb0b5d19b1..6c3f120171be 100644 --- a/pkgs/tools/package-management/poetry/plugins/poetry-audit-plugin.nix +++ b/pkgs/tools/package-management/poetry/plugins/poetry-audit-plugin.nix @@ -10,17 +10,16 @@ buildPythonPackage rec { pname = "poetry-audit-plugin"; - version = "0.3.0"; + version = "0.4.0"; + pyproject = true; - disabled = pythonOlder "3.7"; - - format = "pyproject"; + disabled = pythonOlder "3.8"; src = fetchFromGitHub { owner = "opeco17"; repo = "poetry-audit-plugin"; rev = "refs/tags/${version}"; - hash = "sha256-49OnYz3EFiqOe+cLgfynjy14Ve4Ga6OUrLdM8HhZuKQ="; + hash = "sha256-kiNtzEup2ygCTk0zk8YV2jxAj6ZzOhP8v0U4FbV15hI="; }; nativeBuildInputs = [ diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2bdd593bd59a..9258f8652160 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -13166,6 +13166,8 @@ self: super: with self; { safety = callPackage ../development/python-modules/safety { }; + safety-schemas = callPackage ../development/python-modules/safety-schemas { }; + sagemaker = callPackage ../development/python-modules/sagemaker { }; salmon-mail = callPackage ../development/python-modules/salmon-mail { };