nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 setuptools-scm,
8
9 # dependencies
10 unicode-segmentation-rs,
11 urllib3,
12 tomlkit,
13 lxml,
14
15 # tests
16 aeidon,
17 charset-normalizer,
18 cheroot,
19 fluent-syntax,
20 gettext,
21 iniparse,
22 mistletoe,
23 phply,
24 pyparsing,
25 pytestCheckHook,
26 ruamel-yaml,
27 syrupy,
28 vobject,
29}:
30
31buildPythonPackage rec {
32 pname = "translate-toolkit";
33 version = "3.18.1";
34
35 pyproject = true;
36
37 src = fetchFromGitHub {
38 owner = "translate";
39 repo = "translate";
40 tag = version;
41 hash = "sha256-T7Zo2/jx9P+Tz8jwRKRCV1lVv7XIaIoQTIjIVdEj/ZQ=";
42 };
43
44 build-system = [ setuptools-scm ];
45
46 dependencies = [
47 unicode-segmentation-rs
48 urllib3
49 lxml
50 ];
51
52 optional-dependencies = {
53 toml = [ tomlkit ];
54 };
55
56 nativeCheckInputs = [
57 aeidon
58 charset-normalizer
59 cheroot
60 fluent-syntax
61 gettext
62 iniparse
63 mistletoe
64 phply
65 pyparsing
66 pytestCheckHook
67 ruamel-yaml
68 syrupy
69 tomlkit
70 vobject
71 ];
72
73 disabledTests = [
74 # Probably breaks because of nix sandbox
75 "test_timezones"
76
77 # Requires network
78 "test_xliff_conformance"
79 ];
80
81 pythonImportsCheck = [ "translate" ];
82
83 __darwinAllowLocalNetworking = true;
84
85 meta = {
86 description = "Useful localization tools for building localization & translation systems";
87 homepage = "https://toolkit.translatehouse.org/";
88 changelog = "https://docs.translatehouse.org/projects/translate-toolkit/en/latest/releases/${src.tag}.html";
89 license = lib.licenses.gpl2Plus;
90 maintainers = with lib.maintainers; [ erictapen ];
91 };
92}