2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildNpmPackage,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
pythonOlder,
|
|
|
|
hatch-vcs,
|
|
|
|
hatchling,
|
|
|
|
jinja2,
|
|
|
|
pytest,
|
|
|
|
pytest-metadata,
|
2023-11-16 04:20:00 +00:00
|
|
|
}:
|
|
|
|
let
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "pytest-html";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "4.1.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
2023-11-16 04:20:00 +00:00
|
|
|
pname = "pytest_html";
|
|
|
|
inherit version;
|
2024-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-cKAeiuWAD0oHS1akyxAlyPT5sDi7pf4x48mOuZZobwc=";
|
2023-11-16 04:20:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
web-assets = buildNpmPackage {
|
|
|
|
pname = "${pname}-web-assets";
|
|
|
|
inherit version src;
|
|
|
|
|
|
|
|
npmDepsHash = "sha256-aRod+SzVSb4bqEJzthfl/mH+DpbIe+j2+dNtrrhO2xU=";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -Dm644 src/pytest_html/resources/{app.js,style.css} -t $out/lib
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2023-11-16 04:20:00 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
buildPythonPackage {
|
|
|
|
inherit pname version src;
|
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
hatch-vcs
|
|
|
|
hatchling
|
|
|
|
];
|
2024-06-05 15:53:02 +00:00
|
|
|
buildInputs = [
|
|
|
|
pytest
|
|
|
|
web-assets
|
|
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
jinja2
|
|
|
|
pytest-metadata
|
|
|
|
];
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
env.HATCH_BUILD_NO_HOOKS = true;
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
install -Dm644 ${web-assets}/lib/{app.js,style.css} -t src/pytest_html/resources
|
|
|
|
'';
|
|
|
|
|
|
|
|
# tests require network access
|
|
|
|
doCheck = false;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "pytest_html" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Plugin for generating HTML reports";
|
|
|
|
homepage = "https://github.com/pytest-dev/pytest-html";
|
|
|
|
license = licenses.mpl20;
|
|
|
|
maintainers = with maintainers; [ mpoquet ];
|
|
|
|
};
|
|
|
|
}
|