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