Bug 2264227 - rpy fails to build with Python 3.13: test_setitem, test_vector_navalue, test_iter_labels fail
Summary: rpy fails to build with Python 3.13: test_setitem, test_vector_navalue, test_...
Keywords:
Status: ASSIGNED
Alias: None
Product: Fedora
Classification: Fedora
Component: rpy
Version: 42
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: José Matos
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.13
TreeView+ depends on / blocked
 
Reported: 2024-02-14 17:13 UTC by Karolina Surma
Modified: 2025-02-26 12:58 UTC (History)
5 users (show)

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


Attachments (Terms of Use)

Description Karolina Surma 2024-02-14 17:13:44 UTC
rpy fails to build with Python 3.13.0a3.

=================================== FAILURES ===================================
_____________________________ test_setitem[value1] _____________________________

value = NA_character_

    @pytest.mark.parametrize('value',
                             ('boo', ri.NA_Character))
    def test_setitem(value):
        vec = ri.StrSexpVector(['foo', 'bar', 'baz'])
        vec[1] = value
>       assert vec[1] == value
E       assert NA_character_ == NA_character_

rpy2/tests/rinterface/test_vector_str.py:33: AssertionError
_________________ test_vector_navalue[StrVector-expected_na0] __________________

cls = <class 'rpy2.robjects.vectors.StrVector'>, expected_na = NA_character_

    @pytest.mark.parametrize(
        'cls,expected_na',
        [(robjects.StrVector, ri.NA_Character),
         (robjects.IntVector, ri.NA_Integer),
         (robjects.FloatVector, ri.NA_Real),
         (robjects.BoolVector, ri.NA_Logical),
         (robjects.ComplexVector, ri.NA_Complex),
        ])
    def test_vector_navalue(cls, expected_na):
>       assert cls.NAvalue is expected_na
E       AssertionError: assert NA_character_ is NA_character_
E        +  where NA_character_ = <class 'rpy2.robjects.vectors.StrVector'>.NAvalue

rpy2/tests/robjects/test_vector.py:38: AssertionError
___________________ test_iter_labels[values1-check_values1] ____________________

values = ('abc', None, 'efg'), check_values = ('abc', NA_character_, 'efg')

    @pytest.mark.parametrize(
        'values,check_values',
        (('abaac', 'abaac'),
         (('abc', None, 'efg'), ('abc', NA_Character, 'efg'))))
    def test_iter_labels(values, check_values):
        vec = robjects.FactorVector(robjects.StrVector(values))
        it = vec.iter_labels()
        for a, b in zip(check_values, it):
>           assert a == b
E           assert NA_character_ == NA_character_

rpy2/tests/robjects/test_vector_factor.py:47: AssertionError

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

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/07016135-rpy/

For all our attempts to build rpy with Python 3.13, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/rpy/

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.13:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/

Let us know here if you have any questions.

Python 3.13 is planned to be included in Fedora 41.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.13.
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.

Comment 1 José Matos 2024-02-16 15:10:05 UTC
This only fails because I have reinstated the tests in the last build.
The lesson is learned for the next time. :-D

Just joking, just joking... :-)

The errors seem to be the symptom because some of tests fail because NaN does not compare with NaN. Since this is well known I suspect that the problem is elsewhere.
I will report this upstream. :-)

Comment 2 José Matos 2024-02-16 15:42:57 UTC
In addition to the information above NA_character_ is used to compare with R's NaN value.

I reported this issue here:
https://github.com/rpy2/rpy2/issues/1091

Comment 3 Aoife Moloney 2025-02-26 12:58:11 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 42 development cycle.
Changing version to 42.


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