2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, fetchPypi
|
|
|
|
, buildPythonPackage
|
2022-02-10 20:34:41 +00:00
|
|
|
, pythonOlder
|
|
|
|
|
|
|
|
# build time
|
|
|
|
, astropy-extension-helpers
|
2024-01-13 08:15:51 +00:00
|
|
|
, cython_3
|
2020-11-24 20:58:05 +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
|
2023-10-09 19:29:22 +00:00
|
|
|
# testing
|
|
|
|
, pytestCheckHook
|
|
|
|
, pytest-xdist
|
|
|
|
, pytest-astropy
|
2022-02-10 20:34:41 +00:00
|
|
|
|
|
|
|
# runtime
|
2024-01-13 08:15:51 +00:00
|
|
|
, astropy-iers-data
|
2020-04-24 23:36:52 +00:00
|
|
|
, numpy
|
2022-02-10 20:34:41 +00:00
|
|
|
, packaging
|
2021-01-05 17:05:55 +00:00
|
|
|
, pyerfa
|
2022-02-10 20:34:41 +00:00
|
|
|
, 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-01-13 08:15:51 +00:00
|
|
|
version = "6.0.0";
|
|
|
|
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-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-A82AGlUwXaUjzY14DXY1n1clXc3Fn+C91x/VFU/Hd9k=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2022-02-10 20:34:41 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
astropy-extension-helpers
|
2024-01-13 08:15:51 +00:00
|
|
|
cython_3
|
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 ))
|
|
|
|
'';
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"astropy"
|
|
|
|
];
|
|
|
|
disabledTests = [
|
|
|
|
# May fail due to parallelism, see:
|
|
|
|
# https://github.com/astropy/astropy/issues/15441
|
|
|
|
"TestUnifiedOutputRegistry"
|
|
|
|
];
|
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;
|
|
|
|
maintainers = with lib.maintainers; [ kentjames doronbehar ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|