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