1{ lib
2, buildPythonPackage
3, fetchPypi
4, pythonAtLeast
5, pythonOlder
6, backports-zoneinfo
7, python-dateutil
8, setuptools
9, tzdata
10, hypothesis
11, pytestCheckHook
12, pytz
13}:
14
15buildPythonPackage rec {
16 pname = "pytz-deprecation-shim";
17 version = "0.1.0.post0";
18
19 format = "pyproject";
20
21 src = fetchPypi {
22 pname = "pytz_deprecation_shim";
23 inherit version;
24 sha256 = "af097bae1b616dde5c5744441e2ddc69e74dfdcb0c263129610d85b87445a59d";
25 };
26
27 nativeBuildInputs = [ setuptools ];
28
29 propagatedBuildInputs = (lib.optionals (pythonAtLeast "3.6" && pythonOlder "3.9") [
30 backports-zoneinfo
31 ]) ++ (lib.optionals (pythonOlder "3.6") [
32 python-dateutil
33 ]) ++ (lib.optionals (pythonAtLeast "3.6") [
34 tzdata
35 ]);
36
37 nativeCheckInputs = [
38 hypothesis
39 pytestCheckHook
40 pytz
41 ];
42
43 # https://github.com/pganssle/pytz-deprecation-shim/issues/27
44 # https://github.com/pganssle/pytz-deprecation-shim/issues/30
45 # The test suite is just very flaky and breaks all the time
46 doCheck = false;
47
48 meta = with lib; {
49 description = "Shims to make deprecation of pytz easier";
50 homepage = "https://github.com/pganssle/pytz-deprecation-shim";
51 license = licenses.asl20;
52 maintainers = with maintainers; [ dotlambda ];
53 };
54}