1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 isPy27,
6 setuptools,
7 regex,
8 csvw,
9 clldutils,
10 pytestCheckHook,
11 pytest-mock,
12}:
13
14buildPythonPackage rec {
15 pname = "segments";
16 version = "2.2.1";
17 pyproject = true;
18 disabled = isPy27;
19
20 src = fetchFromGitHub {
21 owner = "cldf";
22 repo = "segments";
23 rev = "v${version}";
24 sha256 = "sha256-Z9AQnsK/0HUCZDzdpQKNfSBWxfAOjWNBytcfI6yBY84=";
25 };
26
27 patchPhase = ''
28 substituteInPlace setup.cfg \
29 --replace-fail "--cov" ""
30 '';
31
32 nativeBuildInputs = [ setuptools ];
33
34 propagatedBuildInputs = [
35 regex
36 csvw
37 clldutils
38 ];
39
40 nativeCheckInputs = [
41 pytestCheckHook
42 pytest-mock
43 ];
44
45 meta = with lib; {
46 changelog = "https://github.com/cldf/segments/blob/${src.rev}/CHANGES.md";
47 description = "Unicode Standard tokenization routines and orthography profile segmentation";
48 mainProgram = "segments";
49 homepage = "https://github.com/cldf/segments";
50 license = licenses.asl20;
51 maintainers = with maintainers; [ ];
52 };
53}