nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, libiconv
5, pytestCheckHook
6, pythonOlder
7, rustPlatform
8, setuptools-rust
9}:
10
11buildPythonPackage rec {
12 pname = "rtoml";
13 version = "0.7";
14
15 disabled = pythonOlder "3.7";
16
17 src = fetchFromGitHub {
18 owner = "samuelcolvin";
19 repo = pname;
20 rev = "v${version}";
21 sha256 = "sha256-h4vY63pDkrMHt2X244FssLxHsphsfjNd6gnVFUeZZTY=";
22 };
23
24 cargoDeps = rustPlatform.fetchCargoTarball {
25 inherit src;
26 name = "${pname}-${version}";
27 sha256 = "05fwcs6w023ihw3gyihzbnfwjaqy40d6h0z2yas4kqkkvz9x4f8j";
28 };
29
30 nativeBuildInputs = with rustPlatform; [
31 setuptools-rust
32 rust.rustc
33 rust.cargo
34 cargoSetupHook
35 ];
36
37 buildInputs = [
38 libiconv
39 ];
40
41 pythonImportsCheck = [
42 "rtoml"
43 ];
44
45 checkInputs = [
46 pytestCheckHook
47 ];
48
49 preCheck = ''
50 cd tests
51 '';
52
53 pytestFlagsArray = [
54 "-W"
55 "ignore::DeprecationWarning"
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}