summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/color-parser-py/default.nix
blob: 9f4ae2bc0b00b7f48d061f5d93014880f3b70b98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{
  lib,
  buildPythonPackage,
  fetchPypi,
  rustPlatform,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "color-parser-py";
  version = "0.1.6";
  pyproject = true;

  # PyPI has Cargo.lock
  src = fetchPypi {
    pname = "color_parser_py";
    inherit version;
    hash = "sha256-m1qhVAwQNtCwz+DLSAdfKhzkohMLMjvPHxynKhlJfN8=";
  };

  cargoDeps = rustPlatform.fetchCargoVendor {
    inherit pname version src;
    hash = "sha256-tKXA6sd5gLCJUaqxzFcZ3lePK41Wk2TbLp0HXBacOyo=";
  };

  nativeBuildInputs = [
    rustPlatform.cargoSetupHook
    rustPlatform.maturinBuildHook
  ];

  nativeCheckInputs = [ pytestCheckHook ];

  pythonImportsCheck = [ "color_parser_py" ];

  # Support newer python versions
  env.PYO3_USE_ABI3_FORWARD_COMPATIBILITY = true;

  meta = {
    description = "Python bindings for color parsing and conversion";
    homepage = "https://github.com/rusiaaman/color-parser-py";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ aleksana ];
  };
}