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.
This commit is contained in:
Martin Weinelt 2023-03-12 23:20:20 +01:00
parent b60a1fef4a
commit cebf6aa8fd
No known key found for this signature in database
GPG Key ID: 87C1E9888F856759

View File

@ -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 ];