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.9";
18 pyproject = true;
19
20 disabled = pythonOlder "3.10";
21
22 src = fetchFromGitHub {
23 owner = "jannikmi";
24 repo = "timezonefinder";
25 tag = version;
26 hash = "sha256-LkGDR8nSGfRiBxSXugauGhe3+8RsLRPWU3oE+1c5iCk=";
27 };
28
29 build-system = [
30 poetry-core
31 setuptools
32 ];
33
34 nativeBuildInputs = [ cffi ];
35
36 dependencies = [
37 cffi
38 h3
39 numpy
40 ];
41
42 nativeCheckInputs = [
43 numba
44 pytestCheckHook
45 ];
46
47 pythonImportsCheck = [ "timezonefinder" ];
48
49 postPatch = ''
50 substituteInPlace pyproject.toml \
51 --replace-warn '"poetry-core>=1.0.0,<2.0.0"' '"poetry-core>=1.0.0"'
52 '';
53
54 preCheck = ''
55 # Some tests need the CLI on the PATH
56 export PATH=$out/bin:$PATH
57 '';
58
59 meta = with lib; {
60 changelog = "https://github.com/jannikmi/timezonefinder/blob/${src.tag}/CHANGELOG.rst";
61 description = "Module for finding the timezone of any point on earth (coordinates) offline";
62 homepage = "https://github.com/MrMinimal64/timezonefinder";
63 license = licenses.mit;
64 maintainers = with maintainers; [ fab ];
65 mainProgram = "timezonefinder";
66 };
67}