1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 poetry-core,
6 requests,
7 websocket-client,
8}:
9
10buildPythonPackage rec {
11 pname = "html2image";
12 version = "2.0.4.3";
13 pyproject = true;
14
15 src = fetchFromGitHub {
16 owner = "vgalin";
17 repo = "html2image";
18 rev = version;
19 hash = "sha256-BDl2Kibp1WOAOYNlXa2aaEgQTitk+OZu72OgytciZYI=";
20 };
21
22 postPatch = ''
23 substituteInPlace pyproject.toml \
24 --replace poetry.masonry.api poetry.core.masonry.api \
25 --replace "poetry>=" "poetry-core>="
26 '';
27
28 nativeBuildInputs = [ poetry-core ];
29
30 propagatedBuildInputs = [
31 requests
32 websocket-client
33 ];
34
35 pythonImportsCheck = [ "html2image" ];
36
37 meta = with lib; {
38 description = "Package acting as a wrapper around the headless mode of existing web browsers to generate images from URLs and from HTML+CSS strings or files";
39 homepage = "https://github.com/vgalin/html2image";
40 changelog = "https://github.com/vgalin/html2image/releases/tag/${version}";
41 license = licenses.mit;
42 maintainers = with maintainers; [ happysalada ];
43 };
44}