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