2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
fetchPypi,
|
|
|
|
buildPythonPackage,
|
|
|
|
pythonOlder,
|
2022-02-10 20:34:41 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# build time
|
|
|
|
astropy-extension-helpers,
|
|
|
|
cython,
|
|
|
|
jinja2,
|
|
|
|
oldest-supported-numpy,
|
|
|
|
setuptools-scm,
|
|
|
|
wheel,
|
|
|
|
# testing
|
|
|
|
pytestCheckHook,
|
|
|
|
stdenv,
|
|
|
|
pytest-xdist,
|
|
|
|
pytest-astropy,
|
2022-02-10 20:34:41 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# runtime
|
|
|
|
astropy-iers-data,
|
|
|
|
numpy,
|
|
|
|
packaging,
|
|
|
|
pyerfa,
|
|
|
|
pyyaml,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
buildPythonPackage rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "astropy";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "6.0.1";
|
2024-01-13 08:15:51 +00:00
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
disabled = pythonOlder "3.8"; # according to setup.cfg
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-ial13jVtBgjnTx9JNEL7Osu7eoW3OeB0RguwNAAUs5w=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2022-02-10 20:34:41 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
astropy-extension-helpers
|
2024-04-21 15:54:59 +00:00
|
|
|
cython
|
2022-02-10 20:34:41 +00:00
|
|
|
jinja2
|
2023-08-22 20:05:09 +00:00
|
|
|
oldest-supported-numpy
|
2022-02-10 20:34:41 +00:00
|
|
|
setuptools-scm
|
2023-08-22 20:05:09 +00:00
|
|
|
wheel
|
2022-02-10 20:34:41 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2024-01-13 08:15:51 +00:00
|
|
|
astropy-iers-data
|
2022-02-10 20:34:41 +00:00
|
|
|
numpy
|
|
|
|
packaging
|
|
|
|
pyerfa
|
|
|
|
pyyaml
|
|
|
|
];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
pytest-xdist
|
|
|
|
pytest-astropy
|
|
|
|
];
|
|
|
|
|
|
|
|
# Not running it inside the build directory. See:
|
|
|
|
# https://github.com/astropy/astropy/issues/15316#issuecomment-1722190547
|
|
|
|
preCheck = ''
|
|
|
|
cd "$out"
|
|
|
|
export HOME="$(mktemp -d)"
|
|
|
|
export OMP_NUM_THREADS=$(( $NIX_BUILD_CORES / 4 ))
|
|
|
|
'';
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "astropy" ];
|
2023-10-09 19:29:22 +00:00
|
|
|
disabledTests = [
|
|
|
|
# May fail due to parallelism, see:
|
|
|
|
# https://github.com/astropy/astropy/issues/15441
|
|
|
|
"TestUnifiedOutputRegistry"
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
# fail due to pytest>=8
|
|
|
|
# https://github.com/astropy/astropy/issues/15960#issuecomment-1913654471
|
|
|
|
"test_distortion_header"
|
|
|
|
|
|
|
|
# flaky
|
|
|
|
"test_timedelta_conversion"
|
|
|
|
# More flaky tests, see: https://github.com/NixOS/nixpkgs/issues/294392
|
|
|
|
"test_sidereal_lon_independent"
|
|
|
|
"test_timedelta_full_precision_arithmetic"
|
|
|
|
"test_datetime_to_timedelta"
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [ "test_sidereal_lat_independent" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
meta = {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Astronomy/Astrophysics library for Python";
|
|
|
|
homepage = "https://www.astropy.org";
|
2023-10-09 19:29:22 +00:00
|
|
|
license = lib.licenses.bsd3;
|
|
|
|
platforms = lib.platforms.all;
|
2024-06-05 15:53:02 +00:00
|
|
|
maintainers = with lib.maintainers; [
|
|
|
|
kentjames
|
|
|
|
doronbehar
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|