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.3.2";
17 pyproject = true;
18
19 src = fetchFromGitHub {
20 owner = "dimastbk";
21 repo = "python-calamine";
22 tag = "v${version}";
23 hash = "sha256-XNTG3Vo//cFvrl3/FXaVmO0PfwCXTauvOwIP0nsjlHg=";
24 };
25
26 cargoDeps = rustPlatform.importCargoLock {
27 lockFile = ./Cargo.lock;
28 outputHashes = {
29 "calamine-0.26.1" = "sha256-qlquNX13PQmzuzl+URo7cFDtNODzwIUQXIK8bqZ2iqc=";
30 };
31 };
32
33 buildInputs = [ libiconv ];
34
35 build-system = [
36 cargo
37 poetry-core
38 rustPlatform.cargoSetupHook
39 rustPlatform.maturinBuildHook
40 rustc
41 ];
42
43 dependencies = [ packaging ];
44
45 nativeCheckInputs = [ pytestCheckHook ];
46
47 pythonImportsCheck = [ "python_calamine" ];
48
49 meta = {
50 description = "Python binding for calamine";
51 homepage = "https://github.com/dimastbk/python-calamine";
52 changelog = "https://github.com/dimastbk/python-calamine/releases/tag/v${version}";
53 license = lib.licenses.mit;
54 maintainers = with lib.maintainers; [ fab ];
55 mainProgram = "python-calamine";
56 };
57}