Visitar URL original
Update Python libraries and tests from Python 3.13 · Issue #5529 · RustPython/RustPython · GitHub
Skip to content

Update Python libraries and tests from Python 3.13 #5529

Description

@youknowone

Though it will be sometimes blocked by rust side issues, don't worry!
Please just create PR about the broken test and and create issues related to the new bugs.

If you are new to updating cpython libraries, this guide will be useful:
https://github.com/RustPython/RustPython/wiki/How-to-update-test-files

When updating module Lib/X, please don't forget to also update Lib/test/test_X

A few libraries doesn't need to be updated because CPython also kept it same as previous version. In that case, please leave a comment to let us mark it as done. Thank you!

Tips

  • To get specific version of CPython source code, e.g. try git checkout v3.13.1 from CPython repository.
  • Please check Update libraries and tests from CPython 3.10.6 #4064 for example. Not the entire changes but the each commits. One of the middle size example is 17e12de . Sometimes it can be really simple like 9571a68
  • Please create one PR for one library+test pair whenever possible. Once you stuck by dependencies, go to one of the dependency first and finish it before restarting the stuck one unless they become simpler to be updated at the same time. Normally adding more libraries make passing tests (a lot) harder.
  • To run tests, try cargo run --features ssl -- -m test -v <test_name>. e.g. If you changed test_unicode.py, cargo run --features ssl -- -m test -v test_unicode
    • If it runs too slow, try to add --release like cargo run --release --features ssl -- -m test -v test_unicode

List of libraries

List of no-update expected libraries

  • __hello__.py unchanged
  • __phello__
  • antigravity.py not changed
  • this.py

List of tests without python libraries

Not yet added libraries

These libraris are not added yet. Pure python one will be possible while others are not.

Activity

  1. pinned this issue on Feb 20, 2025
  2. arihant2math commented on Feb 21, 2025

    @arihant2math
    Contributor

    antigravity does not need updating.

  3. arihant2math commented on Feb 28, 2025

    @arihant2math
    Contributor

    __hello__.py is also not updated

  4. arihant2math commented on Feb 28, 2025

    @arihant2math
    Contributor

    Same with test_openpty

  5. hbina commented on Mar 8, 2025

    @hbina
    Contributor

    Python 3.13 added the following test

    with self.assertWarns(DeprecationWarning):
                # We need to put the bool in a variable, because the constant
                # ~False is evaluated at compile time due to constant folding;
                # consequently the DeprecationWarning would be issued during
                # module loading and not during test execution.
                false = False
                self.assertEqual(~false, -1)

    AFAICT, this is deceptively a big change to how its implemented now. It seems to me that bools are just ints in RustPython? The call to ~false here delegates to PyInt::invert.

    Edit: Oh wait...the test is disabled in RustPython.

    Edit2: Is this an acceptable fix?
    14b9178d759ca2d6545972c49b2e0572d05b9098
    Or its not worth it to support something that would be deprecated?

  6. hbina commented on Mar 8, 2025

    @hbina
    Contributor

    test_unary is okay

    hbina085@akarin-thinkpad ~/g/RustPython (main)> cp ../cpython/Lib/test/test_unary.py Lib/test/test_unary.py                                                                                                           (base) 
    hbina085@akarin-thinkpad ~/g/RustPython (main)> cargo run --release --quiet -- -m test test_unary -v --quiet                                                                                                          (base) 
    Run tests sequentially
    test_unary passed
    
    == Tests result: SUCCESS ==
    
    Total duration: 10 ms
    Tests result: SUCCESS
    
  7. arihant2math commented on Mar 13, 2025

    @arihant2math
    Contributor

    __hello__.py is unchanged and _osx_support.py has been updated. Also cgi.py has been removed.

  8. hbina commented on Mar 23, 2025

    @hbina
    Contributor

    test_bool.py doesn't change.

  9. youknowone commented on Mar 30, 2025

    @youknowone
    MemberAuthor

    @hbina @arihant2math Thank you! all the comments are applied

  10. youknowone commented on Mar 30, 2025

    @youknowone
    MemberAuthor

    Is this an acceptable fix? Or its not worth it to support something that would be deprecated?

    @hbina Sure for both! We actually are good for either way. We can ignore it until being fully deprecated and removed later to work less, but welcome to merge it if you already made a patch.

  11. 25 remaining items

  12. youknowone commented on Jan 17, 2026

    @youknowone
    MemberAuthor

    Since #6718 is merged, updating target is also moved to 3.14
    We had a great journey to follow up Python 3.13 changes for a year.

    Especially for this version, we got a few automating tools by @arihant2math and @ShaharNaveh
    That changed the workflow a lot.

    At the same time, sorry for not tracking the linked issue very well. Due to faster update process, at the end of the version, it was not easy to track to update the linked PR to each modules.

    I will open a new issue for 3.14 tracking soon.
    Thank you so much everyone for a year!

  13. ShaharNaveh commented on Jan 23, 2026

    @ShaharNaveh
    Contributor

    @youknowone can we please unpin this issue and pin #6839 instead?

  14. unpinned this issue on Jan 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-stdlibC-compatA discrepancy between RustPython and CPythonC-enhancementNew feature or requestcpythonCPython source code relatedgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions