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:
@@ -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
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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 { };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user