1{ 2 lib, 3 buildPythonPackage, 4 fetchPypi, 5 rustPlatform, 6 pytestCheckHook, 7}: 8 9buildPythonPackage rec { 10 pname = "color-parser-py"; 11 version = "0.1.6"; 12 pyproject = true; 13 14 # PyPI has Cargo.lock 15 src = fetchPypi { 16 pname = "color_parser_py"; 17 inherit version; 18 hash = "sha256-m1qhVAwQNtCwz+DLSAdfKhzkohMLMjvPHxynKhlJfN8="; 19 }; 20 21 cargoDeps = rustPlatform.fetchCargoVendor { 22 inherit pname version src; 23 hash = "sha256-tKXA6sd5gLCJUaqxzFcZ3lePK41Wk2TbLp0HXBacOyo="; 24 }; 25 26 nativeBuildInputs = [ 27 rustPlatform.cargoSetupHook 28 rustPlatform.maturinBuildHook 29 ]; 30 31 nativeCheckInputs = [ pytestCheckHook ]; 32 33 pythonImportsCheck = [ "color_parser_py" ]; 34 35 # Support newer python versions 36 env.PYO3_USE_ABI3_FORWARD_COMPATIBILITY = true; 37 38 meta = { 39 description = "Python bindings for color parsing and conversion"; 40 homepage = "https://github.com/rusiaaman/color-parser-py"; 41 license = lib.licenses.mit; 42 maintainers = with lib.maintainers; [ aleksana ]; 43 }; 44}