1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 isPyPy,
6 pythonAtLeast,
7 pythonOlder,
8
9 # build-system
10 setuptools,
11
12 # tests
13 freezegun,
14 pytestCheckHook,
15 pytz,
16 tzdata,
17}:
18
19buildPythonPackage rec {
20 pname = "babel";
21 version = "2.14.0";
22 pyproject = true;
23
24 disabled = pythonOlder "3.7";
25
26 src = fetchPypi {
27 pname = "Babel";
28 inherit version;
29 hash = "sha256-aRmGfbA2OYuiHrXHoPayirjLw656c6ROvjSudKTn02M=";
30 };
31
32 nativeBuildInputs = [ setuptools ];
33
34 propagatedBuildInputs = lib.optionals (pythonOlder "3.9") [ pytz ];
35
36 # including backports.zoneinfo for python<3.9 yields infinite recursion
37 doCheck = pythonAtLeast "3.9";
38
39 nativeCheckInputs = [
40 freezegun
41 pytestCheckHook
42 # https://github.com/python-babel/babel/issues/988#issuecomment-1521765563
43 pytz
44 ] ++ lib.optionals isPyPy [ tzdata ];
45
46 disabledTests = [
47 # fails on days switching from and to daylight saving time in EST
48 # https://github.com/python-babel/babel/issues/988
49 "test_format_time"
50 ];
51
52 meta = with lib; {
53 homepage = "https://babel.pocoo.org/";
54 changelog = "https://github.com/python-babel/babel/releases/tag/v${version}";
55 description = "Collection of internationalizing tools";
56 mainProgram = "pybabel";
57 license = licenses.bsd3;
58 maintainers = with maintainers; [ ];
59 };
60}