1{
2 lib,
3 buildPythonPackage,
4 cargo,
5 fetchFromGitHub,
6 libiconv,
7 packaging,
8 poetry-core,
9 pytestCheckHook,
10 rustc,
11 rustPlatform,
12}:
13
14buildPythonPackage rec {
15 pname = "python-calamine";
16 version = "0.4.0";
17 pyproject = true;
18
19 src = fetchFromGitHub {
20 owner = "dimastbk";
21 repo = "python-calamine";
22 tag = "v${version}";
23 hash = "sha256-qbme5P/oo7djoKbGFd+mVz6p4sHl1zejQI9wOarHzMA=";
24 };
25
26 cargoDeps = rustPlatform.fetchCargoVendor {
27 inherit pname version src;
28 hash = "sha256-8X6TDCxeDLHObJ+q/bEYTonHe0bgXMnBrIz3rKalfyk=";
29 };
30
31 buildInputs = [ libiconv ];
32
33 build-system = [
34 cargo
35 poetry-core
36 rustPlatform.cargoSetupHook
37 rustPlatform.maturinBuildHook
38 rustc
39 ];
40
41 dependencies = [ packaging ];
42
43 nativeCheckInputs = [ pytestCheckHook ];
44
45 pythonImportsCheck = [ "python_calamine" ];
46
47 meta = {
48 description = "Python binding for calamine";
49 homepage = "https://github.com/dimastbk/python-calamine";
50 changelog = "https://github.com/dimastbk/python-calamine/releases/tag/v${version}";
51 license = lib.licenses.mit;
52 maintainers = with lib.maintainers; [ fab ];
53 mainProgram = "python-calamine";
54 };
55}