python3Packages.astropy: fix tests by tweaked upstream patch

https://hydra.nixos.org/build/300052658/nixlog/1/tail
This commit is contained in:
Vladimír Čunát
2025-06-15 17:29:45 +02:00
parent fd52a730a9
commit ddd342f476
2 changed files with 37 additions and 1 deletions
@@ -1,7 +1,6 @@
{
lib,
fetchPypi,
fetchpatch,
buildPythonPackage,
pythonOlder,
@@ -63,6 +62,10 @@ buildPythonPackage rec {
hash = "sha256-OS/utEOyQ3zUwuBkGmXg8VunkeFI6bHl7X3n38s45GA=";
};
patches = [
./test_z_at_value_numpyvectorize.patch
];
env = lib.optionalAttrs stdenv.cc.isClang {
NIX_CFLAGS_COMPILE = "-Wno-error=unused-command-line-argument";
};
@@ -0,0 +1,33 @@
From 9a7f821351f0870608b2fa3e1be31bda70707913 Mon Sep 17 00:00:00 2001
From: "P. L. Lim" <2090236+pllim@users.noreply.github.com>
Date: Fri, 2 May 2025 13:49:06 -0400
Subject: [PATCH] TST: xfail test_z_at_value_numpyvectorize for numpy 2.3.dev
and later until we can fix the underlying issue
Originally this is
https://github.com/astropy/astropy/commit/9fce0d46c5e1807d7e1030c3cb0b1a9c0a359dd9
but the path to the file has changed since the release currently in nixpkgs.
---
astropy/cosmology/_src/tests/funcs/test_funcs.py | 4 ++++
1 file changed, 4 insertions(+)
--- a/astropy/cosmology/funcs/tests/test_funcs.py
+++ b/astropy/cosmology/funcs/tests/test_funcs.py
@@ -31,6 +31,7 @@
)
from astropy.cosmology._src.funcs.optimize import _z_at_scalar_value
from astropy.units import allclose
+from astropy.utils.compat import NUMPY_LT_2_3
from astropy.utils.compat.optional_deps import HAS_SCIPY
from astropy.utils.exceptions import AstropyUserWarning
@@ -173,6 +174,9 @@ def test_scalar_input_to_output(self):
@pytest.mark.skipif(not HAS_SCIPY, reason="test requires scipy")
+@pytest.mark.xfail(
+ not NUMPY_LT_2_3, reason="TODO fix: https://github.com/astropy/astropy/issues/18045"
+)
def test_z_at_value_numpyvectorize():
"""Test that numpy vectorize fails on Quantities.