1{
2 lib,
3 buildPythonPackage,
4 cargo,
5 fetchFromGitHub,
6 libiconv,
7 pytestCheckHook,
8 pythonOlder,
9 rustPlatform,
10 rustc,
11 setuptools-rust,
12}:
13
14buildPythonPackage rec {
15 pname = "rtoml";
16 version = "0.8";
17 format = "setuptools";
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchFromGitHub {
22 owner = "samuelcolvin";
23 repo = pname;
24 rev = "v${version}";
25 hash = "sha256-tvX4KcQGw0khBjEXVFmkhsVyAkdr2Bgm6IfD1yGZ37c=";
26 };
27
28 cargoDeps = rustPlatform.fetchCargoTarball {
29 inherit src;
30 name = "${pname}-${version}";
31 hash = "sha256-KcF3Z71S7ZNZicViqwpClfT736nYYbKcKWylOP+S3HI=";
32 };
33
34 nativeBuildInputs = with rustPlatform; [
35 setuptools-rust
36 rustc
37 cargo
38 rustPlatform.cargoSetupHook
39 ];
40
41 buildInputs = [ libiconv ];
42
43 pythonImportsCheck = [ "rtoml" ];
44
45 nativeCheckInputs = [ pytestCheckHook ];
46
47 preCheck = ''
48 cd tests
49 '';
50
51 meta = with lib; {
52 description = "Rust based TOML library for Python";
53 homepage = "https://github.com/samuelcolvin/rtoml";
54 license = licenses.mit;
55 maintainers = with maintainers; [ evils ];
56 };
57}