depot/third_party/nixpkgs/pkgs/development/python-modules/cyclonedx-python-lib/default.nix
Default email 889482aab3 Project import generated by Copybara.
GitOrigin-RevId: f2537a505d45c31fe5d9c27ea9829b6f4c4e6ac5
2022-06-26 12:26:21 +02: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.6.0";
format = "pyproject";
disabled = pythonOlder "3.9";
src = fetchFromGitHub {
owner = "CycloneDX";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-UM5z8FEu+Pua/LToraGh8N6V3ujUnu4F6lJec+4cUg4=";
};
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 ];
};
}