1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pytestCheckHook
5}:
6
7buildPythonPackage rec {
8 pname = "pypinyin";
9 version = "0.47.1";
10
11 src = fetchFromGitHub {
12 owner = "mozillazg";
13 repo = "python-pinyin";
14 rev = "refs/tags/v${version}";
15 sha256 = "sha256-c9pEO9k5tCFWLPismrXrrYEQYmxYKkciXFgpbrDEGzE=";
16 };
17
18 postPatch = ''
19 substituteInPlace pytest.ini --replace \
20 "--cov-report term-missing" ""
21 '';
22
23 checkInputs = [
24 pytestCheckHook
25 ];
26
27 pytestFlagsArray = [
28 "tests"
29 ];
30
31 meta = with lib; {
32 description = "Chinese Characters to Pinyin - 汉字转拼音";
33 homepage = "https://github.com/mozillazg/python-pinyin";
34 changelog = "https://github.com/mozillazg/python-pinyin/blob/master/CHANGELOG.rst";
35 license = licenses.mit;
36 maintainers = teams.tts.members;
37 };
38}