1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 libiconv,
6 dirty-equals,
7 pytest-benchmark,
8 pytestCheckHook,
9 pythonOlder,
10 rustPlatform,
11}:
12
13buildPythonPackage rec {
14 pname = "rtoml";
15 version = "0.10";
16 pyproject = true;
17
18 disabled = pythonOlder "3.7";
19
20 src = fetchFromGitHub {
21 owner = "samuelcolvin";
22 repo = pname;
23 rev = "v${version}";
24 hash = "sha256-1movtKMQkQ6PEpKpSkK0Oy4AV0ee7XrS0P9m6QwZTaM=";
25 };
26
27 cargoDeps = rustPlatform.fetchCargoTarball {
28 inherit src;
29 name = "${pname}-${version}";
30 hash = "sha256-BWcOIZMl4yHxxKxCn6Qh69MlMdz3REp3izN0A1eFX3o=";
31 };
32
33 build-system = with rustPlatform; [
34 cargoSetupHook
35 maturinBuildHook
36 ];
37
38 buildInputs = [ libiconv ];
39
40 pythonImportsCheck = [ "rtoml" ];
41
42 nativeCheckInputs = [
43 dirty-equals
44 pytest-benchmark
45 pytestCheckHook
46 ];
47
48 pytestFlagsArray = [ "--benchmark-disable" ];
49
50 disabledTests = [
51 # TypeError: loads() got an unexpected keyword argument 'name'
52 "test_load_data_toml"
53 ];
54
55 preCheck = ''
56 rm -rf rtoml
57 '';
58
59 meta = with lib; {
60 description = "Rust based TOML library for Python";
61 homepage = "https://github.com/samuelcolvin/rtoml";
62 license = licenses.mit;
63 maintainers = with maintainers; [ evils ];
64 };
65}