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 8d7cc9cac9ecdf95f554c5ea7ca15118baa06c39.

Changed files
+14 -2
pkgs
development
python-modules
top-level
+11 -1
pkgs/development/python-modules/pytz/default.nix
···
buildPythonPackage,
fetchPypi,
setuptools,
+
tzdata,
unittestCheckHook,
}:
···
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 ];
···
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
pkgs/top-level/python-packages.nix
···
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 { };