summaryrefslogtreecommitdiff
path: root/Omni/Bild/Deps/kerykeion.nix
blob: d8872314b65001f40a84fdd535b904f7e6ac0ab9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{
  buildPythonPackage,
  lib,
  poetry-core,
  pytestCheckHook,
  pytz,
  pyswisseph,
  pydantic,
  requests,
  requests-cache,
  scour,
  simple-ascii-tables,
  typing-extensions,
  sources,
  setuptools,
}:
buildPythonPackage rec {
  pname = "kerykeion";
  version = sources.kerykeion.version;
  pyproject = true;

  src = sources.kerykeion;

  nativeBuildInputs = [poetry-core];

  propagatedBuildInputs = [
    pyswisseph
    pydantic
    scour
    requests-cache
    requests
    simple-ascii-tables
    pytz
    typing-extensions
    setuptools
  ];

  preBuild = ''
    cat <<EOF >> pyproject.toml
    [project]
    name = "kerykeion"
    version = "${sources.kerykeion.version}"

    [tool.setuptools.packages.find]
    where = ["."]
    include = ["kerykeion*", "tests"]
    namespaces = false

    [build-system]
    build-backend = "setuptools.build_meta"
    requires = ["setuptools"]
    EOF
  '';

  nativeCheckInputs = [pytestCheckHook];

  pythonImportsCheck = ["kerykeion"];

  # almost all tests perform network requests to api.geonames.org
  enabledTests = [
    "test_ephemeris_data"
    "test_settings"
  ];

  meta = with lib; {
    homepage = "https://www.kerykeion.net/";
    description = "A python library for astrology";
    changelog = "https://github.com/g-battaglia/kerykeion/releases/tag/v${version}";
    license = licenses.agpl3Only;
    maintainers = with maintainers; [bsima];
  };
}