1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, cffi
5, h3
6, numba
7, numpy
8, poetry-core
9, pytestCheckHook
10, pythonOlder
11, setuptools
12}:
13
14buildPythonPackage rec {
15 pname = "timezonefinder";
16 version = "6.2.0";
17 format = "pyproject";
18
19 disabled = pythonOlder "3.8";
20
21 src = fetchFromGitHub {
22 owner = "jannikmi";
23 repo = pname;
24 rev = "refs/tags/${version}";
25 hash = "sha256-n6TcTezu5seKy34KDlzGikAVaqAud00gxywwJA3MaWM=";
26 };
27
28 nativeBuildInputs = [
29 cffi
30 poetry-core
31 setuptools
32 ];
33
34 propagatedBuildInputs = [
35 cffi
36 h3
37 numpy
38 ];
39
40 nativeCheckInputs = [
41 numba
42 pytestCheckHook
43 ];
44
45 postPatch = ''
46 substituteInPlace pyproject.toml \
47 --replace 'numpy = "^1.22"' 'numpy = "*"'
48 '';
49
50 pythonImportsCheck = [
51 "timezonefinder"
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/${version}/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 };
66}