Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / css-inline / default.nix
blob41caa34dedacfc787fd4a480cb824c340c129de4
1 { lib
2 , stdenv
3 , buildPythonPackage
4 , fetchFromGitHub
6 # build-system
7 , rustPlatform
9 # native darwin dependencies
10 , libiconv
11 , Security
12 , SystemConfiguration
14 # tests
15 , pytestCheckHook
16 , hypothesis
19 buildPythonPackage rec {
20   pname = "css-inline";
21   version = "0.13.0";
22   pyproject = true;
24   src = fetchFromGitHub {
25     owner = "Stranger6667";
26     repo = "css-inline";
27     rev = "python-v${version}";
28     hash = "sha256-hhjeOr7EJc4Tmn/eQ1vF0xChSIlgfSmtqi6s7WCUq00=";
29   };
31   postPatch = ''
32     cd bindings/python
33     ln -s ${./Cargo.lock} Cargo.lock
34   '';
36   # call `cargo build --release` in bindings/python and copy the
37   # resulting lock file
38   cargoDeps = rustPlatform.fetchCargoTarball {
39     inherit src;
40     postPatch = ''
41       cd bindings/python
42       ln -s ${./Cargo.lock} Cargo.lock
43     '';
44     name = "${pname}-${version}";
45     hash = "sha256-noYBSwCfdpuwb55toyx4K/16Z4A0NWjnMuzwTi5g8AU=";
46   };
48   nativeBuildInputs = [
49     rustPlatform.cargoSetupHook
50     rustPlatform.maturinBuildHook
51   ];
53   buildInputs = lib.optionals stdenv.isDarwin [
54     libiconv
55     Security
56     SystemConfiguration
57   ];
59   pythonImportsCheck = [
60     "css_inline"
61   ];
63   nativeCheckInputs = [
64     hypothesis
65     pytestCheckHook
66   ];
68   disabledTests = [
69     # fails to connect to local server
70     "test_remote_stylesheet"
71   ] ++ lib.optionals (stdenv.isDarwin) [
72     # pyo3_runtime.PanicException: event loop thread panicked
73     "test_invalid_href"
74   ];
76   meta = with lib; {
77     description = "Inline CSS into style attributes";
78     homepage = "https://github.com/Stranger6667/css-inline";
79     changelog = "https://github.com/Stranger6667/css-inline/blob/${src.rev}/CHANGELOG.md";
80     license = licenses.mit;
81     maintainers = with maintainers; [ hexa ];
82   };