1{ lib
2, stdenv
3, buildPythonPackage
4, pythonOlder
5, fetchPypi
6, pytz-deprecation-shim
7, pytest-mock
8, pytestCheckHook
9}:
10
11buildPythonPackage rec {
12 pname = "tzlocal";
13 version = "4.2"; # version needs to be compatible with APScheduler
14
15 disabled = pythonOlder "3.6";
16
17 src = fetchPypi {
18 inherit pname version;
19 sha256 = "ee5842fa3a795f023514ac2d801c4a81d1743bbe642e3940143326b3a00addd7";
20 };
21
22 propagatedBuildInputs = [
23 pytz-deprecation-shim
24 ];
25
26 checkInputs = [
27 pytest-mock
28 pytestCheckHook
29 ];
30
31 disabledTests = [
32 "test_conflicting"
33 "test_noconflict"
34 "test_symlink_localtime"
35 ] ++ lib.optional stdenv.isDarwin "test_assert_tz_offset";
36
37 pythonImportsCheck = [ "tzlocal" ];
38
39 meta = with lib; {
40 description = "Tzinfo object for the local timezone";
41 homepage = "https://github.com/regebro/tzlocal";
42 changelog = "https://github.com/regebro/tzlocal/blob/${version}/CHANGES.txt";
43 license = licenses.cddl;
44 maintainers = with maintainers; [ dotlambda ];
45 };
46}