depot/third_party/nixpkgs/pkgs/development/python-modules/rtoml/default.nix
Default email 92b3d6365d Project import generated by Copybara.
GitOrigin-RevId: 412b9917cea092f3d39f9cd5dead4effd5bc4053
2022-10-30 16:09:59 +01:00

59 lines
1 KiB
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, libiconv
, pytestCheckHook
, pythonOlder
, rustPlatform
, setuptools-rust
}:
buildPythonPackage rec {
pname = "rtoml";
version = "0.8";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "samuelcolvin";
repo = pname;
rev = "v${version}";
sha256 = "sha256-tvX4KcQGw0khBjEXVFmkhsVyAkdr2Bgm6IfD1yGZ37c=";
};
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
name = "${pname}-${version}";
sha256 = "sha256-KcF3Z71S7ZNZicViqwpClfT736nYYbKcKWylOP+S3HI=";
};
nativeBuildInputs = with rustPlatform; [
setuptools-rust
rust.rustc
rust.cargo
cargoSetupHook
];
buildInputs = [
libiconv
];
pythonImportsCheck = [
"rtoml"
];
checkInputs = [
pytestCheckHook
];
preCheck = ''
cd tests
'';
meta = with lib; {
description = "Rust based TOML library for Python";
homepage = "https://github.com/samuelcolvin/rtoml";
license = licenses.mit;
maintainers = with maintainers; [ evils ];
};
}