depot/third_party/nixpkgs/pkgs/development/python-modules/cyclonedx-python-lib/default.nix
Default email 02cf88bb76 Project import generated by Copybara.
GitOrigin-RevId: c4a0efdd5a728e20791b8d8d2f26f90ac228ee8d
2022-08-12 15:06:08 +03:00

73 lines
1.3 KiB
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, importlib-metadata
, jsonschema
, lxml
, packageurl-python
, poetry-core
, python
, pythonOlder
, requirements-parser
, sortedcontainers
, setuptools
, toml
, types-setuptools
, types-toml
, xmldiff
}:
buildPythonPackage rec {
pname = "cyclonedx-python-lib";
version = "2.7.1";
format = "pyproject";
disabled = pythonOlder "3.9";
src = fetchFromGitHub {
owner = "CycloneDX";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-c/KhoJOa121/h0n0GUazjUFChnUo05ThD+fuZXc5/Pk=";
};
nativeBuildInputs = [
poetry-core
];
propagatedBuildInputs = [
importlib-metadata
packageurl-python
requirements-parser
setuptools
sortedcontainers
toml
types-setuptools
types-toml
];
checkInputs = [
jsonschema
lxml
xmldiff
];
pythonImportsCheck = [
"cyclonedx"
];
checkPhase = ''
runHook preCheck
# Tests require network access
rm tests/test_output_json.py
${python.interpreter} -m unittest discover -s tests -v
runHook postCheck
'';
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 ];
};
}