Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / css-inline / default.nix
blob9eb36c8bd61bd0f05034ecc46c5d6b2d522b189d
1 { lib
2 , stdenv
3 , buildPythonPackage
4 , fetchFromGitHub
6 # build-system
7 , rustPlatform
9 # native darwin dependencies
10 , libiconv
11 , Security
13 # tests
14 , pytestCheckHook
15 , hypothesis
18 buildPythonPackage rec {
19   pname = "css-inline";
20   version = "0.10.1";
21   format = "pyproject";
23   src = fetchFromGitHub {
24     owner = "Stranger6667";
25     repo = "css-inline";
26     rev = "python-v${version}";
27     hash = "sha256-oBAJv/hAz/itT2WakIw/1X1NvOHX108NoeS6V7k+aG8=";
28   };
30   postPatch = ''
31     cd bindings/python
32     ln -s ${./Cargo.lock} Cargo.lock
33   '';
35   # call `cargo build --release` in bindings/python and copy the
36   # resulting lock file
37   cargoDeps = rustPlatform.fetchCargoTarball {
38     inherit src;
39     postPatch = ''
40       cd bindings/python
41       ln -s ${./Cargo.lock} Cargo.lock
42     '';
43     name = "${pname}-${version}";
44     hash = "sha256-SFG1nsP4+I0zH8VeyL1eeaTx0tHNIvmx6M0cko0pqIA=";
45   };
47   nativeBuildInputs = [
48     rustPlatform.cargoSetupHook
49     rustPlatform.maturinBuildHook
50   ];
52   buildInputs = lib.optionals stdenv.isDarwin [
53     libiconv
54     Security
55   ];
57   pythonImportsCheck = [
58     "css_inline"
59   ];
61   nativeCheckInputs = [
62     hypothesis
63     pytestCheckHook
64   ];
66   meta = with lib; {
67     description = "Inline CSS into style attributes";
68     homepage = "https://github.com/Stranger6667/css-inline";
69     changelog = "https://github.com/Stranger6667/css-inline/blob/${src.rev}/CHANGELOG.md";
70     license = licenses.mit;
71     maintainers = with maintainers; [ hexa ];
72   };