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 = "rtoml";
23 rev = "v${version}";
24 hash = "sha256-1movtKMQkQ6PEpKpSkK0Oy4AV0ee7XrS0P9m6QwZTaM=";
25 };
26
27 cargoDeps = rustPlatform.fetchCargoVendor {
28 inherit pname version src;
29 hash = "sha256-/elui0Rf3XwvD2jX+NGoJgf9S3XSp16qzdwkGZbKaZg=";
30 };
31
32 build-system = with rustPlatform; [
33 cargoSetupHook
34 maturinBuildHook
35 ];
36
37 buildInputs = [ libiconv ];
38
39 pythonImportsCheck = [ "rtoml" ];
40
41 nativeCheckInputs = [
42 dirty-equals
43 pytest-benchmark
44 pytestCheckHook
45 ];
46
47 pytestFlags = [ "--benchmark-disable" ];
48
49 disabledTests = [
50 # TypeError: loads() got an unexpected keyword argument 'name'
51 "test_load_data_toml"
52 ];
53
54 preCheck = ''
55 rm -rf rtoml
56 '';
57
58 meta = with lib; {
59 description = "Rust based TOML library for Python";
60 homepage = "https://github.com/samuelcolvin/rtoml";
61 license = licenses.mit;
62 maintainers = with maintainers; [ evils ];
63 };
64}