1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6 setuptools,
7 certifi,
8 numpy,
9 sgp4,
10 jplephem,
11 pandas,
12 ipython,
13 matplotlib,
14 assay,
15}:
16
17buildPythonPackage rec {
18 pname = "skyfield";
19 version = "1.53";
20 pyproject = true;
21
22 src = fetchFromGitHub {
23 owner = "skyfielders";
24 repo = "python-skyfield";
25 rev = version;
26 hash = "sha256-CQe+ik6HciOUaRpFp8Cx6cOlOFzeVoMVJrk7+rdcQEo=";
27 };
28
29 # Fix broken tests on "exotic" platforms.
30 # https://github.com/skyfielders/python-skyfield/issues/582#issuecomment-822033858
31 postPatch = ''
32 substituteInPlace skyfield/tests/test_planetarylib.py \
33 --replace-fail "if IS_32_BIT" "if True"
34 '';
35
36 build-system = [ setuptools ];
37
38 dependencies = [
39 certifi
40 numpy
41 sgp4
42 jplephem
43 ];
44
45 nativeCheckInputs = [
46 pandas
47 ipython
48 matplotlib
49 assay
50 ];
51
52 checkPhase = ''
53 runHook preCheck
54
55 cd ci
56 assay --batch skyfield.tests
57
58 runHook postCheck
59 '';
60
61 pythonImportsCheck = [ "skyfield" ];
62
63 meta = with lib; {
64 homepage = "https://github.com/skyfielders/python-skyfield";
65 description = "Elegant astronomy for Python";
66 license = licenses.mit;
67 maintainers = with maintainers; [ zane ];
68 };
69}