2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2022-01-26 04:04:25 +00:00
|
|
|
, libiconv
|
|
|
|
, pytestCheckHook
|
2021-05-20 23:08:51 +00:00
|
|
|
, pythonOlder
|
|
|
|
, rustPlatform
|
2022-01-26 04:04:25 +00:00
|
|
|
, setuptools-rust
|
2021-05-20 23:08:51 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "rtoml";
|
2022-10-30 15:09:59 +00:00
|
|
|
version = "0.8";
|
2022-01-26 04:04:25 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "samuelcolvin";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-10-30 15:09:59 +00:00
|
|
|
sha256 = "sha256-tvX4KcQGw0khBjEXVFmkhsVyAkdr2Bgm6IfD1yGZ37c=";
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
|
|
inherit src;
|
|
|
|
name = "${pname}-${version}";
|
2022-10-30 15:09:59 +00:00
|
|
|
sha256 = "sha256-KcF3Z71S7ZNZicViqwpClfT736nYYbKcKWylOP+S3HI=";
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = with rustPlatform; [
|
|
|
|
setuptools-rust
|
|
|
|
rust.rustc
|
|
|
|
rust.cargo
|
|
|
|
cargoSetupHook
|
|
|
|
];
|
|
|
|
|
2022-01-26 04:04:25 +00:00
|
|
|
buildInputs = [
|
|
|
|
libiconv
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"rtoml"
|
|
|
|
];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2022-01-26 04:04:25 +00:00
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
cd tests
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2022-01-26 04:04:25 +00:00
|
|
|
description = "Rust based TOML library for Python";
|
2021-05-20 23:08:51 +00:00
|
|
|
homepage = "https://github.com/samuelcolvin/rtoml";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ evils ];
|
|
|
|
};
|
|
|
|
}
|