nixpkgs/pkgs/development/python-modules/pypinyin/default.nix
stuebinm ff1a94e523 treewide: add meta.mainProgram to packages with a single binary
The nixpkgs-unstable channel's programs.sqlite was used to identify
packages producing exactly one binary, and these automatically added
to their package definitions wherever possible.
2024-03-19 03:14:51 +01:00

44 lines
937 B
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, pytestCheckHook
, pythonOlder
}:
buildPythonPackage rec {
pname = "pypinyin";
version = "0.51.0";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "mozillazg";
repo = "python-pinyin";
rev = "refs/tags/v${version}";
hash = "sha256-kbUVif3a3L7BHj1b37FME5wicalK/iild0pvwPawr6Q=";
};
postPatch = ''
substituteInPlace pytest.ini --replace \
"--cov-report term-missing" ""
'';
nativeCheckInputs = [
pytestCheckHook
];
pytestFlagsArray = [
"tests"
];
meta = with lib; {
description = "Chinese Characters to Pinyin - ";
mainProgram = "pypinyin";
homepage = "https://github.com/mozillazg/python-pinyin";
changelog = "https://github.com/mozillazg/python-pinyin/blob/v${version}/CHANGELOG.rst";
license = licenses.mit;
maintainers = teams.tts.members;
};
}