python3Packages.pytz: use system tzdata

We update that one more reliably, and it allows system-level
customizations to apply to pytz as well. This is in line with the
zoneinfo stdlib module in Python >=v3.9 which accesses the system
timezone database directly.

This is modeled on how the certifi module uses the system-wide
ca-bundle, see commit 8d7cc9cac9.
This commit is contained in:
Johan Herland
2025-08-09 18:57:49 +02:00
committed by Martin Weinelt
parent 777bf3bb1b
commit cdac967ea9
2 changed files with 14 additions and 2 deletions
@@ -3,6 +3,7 @@
buildPythonPackage,
fetchPypi,
setuptools,
tzdata,
unittestCheckHook,
}:
@@ -16,6 +17,12 @@ buildPythonPackage rec {
hash = "sha256-NguePbtJognCGtYYCcf7RTZD4EiziSTHZYE1RnRugcM=";
};
postPatch = ''
# Use our system-wide zoneinfo dir instead of the bundled one
rm -rf pytz/zoneinfo
ln -snvf ${tzdata}/share/zoneinfo pytz/zoneinfo
'';
build-system = [ setuptools ];
nativeCheckInputs = [ unittestCheckHook ];
@@ -32,6 +39,9 @@ buildPythonPackage rec {
description = "World timezone definitions, modern and historical";
homepage = "https://pythonhosted.org/pytz";
license = licenses.mit;
maintainers = with maintainers; [ dotlambda ];
maintainers = with maintainers; [
dotlambda
jherland
];
};
}
+3 -1
View File
@@ -15008,7 +15008,9 @@ self: super: with self; {
pytweening = callPackage ../development/python-modules/pytweening { };
pytz = callPackage ../development/python-modules/pytz { };
pytz = callPackage ../development/python-modules/pytz {
inherit (pkgs) tzdata;
};
pytz-deprecation-shim = callPackage ../development/python-modules/pytz-deprecation-shim { };