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