1{ lib, buildPythonPackage, pythonOlder, fetchFromGitHub, certifi, numpy, sgp4, jplephem 2, pandas, ipython, matplotlib, assay 3}: 4 5buildPythonPackage rec { 6 pname = "skyfield"; 7 version = "1.45"; 8 9 src = fetchFromGitHub { 10 owner = "skyfielders"; 11 repo = "python-skyfield"; 12 rev = version; 13 hash = "sha256-kZrXNVE+JGPGiVsd6CTwOqfciYLsD2A4pTS3FpqO+Dk="; 14 }; 15 16 # Fix broken tests on "exotic" platforms. 17 # https://github.com/skyfielders/python-skyfield/issues/582#issuecomment-822033858 18 postPatch = '' 19 substituteInPlace skyfield/tests/test_planetarylib.py \ 20 --replace "if IS_32_BIT" "if True" 21 ''; 22 23 propagatedBuildInputs = [ certifi numpy sgp4 jplephem ]; 24 25 nativeCheckInputs = [ pandas ipython matplotlib assay ]; 26 27 # assay is broken on Python >= 3.11 28 # https://github.com/brandon-rhodes/assay/issues/15 29 doCheck = pythonOlder "3.11"; 30 31 checkPhase = '' 32 runHook preCheck 33 34 cd ci 35 assay --batch skyfield.tests 36 37 runHook postCheck 38 ''; 39 40 pythonImportsCheck = [ "skyfield" ]; 41 42 meta = with lib; { 43 homepage = "https://github.com/skyfielders/python-skyfield"; 44 description = "Elegant astronomy for Python"; 45 license = licenses.mit; 46 maintainers = with maintainers; [ zane ]; 47 }; 48}