diff --git a/pkgs/development/python-modules/astropy/default.nix b/pkgs/development/python-modules/astropy/default.nix index 4f5586f9aa21..14a80754198b 100644 --- a/pkgs/development/python-modules/astropy/default.nix +++ b/pkgs/development/python-modules/astropy/default.nix @@ -1,6 +1,7 @@ { lib, fetchPypi, + fetchpatch, buildPythonPackage, pythonOlder, @@ -61,6 +62,12 @@ buildPythonPackage rec { inherit pname version; hash = "sha256-6S18n+6G6z34cU5d1Bu/nxY9ND4aGD2Vv2vQnkMTyUA="; }; + patches = [ + (fetchpatch { + url = "https://github.com/astropy/astropy/commit/13b89edc9acd6d5f12eea75983084c57cb458130.patch"; + hash = "sha256-2MgmW4kKBrZnTE1cjYYLOH5hStv5Q6tv4gN4sPSLBpM="; + }) + ]; env = lib.optionalAttrs stdenv.cc.isClang { NIX_CFLAGS_COMPILE = "-Wno-error=unused-command-line-argument"; @@ -132,35 +139,21 @@ buildPythonPackage rec { __darwinAllowLocalNetworking = true; - # 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 )) + # See https://github.com/astropy/astropy/issues/17649 and see + # --hypothesis-profile=ci pytest flag below. + cp conftest.py $out/ + # https://github.com/NixOS/nixpkgs/issues/255262 + cd "$out" + ''; + pytestFlagsArray = [ + "--hypothesis-profile=ci" + ]; + postCheck = '' + rm conftest.py ''; - - disabledTests = [ - # tests for all availability of all optional deps - "test_basic_testing_completeness" - "test_all_included" - - # May fail due to parallelism, see: - # https://github.com/astropy/astropy/issues/15441 - "TestUnifiedOutputRegistry" - - # 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" - - "test_datetime_difference_agrees_with_timedelta_no_hypothesis" - - # SAMPProxyError 1: 'Timeout expired!' - "TestStandardProfile.test_main" - ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_sidereal_lat_independent" ]; meta = { description = "Astronomy/Astrophysics library for Python";