From cebf6aa8fd0da7d70630eb4699ba4f7e6348d6fa Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 12 Mar 2023 23:20:20 +0100 Subject: [PATCH] python310Packages.babel: Fix tests, disable tests Some tests required pytz, some tests are just broken two times a year on days when EST is moving from and to daylight saving time. Now with that out of the way, some general goodness towards the package. --- .../python-modules/babel/default.nix | 35 +++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/babel/default.nix b/pkgs/development/python-modules/babel/default.nix index 09fb69a7658e..0704f1693f92 100644 --- a/pkgs/development/python-modules/babel/default.nix +++ b/pkgs/development/python-modules/babel/default.nix @@ -1,8 +1,20 @@ -{ stdenv, lib, buildPythonPackage, fetchPypi, pythonOlder, pytz, pytestCheckHook, freezegun }: +{ lib +, buildPythonPackage +, fetchPypi +, pythonOlder + +# tests +, backports-zoneinfo +, freezegun +, pytestCheckHook +, pytz +}: buildPythonPackage rec { pname = "babel"; version = "2.12.1"; + format = "setuptools"; + disabled = pythonOlder "3.7"; src = fetchPypi { @@ -11,12 +23,29 @@ buildPythonPackage rec { hash = "sha256-zC2ZmZzQHURCCuclohyeNxGzqtx5dtYUf2IthYGWNFU="; }; - propagatedBuildInputs = lib.optional (pythonOlder "3.9") pytz; + propagatedBuildInputs = lib.optionals (pythonOlder "3.9") [ + pytz + ]; - nativeCheckInputs = [ pytestCheckHook freezegun ]; + nativeCheckInputs = [ + # via setup.py + freezegun + pytestCheckHook + # via tox.ini + pytz + ] ++ lib.optionals (pythonOlder "3.9") [ + backports-zoneinfo + ]; + + disabledTests = [ + # fails on days switching from and to daylight saving time in EST + # https://github.com/python-babel/babel/issues/988 + "test_format_time" + ]; meta = with lib; { homepage = "https://babel.pocoo.org/"; + changelog = "https://github.com/python-babel/babel/releases/tag/v${version}"; description = "Collection of internationalizing tools"; license = licenses.bsd3; maintainers = with maintainers; [ SuperSandro2000 ];