diff --git a/pkgs/development/python-modules/cyclonedx-python-lib/default.nix b/pkgs/development/python-modules/cyclonedx-python-lib/default.nix new file mode 100644 index 000000000000..a2f4f47500e5 --- /dev/null +++ b/pkgs/development/python-modules/cyclonedx-python-lib/default.nix @@ -0,0 +1,62 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, importlib-metadata +, packageurl-python +, poetry-core +, pytestCheckHook +, pythonOlder +, requirements-parser +, setuptools +, toml +, tox +}: + +buildPythonPackage rec { + pname = "cyclonedx-python-lib"; + version = "0.9.1"; + format = "pyproject"; + + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "CycloneDX"; + repo = pname; + rev = "v${version}"; + sha256 = "1jzklbypn927xslag2x56mb5cplvhqjcgj43hvww6qxcfr57ywam"; + }; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + importlib-metadata + packageurl-python + requirements-parser + setuptools + toml + ]; + + checkInputs = [ + pytestCheckHook + tox + ]; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace 'setuptools = "^50.3.2"' 'setuptools = "*"' \ + --replace 'importlib-metadata = "^4.8.1"' 'importlib-metadata = "*"' + ''; + + pythonImportsCheck = [ + "cyclonedx" + ]; + + meta = with lib; { + description = "Python library for generating CycloneDX SBOMs"; + homepage = "https://github.com/CycloneDX/cyclonedx-python-lib"; + license = with licenses; [ asl20 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 7e6f3a160700..1dbf3a68642f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1822,6 +1822,8 @@ in { cycler = callPackage ../development/python-modules/cycler { }; + cyclonedx-python-lib = callPackage ../development/python-modules/cyclonedx-python-lib { }; + cymem = callPackage ../development/python-modules/cymem { }; cypari2 = callPackage ../development/python-modules/cypari2 { };