1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 cffi,
6 h3,
7 numba,
8 numpy,
9 poetry-core,
10 pytestCheckHook,
11 pythonOlder,
12 setuptools,
13}:
14
15buildPythonPackage rec {
16 pname = "timezonefinder";
17 version = "6.5.0";
18 pyproject = true;
19
20 disabled = pythonOlder "3.9";
21
22 src = fetchFromGitHub {
23 owner = "jannikmi";
24 repo = "timezonefinder";
25 rev = "refs/tags/${version}";
26 hash = "sha256-V5g1zTdXWeJba71/eUGQbF9XOhMQuzivtGkqGD4OHMY=";
27 };
28
29 nativeBuildInputs = [
30 cffi
31 poetry-core
32 setuptools
33 ];
34
35 propagatedBuildInputs = [
36 cffi
37 h3
38 numpy
39 ];
40
41 nativeCheckInputs = [
42 numba
43 pytestCheckHook
44 ];
45
46 pythonImportsCheck = [ "timezonefinder" ];
47
48 preCheck = ''
49 # Some tests need the CLI on the PATH
50 export PATH=$out/bin:$PATH
51 '';
52
53 meta = with lib; {
54 changelog = "https://github.com/jannikmi/timezonefinder/blob/${version}/CHANGELOG.rst";
55 description = "Module for finding the timezone of any point on earth (coordinates) offline";
56 mainProgram = "timezonefinder";
57 homepage = "https://github.com/MrMinimal64/timezonefinder";
58 license = licenses.mit;
59 maintainers = with maintainers; [ fab ];
60 };
61}