1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 pythonOlder,
6
7 # build
8 poetry-core,
9
10 # runtime
11 backports-zoneinfo,
12
13 # tests
14 pytestCheckHook,
15 freezegun,
16}:
17
18buildPythonPackage rec {
19 pname = "astral";
20 version = "3.2";
21 format = "pyproject";
22
23 disabled = pythonOlder "3.7";
24
25 src = fetchPypi {
26 inherit pname version;
27 hash = "sha256-m3w7QS6eadFyz7JL4Oat3MnxvQGijbi+vmbXXMxTPYg=";
28 };
29
30 nativeBuildInputs = [ poetry-core ];
31
32 propagatedBuildInputs = lib.optionals (pythonOlder "3.9") [ backports-zoneinfo ];
33
34 nativeCheckInputs = [
35 freezegun
36 pytestCheckHook
37 ];
38
39 meta = with lib; {
40 changelog = "https://github.com/sffjunkie/astral/releases/tag/${version}";
41 description = "Calculations for the position of the sun and the moon";
42 homepage = "https://github.com/sffjunkie/astral/";
43 license = licenses.asl20;
44 maintainers = with maintainers; [ flokli ];
45 };
46}