diff --git a/pkgs/development/python-modules/compliance-trestle/default.nix b/pkgs/development/python-modules/compliance-trestle/default.nix new file mode 100755 index 000000000000..b67b80f02c01 --- /dev/null +++ b/pkgs/development/python-modules/compliance-trestle/default.nix @@ -0,0 +1,108 @@ +{ + attrs, + buildPythonPackage, + cmarkgfm, + cryptography, + defusedxml, + datamodel-code-generator, + email-validator, + fetchFromGitHub, + furl, + ilcli, + importlib-resources, + jinja2, + lib, + mypy, + openpyxl, + orjson, + paramiko, + pytestCheckHook, + pydantic, + python-dotenv, + python-frontmatter, + requests, + ruamel-yaml, + setuptools, + setuptools-scm, +}: + +buildPythonPackage rec { + pname = "compliance-trestle"; + version = "3.7.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "oscal-compass"; + repo = "compliance-trestle"; + tag = "v${version}"; + hash = "sha256-MEPleUM5gSCJjVaVbNtNzRl+Vvvk97h6Q/mOWIxFd2Q="; + fetchSubmodules = true; + }; + + pythonRelaxDeps = true; + + postPatch = '' + substituteInPlace tests/trestle/misc/mypy_test.py \ + --replace-fail "trestle'," "${placeholder "out"}/bin/trestle'," \ + ''; + + build-system = [ + setuptools + setuptools-scm + ]; + + dependencies = [ + attrs + cmarkgfm + cryptography + defusedxml + datamodel-code-generator + email-validator + furl + ilcli + importlib-resources + jinja2 + openpyxl + orjson + paramiko + pydantic + python-dotenv + python-frontmatter + requests + ruamel-yaml + ]; + + nativeCheckInputs = [ + pytestCheckHook + mypy + ]; + + disabledTests = [ + # Requires network access + "test_import_from_url" + "test_import_from_nist" + "test_remote_profile_relative_cat" + + # AssertionError + "test_profile_generate_assemble_rev_5" + "test_ssp_assemble_fedramp_profile" + "test_ssp_generate_aggregates_no_cds" + "test_ssp_generate_aggregates_no_param_value_orig" + ]; + + disabledTestPaths = [ + # Requires network access + "tests/trestle/core/remote" + ]; + + pythonImportsCheck = [ "trestle" ]; + + meta = { + description = "An opinionated tooling platform for managing compliance as code, using continuous integration and NIST's OSCAL standard"; + homepage = "https://github.com/oscal-compass/compliance-trestle"; + changelog = "https://github.com/oscal-compass/compliance-trestle/blob/${src.rev}/CHANGELOG.md"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ tochiaha ]; + mainProgram = "trestle"; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 3ef71be85705..28ec50e3db1a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2572,6 +2572,8 @@ self: super: with self; { commonregex = callPackage ../development/python-modules/commonregex { }; + compliance-trestle = callPackage ../development/python-modules/compliance-trestle { }; + complycube = callPackage ../development/python-modules/complycube { }; compreffor = callPackage ../development/python-modules/compreffor { };