GeezerVison is showing github.com — Update Python libraries and tests from Python 3.13 · Issue #5529 · RustPython/RustPython
Update Python libraries and tests from Python 3.13 #5529DescriptionThough 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
-
__future__.py
- Related test is
test_future_stmt
- _colorize Add _colorize at 3.13.2 #5520 Update
_colorize.py from 3.13.5 #5988
-
_compression.py
-
_markupbase.py
-
_osx_support.py _osx_support update to 3.13.2 #5596
-
_threading_local.py
-
_weakrefset.py Update _weakrefset.py from 3.13.5 #6004
-
abc.py Upgrade abc.py _py_abc.py to 3.13.5 #5865
_collections_abc.py
_py_abc.py
-
aifc.py removed in 3.13
-
argparse.py Update argparse to 3.13.5 #5874
-
ast.py Update ast.py from 3.13.5 #6006
-
asynchat.py removed in 3.13 Remove asynchat and asyncore #5688
-
asyncio Update asyncio library #6601
-
asyncore.py removed in 3.13 Remove asynchat and asyncore #5688
-
base64.py Update base64.py from 3.13.6 #6087 Update base64 3.13.5 #5872
-
bdb.py Updated bdb.py + test_bdb.py #6593
-
bisect.py not changed
-
bz2.py Fix bz2 module #5605 Update bz2.py from 3.13.5 #6055
-
calendar.py Update calendar and test_calendar to 3.13.2 #5696
-
cgi.py removed in 3.13 Remove cgi module #5597
-
cgitb.py removed in 3.13 Remove cgitb module #5609
-
chunk.pyremoved in 3.13
-
cmd.py Update cmd from 3.13.5 #5920
-
code.py Update straightforward packages Pt 1 #6595
test_code_module is related test
-
codecs.py Update codecs from 3.13.7 #6130
-
codeop.py Update codeop.py from 3.13.5 #6026
-
collections Update test_collections.py from 3.13.7 #6136
-
colorsys.py Update some libraries to 3.13.3 #5731
-
compileall.py Update compileall from 3.13.5 #5914
-
concurrent
-
configparser.py Update configparser.py from 3.13.5 #6062
-
contextlib.py Update contextlib from 3.13.5, #6056
-
test/test_contextlib_async.py
-
contextvars.py not changed
-
copy.py Update copy from 3.13.5 #5913
-
copyreg.py not changed
-
csv.py Update csv.py from 3.13.5 #6035 Update struct to 3.13.3 and update parts of test.support #5702
-
ctypes
-
dataclasses.py pending match statement support.
-
datetime.py Update test_datetime from 3.13.5 #5911
-
dbm
-
decimal.py Update {_py,}decimal.py from 3.13.5 #6034 Update struct to 3.13.3 and update parts of test.support #5702
-
difflib.py Update difflib.py from 3.13.5 #6067
-
dis.py Update opcode from 3.13.7 #6156
-
distutils Update straightforward packages Pt 1 #6595
-
doctest.py Update straightforward packages Pt 1 #6595 Added doctest tests #6598
-
email
-
encodings Update {io,encodings} from 3.13.7 #6153
-
ensurepip Update ensurepip from CPython 3.13.9 #5740
-
enum.py Updated enum + file_cmp library + tests - v3.13.10 #6606
-
filecmp.py Updated enum + file_cmp library + tests - v3.13.10 #6606
-
fileinput.py More stdlib updates #5737
-
fnmatch.py Update fnmatch from 3.13.7 #6149
-
fractions.py Update the fractions and ftplib libraries + associated tests - v.3.13.10 #6607
-
ftplib.py Update the fractions and ftplib libraries + associated tests - v.3.13.10 #6607
-
functools.py Update functools from 3.13.9 #6205
-
gc.py
-
genericpath.py Fix broken CI on windows #6143 Update genericpath.py from 3.13.5 #6065
-
getopt.py More stdlib updates #5737
-
getpass.py More stdlib updates #5737
-
gettext.py Update gettext.py from 3.13.5 #6063
-
glob.py Update glob from 3.13.7 #6152
-
graphlib.py Update some libraries to 3.13.3 #5731
-
gzip.py Update gzip from 3.13.5 #5912 Fix a bunch of zlib tests & update gzip.py to Python 3.13 #5563
-
hashlib.py
-
heapq.py Update some libraries to 3.13.3 #5731
-
hmac.py Updated the hmac + mailbox libraries + associated tests #6608
-
html Update html* from 3.13.7 #6133 Update html from 3.13.5 #6031
-
http
-
imghdr.py removed in 3.13
-
imp.py removed in 3.12 Remove imp #5693
-
importlib Updated the importlib + nturl2path + pathlib libraries + associated tests - v3.13.10 #6609 Updated the pkgutil + unittest libraries + the pkgutil, unittest and import tests - v.3.13.11 #6610
-
inspect.py
-
io.py Update {io,encodings} from 3.13.7 #6153
-
ipaddress.py Update ipaddress from 3.13.5 #5878
-
json Update json from 3.13.5 #6007
-
keyword.py not changed
-
linecache.py Update some libraries to 3.13.3 #5731
-
locale.py Update locale.py from 3.13.6 and made _locale available on android #6091
-
logging Use ast.unparse for generating patches with lib_updater.py #6142 Update logging from 3.13.5 #6003
-
mailbox.py Updated the hmac + mailbox libraries + associated tests #6608
-
mimetypes.py
-
multiprocessing Update multiprocess from 3.13.5 #6000
-
netrc.py Update netrc.py from 3.13.6 and make pwd accesible on Android #6083
-
nntplib.py removed in 3.13 Remove nntplib #5683
-
ntpath.py Fix broken CI on windows #6143 Update {nt,posix}path.py from 3.13.5 #6070
-
nturl2path.py Updated the importlib + nturl2path + pathlib libraries + associated tests - v3.13.10 #6609
-
numbers.py not changed
-
opcode.py Update opcode from 3.13.7 #6156
-
operator.py Update operator from 3.13.5 #5935
-
optparse.py Update some tests from 3.13.7 #6108
-
os.py Use ast.unparse for generating patches with lib_updater.py #6142 Update os.py from 3.13.5 #6076
-
pathlib.py Updated the importlib + nturl2path + pathlib libraries + associated tests - v3.13.10 #6609 Updated the pkgutil + unittest libraries + the pkgutil, unittest and import tests - v.3.13.11 #6610
-
pdb.py
-
pickle.py Update pickle{tools,}.py from 3.13.5 #6064
-
pickletools.py Update pickle{tools,}.py from 3.13.5 #6064
-
pkgutil.py Updated the pkgutil + unittest libraries + the pkgutil, unittest and import tests - v.3.13.11 #6610
-
platform.py Updated the platform + plistlib libraries + associated tests v.3.13.10 #6611
-
plistlib.py Updated the platform + plistlib libraries + associated tests v.3.13.10 #6611
-
posixpath.py Update {nt,posix}path.py from 3.13.5 #6070
-
pprint.py Update some tests from 3.13.7 #6115 Update some libraries to 3.13.3 #5731
-
pty.py
-
py_compile.py Fix broken CI on windows #6143
-
pydoc.py
-
_pyrepl Add _pyrepl #5540
-
queue.py Update some libraries to 3.13.3 #5731
-
quopri.py Update quopri from 3.13.5 #5989
-
random.py Fix a bunch of random tests #5533
-
re.py
- Don't forget sre files
sre_compile.py, sre_constants.py, sre_parse.py
-
reprlib.py More stdlib updates #5737
-
rlcompleter.py
-
runpy.py Update{runpy,numbers}.py from 3.13.7 #6141
-
sched.py Update some libraries to 3.13.3 #5731
-
secrets.py Update secrets from 3.13.5 #5991
-
selectors.py Update selector.py from 3.13.5 #6002
-
shelve.py Update shelve.py from 3.13.11 #6483
-
shlex.py Update shlex from 3.13.5 #5977
-
shutil.py Fix broken CI on windows #6143
-
signal.py
-
site.py Update Lib with changed files in 3.13.8 #6186 Update {site,sysconfig}.py from 3.13.7 #6132
- Don't forget
_sitebuiltins.py
-
smtpd.py removed in 3.13
-
smtplib.py
-
sndhdr.py removed in 3.13
-
socket.py Update socket and test from CPython 3.12.2 #5255
-
socketserver.py
-
sqlite3
-
ssl.py Update ssl.py from CPython 3.13.9 #6217
-
stat.py Fix broken CI on windows #6143 Update stat from 3.13.5 #5992 Implement _stat module #5847
-
statistics.py Update statistics to 3.13.2 #5592
-
string.py
-
stringprep.py
-
struct.py Update struct to 3.13.3 and update parts of test.support #5702
-
subprocess.py
-
sunau.py removed in 3.13
-
sysconfig.py Update Lib with changed files in 3.13.8 #6186 Update {site,sysconfig}.py from 3.13.7 #6132
-
tabnanny.py Update tabnanny.py from 3.13.5 #6021
-
tarfile.py Fix broken CI on windows #6143 Update tarfile to 3.12.3 #5714
-
telnetlib.py removed in 3.13 Remove telnetlib #5649
-
tempfile.py
-
textwrap.py Update textwrap from 3.13.5 #5952
-
threading.py
-
timeit.py More stdlib updates #5737
-
token.py
-
tokenize.py
-
tomllib Update tomllib from 3.13.5 #5902
-
trace.py Update trace.py from 3.13.5 #6029
-
traceback.py Update test_exception*.py from 3.13.5 #5978
-
tty.py
-
types.py Upgrade Lib/types.py from Python 3.13.5 #5928
-
typing.py typing upgrade to 3.13.2 #5590 Update Lib with changed files in 3.13.8 #6186 Update test_typing from Python 3.13.5 #6013
-
unittest Update unittest partially #6051 (partial) Updated the pkgutil + unittest libraries + the pkgutil, unittest and import tests - v.3.13.11 #6610
-
urllib
-
uu.py removed in 3.13 Remove uu.py and test_uu.py #5607
-
uuid.py Update uuid from 3.13.7 #6155 Update uuid from 3.13.5 #5901
-
venv
-
warnings.py Update warnings from 3.13.5 #6019
-
weakref.py Update test_{dict,weakref}.py from 3.13.5 #5963
-
webbrowser.py Update webbrowser and test_webbrowser to 3.13.3 #5724
-
wsgiref
-
xdrlib.py removed in 3.13 Remove xdrlib #5648
-
xml Update xml from 3.13.7 #6100
-
xmlrpc
-
zipapp.py Update zipapp.py from 3.13.5 #6075
-
zipfile.py
-
zipimport.py
-
zoneinfo Update zoneinfo and _strptime from 3.13.7 #6139
- test.support
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.
Activityarihant2math commented on Feb 21, 2025 antigravity does not need updating. Reacted by Jeong, YunWon and jerrychiu arihant2math commented on Feb 28, 2025 __hello__.py is also not updated
arihant2math commented on Feb 28, 2025 hbina commented on Mar 8, 2025 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? hbina commented on Mar 8, 2025 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
arihant2math commented on Mar 13, 2025 __hello__.py is unchanged and _osx_support.py has been updated. Also cgi.py has been removed.
hbina commented on Mar 23, 2025 test_bool.py doesn't change.
youknowone commented on Mar 30, 2025 youknowone commented on Mar 30, 2025
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. youknowone commented on Jan 17, 2026 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! ShaharNaveh commented on Jan 23, 2026
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|