Bug 2345524 - python-astropy fails to build with Python 3.14: test_info_preserved_pickle_copy_init[arrayswap]: AssertionError: assert dtype('>i4') == dtype('int32')
Summary: python-astropy fails to build with Python 3.14: test_info_preserved_pickle_co...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: python-astropy
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Sergio Pascual
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.14
TreeView+ depends on / blocked
 
Reported: 2025-02-13 11:34 UTC by Karolina Surma
Modified: 2025-02-13 11:34 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2025-02-13 11:34:37 UTC
python-astropy fails to build with Python 3.14.05.

_______________ test_info_preserved_pickle_copy_init[arrayswap] ________________

mixin_cols = OrderedDict({'i': <Column name='i' dtype='int64' format='{0}' description='d' length=4>
0
1
2
3, 'a': <Column name='a'... length=4>
a
b
b
c, 'b': <Column name='b' dtype='str1' length=4>
b
c
a
d, 'm': <ArrayWrapper name='m' data=[0 1 2 3]>})

    def test_info_preserved_pickle_copy_init(mixin_cols):
        """
        Test copy, pickle, and init from class roundtrip preserve info.  This
        tests not only the mixin classes but a regular column as well.
        """
    
        def pickle_roundtrip(c):
            return pickle.loads(pickle.dumps(c))
    
        def init_from_class(c):
            return c.__class__(c)
    
        attrs = ("name", "unit", "dtype", "format", "description", "meta")
        for colname in ("i", "m"):
            m = mixin_cols[colname]
            m.info.name = colname
            m.info.format = "{0}"
            m.info.description = "d"
            m.info.meta = {"a": 1}
            for func in (copy.copy, copy.deepcopy, pickle_roundtrip, init_from_class):
                m2 = func(m)
                for attr in attrs:
                    # non-native byteorder not preserved by last 2 func, _except_ for structured dtype
                    if (
                        attr != "dtype"
                        or getattr(m.info.dtype, "isnative", True)
                        or m.info.dtype.name.startswith("void")
                        or func in (copy.copy, copy.deepcopy)
                    ):
                        original = getattr(m.info, attr)
                    else:
                        # func does not preserve byteorder, check against (native) type.
                        original = m.info.dtype.newbyteorder("=")
>                   assert getattr(m2.info, attr) == original
E                   AssertionError: assert dtype('>i4') == dtype('int32')
E                    +  where dtype('>i4') = getattr(name = m\ndtype = int32\nformat = {0}\ndescription = d\nclass = ArrayWrapper\nn_bad = 0\nlength = 4\n, 'dtype')
E                    +    where name = m\ndtype = int32\nformat = {0}\ndescription = d\nclass = ArrayWrapper\nn_bad = 0\nlength = 4\n = <ArrayWrapper name='m' data=[0 1 2 3]>.info

../../../BUILDROOT/usr/lib64/python3.14/site-packages/astropy/table/tests/test_mixin.py:527: AssertionError
=========================== short test summary info ============================
FAILED ../../table/tests/test_mixin.py::test_info_preserved_pickle_copy_init[arrayswap] - AssertionError: assert dtype('>i4') == dtype('int32')

https://docs.python.org/3.14/whatsnew/3.14.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.14/fedora-rawhide-x86_64/08650934-python-astropy/

For all our attempts to build python-astropy with Python 3.14, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/package/python-astropy/

Testing and mass rebuild of packages is happening in copr.
You can follow these instructions to test locally in mock if your package builds with Python 3.14:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/

Let us know here if you have any questions.

Python 3.14 is planned to be included in Fedora 43.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.14.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires),
so if this package is required a lot, it's important for us to get it fixed soon.

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.


Note You need to log in before you can comment on or make changes to this bug.