2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2023-05-24 13:37:59 +00:00
|
|
|
, cargo
|
2021-05-20 23:08:51 +00:00
|
|
|
, fetchFromGitHub
|
2022-01-26 04:04:25 +00:00
|
|
|
, libiconv
|
|
|
|
, pytestCheckHook
|
2021-05-20 23:08:51 +00:00
|
|
|
, pythonOlder
|
|
|
|
, rustPlatform
|
2023-05-24 13:37:59 +00:00
|
|
|
, rustc
|
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}";
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-tvX4KcQGw0khBjEXVFmkhsVyAkdr2Bgm6IfD1yGZ37c=";
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
|
|
inherit src;
|
|
|
|
name = "${pname}-${version}";
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-KcF3Z71S7ZNZicViqwpClfT736nYYbKcKWylOP+S3HI=";
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = with rustPlatform; [
|
|
|
|
setuptools-rust
|
2023-05-24 13:37:59 +00:00
|
|
|
rustc
|
|
|
|
cargo
|
|
|
|
rustPlatform.cargoSetupHook
|
2021-05-20 23:08:51 +00:00
|
|
|
];
|
|
|
|
|
2022-01-26 04:04:25 +00:00
|
|
|
buildInputs = [
|
|
|
|
libiconv
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"rtoml"
|
|
|
|
];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-01-26 04:04:25 +00:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|