nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4
5 # build-system
6 flit-core,
7
8 # dependencies
9 django,
10 polib,
11 typing-extensions,
12 wagtail,
13 wagtail-modeladmin,
14
15 # optional-dependencies
16 google-cloud-translate,
17
18 # tests
19 dj-database-url,
20 django-rq,
21 fetchFromGitHub,
22 freezegun,
23 python,
24}:
25
26buildPythonPackage rec {
27 pname = "wagtail-localize";
28 version = "1.13";
29 pyproject = true;
30
31 src = fetchFromGitHub {
32 repo = "wagtail-localize";
33 owner = "wagtail";
34 tag = "v${version}";
35 hash = "sha256-JhLfrK4CBdTR85JuAjf9vGByQVgCIYT3IrM6AYxxNTE=";
36 };
37
38 build-system = [ flit-core ];
39
40 dependencies = [
41 django
42 polib
43 typing-extensions
44 wagtail
45 wagtail-modeladmin
46 ];
47
48 optional-dependencies = {
49 google = [ google-cloud-translate ];
50 };
51
52 nativeCheckInputs = [
53 dj-database-url
54 django-rq
55 freezegun
56 google-cloud-translate
57 ];
58
59 checkPhase = ''
60 runHook preCheck
61
62 # test_translate_html fails with later Beautifulsoup releases
63 rm wagtail_localize/machine_translators/tests/test_dummy_translator.py
64
65 ${python.interpreter} testmanage.py test
66
67 runHook postCheck
68 '';
69
70 meta = {
71 description = "Translation plugin for Wagtail CMS";
72 homepage = "https://github.com/wagtail/wagtail-localize";
73 changelog = "https://github.com/wagtail/wagtail-localize/blob/${src.tag}/CHANGELOG.md";
74 license = lib.licenses.bsd3;
75 maintainers = with lib.maintainers; [ sephi ];
76 };
77}