Skip to content

Conversation

@youknowone
Copy link
Member

@youknowone youknowone commented Feb 8, 2026

- [ ] [no deps] `types` (40 dependents) | 2026-01-23 Δ4
  - [ ] test_types (10 TODO)
- [x] [no deps] `struct` (17 dependents) | 2026-01-21
  - [ ] test_struct (4 TODO)
- [ ] [no deps] `stat` (14 dependents) | 2025-07-20 Δ11
  - [ ] test_stat
- [x] [no deps] `operator` (13 dependents) | 2026-01-23
  - [ ] test_operator (3 TODO)
- [ ] [no deps] `linecache` (9 dependents) | 2026-01-23 Δ67
  - [ ] test_linecache
- [x] [no deps] `codecs` (8 dependents) | 2026-01-31
  - [ ] test_codecs (11 TODO)
  - [ ] test_codeccallbacks (9 TODO)
  - [ ] test_codecencodings_cn (untracked)
  - [ ] test_codecencodings_hk (untracked)
  - [ ] test_codecencodings_iso2022 (untracked)
  - [ ] test_codecencodings_jp (untracked)
  - [ ] test_codecencodings_kr (untracked)
  - [ ] test_codecencodings_tw (untracked)
  - [ ] test_codecmaps_cn (untracked)
  - [ ] test_codecmaps_hk (untracked)
  - [ ] test_codecmaps_jp (untracked)
  - [ ] test_codecmaps_kr (untracked)
  - [ ] test_codecmaps_tw (untracked)
  - [ ] test_charmapcodec
  - [ ] test_multibytecodec (untracked)
- [x] [no deps] `__future__` (6 dependents) | 2024-04-23
  - [ ] test_future_stmt (7 TODO)
- [ ] [no deps] `hashlib` (2 dependents) | 2023-08-30 Δ109
  - [ ] test_hashlib (10 TODO)
- [ ] [no deps] `hmac` (2 dependents) | 2026-01-31 Δ1
  - [ ] test_hmac (27 TODO)
- [x] [no deps] `zipimport` | 2026-01-24
  - [x] test_zipimport (2 TODO)
  - [ ] test_zipimport_support (untracked)
- [ ] [0/5 deps] `collections` (32 dependents) | 2026-01-21 Δ64
  - [ ] test_collections (3 TODO)
  - [ ] test_deque (3 TODO)
  - [ ] test_defaultdict
  - [ ] test_ordered_dict (4 TODO)
- [x] [0/1 deps] `warnings` (21 dependents) | 2026-01-18
  - [ ] test_warnings (14 TODO)
- [x] [0/4 deps] `threading` (18 dependents) | 2026-01-18
  - [ ] test_threading (19 TODO)
  - [ ] test_threadedtempfile
  - [ ] test_threading_local (3 TODO)
- [x] [0/1 deps] `abc` (15 dependents) | 2025-06-29
  - [ ] test_abc (1 TODO)
- [x] [0/1 deps] `base64` (8 dependents) | 2026-01-19
  - [ ] test_base64
- [ ] [0/4 deps] `random` (5 dependents) | 2024-11-11 Δ149
  - [ ] test_random
- [x] [0/2 deps] `code` (4 dependents) | 2026-02-01
  - [ ] test_code (11 TODO)
  - [x] test_code_module (3 TODO)
- [ ] [0/4 deps] `json` (4 dependents) | 2026-01-18 Δ14
  - [ ] test_json (17 TODO)
- [x] [0/1 deps] `numbers` (3 dependents) | 2025-09-11
  - [ ] test_abstract_numbers
- [ ] [0/3 deps] `locale` (3 dependents) | 2025-08-20 Δ11
  - [ ] test_locale
  - [x] test__locale
- [ ] [0/2 deps] `html` (2 dependents) | 2026-01-24 Δ2
  - [x] test_html
  - [x] test_htmlparser
- [x] [0/3 deps] `decimal` (2 dependents) | 2026-01-30
  - [ ] test_decimal (1 TODO)
- [ ] [0/1 deps] `opcode` (1 dependents) | 2026-01-26 Δ313
  - [x] test__opcode (2 TODO)
  - [x] test_opcodes
- [x] [0/1 deps] `pyclbr` (1 dependents) | 2025-07-25
  - [ ] test_pyclbr (3 TODO)
- [x] [0/4 deps] `rlcompleter` (1 dependents) | 2025-07-17
  - [ ] test_rlcompleter (1 TODO)
- [ ] [0/2 deps] `poplib`
  - [ ] test_poplib (untracked)
- [ ] [0/2 deps] `pty` | 2026-01-05 Δ51
  - [ ] test_pty (4 TODO)
- [ ] [0/1 deps] `curses`
  - [ ] test_curses (untracked)
- [x] [1/3 deps] `os` (74 dependents) | 2026-02-03
  - [ ] test_os (3 TODO)
  - [x] test_popen
- [ ] [1/5 deps] `io` (51 dependents) | 2025-12-28 Δ247
  - [ ] test_io (26 TODO)
  - [ ] test_bufio
  - [ ] test_fileio
  - [ ] test_memoryio (26 TODO)
- [x] [1/4 deps] `re` (41 dependents) | 2026-01-20
  - [ ] test_re (19 TODO)
- [ ] [1/1 deps] `enum` (17 dependents) | 2026-02-01 Δ3
  - [x] test_enum (5 TODO)
- [x] [1/3 deps] `weakref` (14 dependents) | 2026-01-30
  - [x] test_weakref (22 TODO)
  - [ ] test_weakset (1 TODO)
- [ ] [1/5 deps] `datetime` (11 dependents) | 2025-12-31 Δ246
  - [ ] test_datetime
  - [ ] test_strptime (untracked)
- [ ] [1/3 deps] `copy` (9 dependents) | 2025-07-08 Δ58
  - [ ] test_copy
- [ ] [1/4 deps] `fnmatch` (7 dependents) | 2025-09-15 Δ115
  - [ ] test_fnmatch
- [x] [1/2 deps] `ast` (7 dependents) | 2026-02-02
  - [ ] test_ast (52 TODO)
  - [x] test_unparse
  - [x] test_type_comments (15 TODO)
- [ ] [1/3 deps] `posixpath` (6 dependents) | 2025-08-05 Δ69
  - [x] test_posixpath (4 TODO)
- [ ] [1/4 deps] `platform` (4 dependents) | 2026-01-04 Δ124
  - [ ] test_platform
- [x] [1/5 deps] `socketserver` (4 dependents) | 2026-01-03
  - [ ] test_socketserver (1 TODO)
- [ ] [1/4 deps] `pkgutil` (3 dependents) | 2026-01-04 Δ57
  - [ ] test_pkgutil (1 TODO)
- [ ] [1/6 deps] `bdb` (2 dependents) | 2025-12-30 Δ271
  - [ ] test_bdb (33 TODO)
- [ ] [1/3 deps] `site` (2 dependents) | 2026-01-17 Δ29
  - [ ] test_site (4 TODO)
- [x] [1/2 deps] `tabnanny` (1 dependents) | 2026-02-02
  - [ ] test_tabnanny (6 TODO)
- [ ] [1/1 deps] `profile` (1 dependents)
  - [ ] test_profile (untracked)
  - [ ] test_cprofile (untracked)
- [x] [1/4 deps] `sqlite3` (1 dependents) | 2026-01-19
  - [ ] test_sqlite3 (82 TODO)
- [x] [1/2 deps] `symtable` | 2026-01-30
  - [ ] test_symtable (18 TODO)
- [ ] [1/2 deps] `_android_support` | 2025-10-22 Δ7
- [ ] [1/6 deps] `compileall` | 2025-07-10 Δ4
  - [ ] test_compileall (2 TODO)
- [ ] [1/2 deps] `wave` | 2025-04-21 Δ2
  - [ ] test_wave
- [ ] [1/5 deps] `pstats`
  - [ ] test_pstats (untracked)
- [ ] [1/3 deps] `modulefinder`
  - [ ] test_modulefinder (untracked)
- [x] [2/5 deps] `functools` (33 dependents) | 2026-01-20
  - [ ] test_functools (10 TODO)
- [x] [2/6 deps] `contextlib` (22 dependents) | 2025-08-01
  - [ ] test_contextlib (2 TODO)
  - [ ] test_contextlib_async (2 TODO)
- [x] [2/3 deps] `socket` (13 dependents) | 2026-02-01
  - [ ] test_socket (17 TODO)
- [ ] [2/7 deps] `pickle` (8 dependents) | 2026-02-05 Δ8
  - [ ] test_pickle (22 TODO)
  - [ ] test_picklebuffer (12 TODO)
  - [ ] test_pickletools (8 TODO)
- [ ] [2/6 deps] `tokenize` (8 dependents) | 2022-08-09 Δ357
  - [ ] test_tokenize (2 TODO)
- [ ] [2/5 deps] `sysconfig` (6 dependents) | 2025-10-22 Δ265
  - [ ] test_sysconfig (8 TODO)
  - [ ] test__osx_support
- [ ] [2/6 deps] `typing` (6 dependents) | 2026-01-20 Δ4
  - [ ] test_typing (20 TODO)
  - [ ] test_type_aliases (untracked)
  - [ ] test_type_annotations (untracked)
  - [ ] test_type_params (untracked)
  - [ ] test_genericalias (3 TODO)
- [ ] [2/4 deps] `annotationlib` (3 dependents) | 2026-01-17 Δ15
  - [ ] test_annotationlib
- [ ] [2/5 deps] `webbrowser` (2 dependents) | 2025-04-21 Δ49
  - [ ] test_webbrowser
- [ ] [2/7 deps] `glob` (2 dependents) | 2025-09-16 Δ146
  - [ ] test_glob
- [ ] [2/2 deps] `csv` | 2025-07-25 Δ2
  - [ ] test_csv (27 TODO)
- [x] [2/2 deps] `fileinput` | 2025-04-30
  - [ ] test_fileinput
- [ ] [2/2 deps] `cProfile`
- [ ] [2/6 deps] `ssl` | 2025-10-28 Δ4
  - [ ] test_ssl (21 TODO)
- [ ] [2/8 deps] `statistics` | 2025-07-26 Δ2574
  - [ ] test_statistics (1 TODO)
- [x] [2/7 deps] `dbm` | 2026-01-01
  - [ ] test_dbm
  - [x] test_dbm_dumb
  - [ ] test_dbm_gnu (untracked)
  - [ ] test_dbm_ndbm (untracked)
  - [x] test_dbm_sqlite3
- [x] [3/9 deps] `traceback` (13 dependents) | 2026-02-06
  - [ ] test_traceback (35 TODO)
- [ ] [3/4 deps] `shutil` (9 dependents) | 2025-12-28 Δ224
  - [ ] test_shutil
- [ ] [3/8 deps] `subprocess` (7 dependents) | 2026-02-04 Δ2
  - [x] test_subprocess (5 TODO)
- [ ] [3/7 deps] `plistlib` (1 dependents) | 2026-01-04 Δ2
  - [ ] test_plistlib (6 TODO)
- [ ] [3/10 deps] `zoneinfo` | 2025-09-07 Δ24
  - [ ] test_zoneinfo (3 TODO)
- [ ] [3/4 deps] `tracemalloc`
  - [ ] test_tracemalloc (untracked)
- [ ] [3/9 deps] `xml` | 2025-08-21 Δ35
  - [ ] test_xml_etree (55 TODO)
  - [ ] test_xml_etree_c
  - [ ] test_minidom (untracked)
  - [ ] test_pulldom (4 TODO)
  - [ ] test_pyexpat (28 TODO)
  - [ ] test_sax (untracked)
  - [x] test_xml_dom_minicompat
  - [x] test_xml_dom_xmlbuilder
- [ ] [4/8 deps] `tempfile` (7 dependents) | 2026-01-04 Δ26
  - [ ] test_tempfile (1 TODO)
- [x] [4/4 deps] `dis` (4 dependents) | 2026-01-26
  - [ ] test_dis (43 TODO)
- [ ] [4/14 deps] `logging` (4 dependents) | 2025-07-20 Δ77
  - [ ] test_logging (9 TODO)
- [ ] [4/8 deps] `ctypes` (2 dependents) | 2025-12-24 Δ589
  - [ ] test_ctypes (14 TODO)
  - [ ] test_stable_abi_ctypes (untracked)
- [ ] [4/6 deps] `tkinter` (2 dependents) | 2025-04-06 Δ279
  - [ ] test_tkinter (untracked)
  - [ ] test_ttk (untracked)
  - [ ] test_ttk_textonly (untracked)
  - [ ] test_tcl (untracked)
  - [ ] test_idle (untracked)
- [ ] [4/6 deps] `zipapp` | 2025-08-06 Δ14
  - [ ] test_zipapp
- [ ] [4/7 deps] `tarfile` | 2025-05-07 Δ527
  - [ ] test_tarfile (3 TODO)
- [ ] [4/9 deps] `mailbox` | 2025-12-31 Δ6
  - [ ] test_mailbox
- [ ] [4/7 deps] `smtplib` | 2025-12-19 Δ11
  - [x] test_smtplib (2 TODO)
  - [x] test_smtpnet
- [ ] [4/6 deps] `wsgiref` | 2026-01-03 Δ7
  - [ ] test_wsgiref (1 TODO)
- [ ] [4/12 deps] `xmlrpc` | 2026-01-03 Δ3
  - [ ] test_xmlrpc (5 TODO)
  - [ ] test_docxmlrpc (7 TODO)
- [ ] [5/10 deps] `pathlib` (8 dependents) | 2026-01-01 Δ4058
  - [ ] test_pathlib (2 TODO)
- [ ] [5/10 deps] `zipfile` (2 dependents) | 2026-01-06 Δ124
  - [ ] test_zipfile (15 TODO)
  - [x] test_zipfile64
- [ ] [5/13 deps] `doctest` | 2025-12-31 Δ34
  - [ ] test_doctest (13 TODO)
- [ ] [5/7 deps] `venv` | 2026-01-17 Δ29
  - [ ] test_venv (4 TODO)
- [ ] [5/10 deps] `trace` | 2025-07-25 Δ15
  - [ ] test_trace (20 TODO)
- [ ] [5/11 deps] `concurrent` | 2026-01-09 Δ1012
  - [ ] test_concurrent_futures (18 TODO)
  - [ ] test_interpreters (untracked)
  - [ ] test__interpreters (untracked)
  - [ ] test__interpchannels (untracked)
  - [ ] test_crossinterp (untracked)
- [x] [6/16 deps] `inspect` (13 dependents) | 2026-02-07
  - [ ] test_inspect (55 TODO)
- [ ] [6/16 deps] `urllib` (1 dependents) | 2026-01-25 Δ5
  - [ ] test_urllib
  - [x] test_urllib2
  - [x] test_urllib2_localnet (19 TODO)
  - [x] test_urllib2net
  - [x] test_urllibnet
  - [x] test_urlparse (1 TODO)
  - [x] test_urllib_response
  - [x] test_robotparser
- [ ] [6/10 deps] `turtle`
  - [ ] test_turtle (untracked)
- [ ] [7/15 deps] `email` (3 dependents) | 2026-01-17 Δ238
  - [ ] test_email (12 TODO)
- [ ] [7/23 deps] `unittest` (2 dependents) | 2026-01-18 Δ102
  - [ ] test_unittest (15 TODO)
- [ ] [7/16 deps] `pydoc` (1 dependents) | 2026-01-22 Δ1735
  - [ ] test_pydoc (untracked)
- [ ] [8/26 deps] `multiprocessing` (1 dependents) | 2026-02-04 Δ314
  - [ ] test_multiprocessing_fork (63 TODO)
  - [ ] test_multiprocessing_forkserver (10 TODO)
  - [ ] test_multiprocessing_spawn (13 TODO)
  - [x] test_multiprocessing_main_handling
- [ ] [8/16 deps] `http` | 2026-01-16 Δ198
  - [ ] test_httplib
  - [ ] test_http_cookiejar
  - [ ] test_http_cookies
  - [ ] test_httpservers (13 TODO)
- [x] [10/20 deps] `importlib` (4 dependents) | 2026-02-05
  - [ ] test_importlib (12 TODO)
- [ ] [10/29 deps] `asyncio` (2 dependents) | 2026-02-02 Δ26
  - [ ] test_asyncio (39 TODO)
- [ ] [11/30 deps] `pdb` (1 dependents) | 2020-05-05 Δ2610
  - [ ] test_pdb (untracked)
- [ ] [11/30 deps] `_pyrepl` | 2025-04-11 Δ2534
- [ ] [15/39 deps] `idlelib`

## Standalone Tests
- [ ] test_android
- [ ] test_array (4 TODO)
- [ ] test_asdl_parser (untracked)
- [ ] test_atexit
- [ ] test_audit
- [ ] test_baseexception
- [ ] test_bigmem (4 TODO)
- [ ] test_binascii (1 TODO)
- [ ] test_bool
- [ ] test_buffer
- [ ] test_build_details (untracked)
- [ ] test_bytes (17 TODO)
- [ ] test_c_locale_coercion (1 TODO)
- [ ] test_call (1 TODO)
- [ ] test_capi (untracked)
- [ ] test_cext (untracked)
- [ ] test_class (16 TODO)
- [ ] test_clinic (untracked)
- [ ] test_cmd_line (24 TODO)
- [ ] test_cmd_line_script (15 TODO)
- [ ] test_compile (24 TODO)
- [ ] test_complex (2 TODO)
- [ ] test_context (6 TODO)
- [ ] test_cppext (untracked)
- [ ] test_decorators (1 TODO)
- [ ] test_descr (44 TODO)
  - [ ] test_descrtut (1 TODO)
- [ ] test_dictcomps (1 TODO)
  - [ ] test_userdict
- [ ] test_dtrace (8 TODO)
- [ ] test_dynamic (1 TODO)
- [ ] test_dynamicclassattribute
- [ ] test_embed (untracked)
- [ ] test_errno
- [ ] test_extcall (31 TODO)
- [ ] test_external_inspection (untracked)
- [ ] test_fcntl
  - [ ] test_ioctl
- [ ] test_file
  - [ ] test_largefile
- [ ] test_file_eintr (1 TODO)
- [ ] test_fileutils (untracked)
- [ ] test_finalization (untracked)
- [ ] test_float (5 TODO)
  - [ ] test_strtod (6 TODO)
- [ ] test_flufl (untracked)
- [ ] test_format (5 TODO)
- [ ] test_frame (untracked)
- [ ] test_free_threading (untracked)
- [ ] test_str (16 TODO)
  - [ ] test_fstring (29 TODO)
  - [ ] test_string_literals (5 TODO)
- [ ] test_funcattrs (5 TODO)
- [ ] test_gc (untracked)
- [ ] test_gdb (untracked)
- [ ] test_generated_cases (untracked)
- [ ] test_generators (5 TODO)
  - [ ] test_genexps (untracked)
  - [ ] test_generator_stop (untracked)
  - [ ] test_yield_from (10 TODO)
- [ ] test_getpath (untracked)
- [ ] test_global (3 TODO)
- [ ] test_grammar (18 TODO)
- [ ] test_hash (4 TODO)
- [ ] test_import (5 TODO)
- [ ] test_int (6 TODO)
  - [ ] test_long (4 TODO)
- [ ] test_isinstance
- [ ] test_iter (1 TODO)
- [ ] test_itertools (27 TODO)
- [ ] test_launcher (untracked)
- [ ] test_lltrace (untracked)
- [ ] test_marshal (21 TODO)
- [ ] test_memoryview (6 TODO)
- [ ] test_metaclass (10 TODO)
- [ ] test_mmap (3 TODO)
- [ ] test_module (4 TODO)
- [ ] test_monitoring (untracked)
- [ ] test_named_expressions (12 TODO)
- [ ] test_opcache
- [ ] test_optimizer (untracked)
- [ ] test_patma (20 TODO)
- [ ] test_peg_generator (untracked)
- [ ] test_pep646_syntax (12 TODO)
- [ ] test_perf_profiler (untracked)
- [ ] test_perfmaps (untracked)
- [ ] test_pkg
- [ ] test_poll (1 TODO)
- [ ] test_positional_only_arg (6 TODO)
- [ ] test_posix (4 TODO)
- [ ] test_print (7 TODO)
- [ ] test_property
- [ ] test_pyrepl (untracked)
  - [ ] test_repl
- [ ] test_raise (1 TODO)
- [ ] test_range (1 TODO)
- [ ] test_readline (untracked)
- [ ] test_regrtest (10 TODO)
- [ ] test_remote_pdb (untracked)
- [ ] test_resource (2 TODO)
- [ ] test_richcmp
- [ ] test_scope (1 TODO)
- [ ] test_support (4 TODO)
  - [ ] test_script_helper
- [ ] test_set (5 TODO)
- [ ] test_sort (2 TODO)
- [ ] test_source_encoding (untracked)
- [ ] test_startfile (untracked)
- [ ] test_time (18 TODO)
  - [ ] test_strftime
- [ ] test_structseq
- [ ] test_sundry
- [ ] test_super (4 TODO)
- [ ] test_syntax (26 TODO)
- [ ] test_sys (15 TODO)
  - [ ] test_syslog (2 TODO)
  - [ ] test_sys_setprofile (22 TODO)
  - [ ] test_sys_settrace (85 TODO)
- [ ] test_thread
  - [ ] test_thread_local_bytecode (untracked)
- [ ] test_timeout
- [ ] test_tools
- [ ] test_tuple (1 TODO)
- [ ] test_type_cache (untracked)
- [ ] test_unicodedata (18 TODO)
  - [ ] test_unicode_file_functions
  - [ ] test_unicode_identifiers (1 TODO)
- [ ] test_unpack
  - [ ] test_unpack_ex (31 TODO)
- [ ] test_userlist (1 TODO)
- [ ] test_utf8_mode (6 TODO)
- [ ] test_utf8source (2 TODO)
- [ ] test_winconsoleio (untracked)
- [ ] test_winreg
- [ ] test_winsound (untracked)
- [ ] test_with (1 TODO)
- [ ] test_wmi (untracked)
- [ ] test_xpickle (untracked)
- [ ] test_xxlimited (untracked)
- [ ] test_xxtestfuzz (untracked)

## Untracked Files
- site-packages/README.txt

## Original Files
- PSF-LICENSE
- README.md
- _dummy_os.py
- _dummy_thread.py
- _pycodecs.py
- dummy_threading.py

Summary by CodeRabbit

  • New Features
    • Modules and tests now display metadata including last updated dates and line difference counts from upstream sources, providing improved visibility into code synchronization status and helping identify components requiring maintenance or updates.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 8, 2026

📝 Walkthrough

Walkthrough

Adds metadata visibility to library update tooling by introducing utility functions to retrieve module/test git commit dates and compute diff statistics between CPython and local library versions, then integrates this metadata into todo list display formatting.

Changes

Cohort / File(s) Summary
Diff and Metadata Utilities
scripts/update_lib/deps.py
Introduces internal helpers _count_file_diff() and _count_path_diff() for computing line-level differences using difflib, and public functions get_module_last_updated(), get_module_diff_stat(), and get_test_last_updated() for retrieving git commit dates and diff statistics for modules and tests.
Todo Formatting Enhancement
scripts/update_lib/cmd_todo.py
Imports new metadata helpers and adds _format_meta_suffix() to produce formatted metadata strings. Augments display output in multiple locations (lib items, primary/subsequent test entries, nested tests) with last_updated and diff_lines metadata suffix; populates these fields during data processing based on verbose mode.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

skip:ci

Suggested reviewers

  • moreal
  • ShaharNaveh

Poem

🐰 A rabbit digs through git's long history,
Counting lines changed—no more mystery!
Modules now whisper when last they were blessed,
Metadata blooms on each todo request ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding last updated date display to the todo output. It clearly reflects the core functionality introduced across both modified files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@youknowone youknowone marked this pull request as ready for review February 8, 2026 23:15
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@scripts/update_lib/deps.py`:
- Around line 1034-1053: The function _count_path_diff currently returns 0 when
path types differ (file vs directory); change it to detect mismatched types and
count the lines on both sides instead of returning 0: if one side is a file and
the other a dir, sum the file's line count (use safe_read_text to read +
splitlines length) and the total lines of all *.py files under the directory
(iterate dir.rglob("*.py") and use safe_read_text for each); keep using
_count_file_diff for the file-file case and the existing directory-directory
aggregation logic in _count_path_diff.
🧹 Nitpick comments (3)
scripts/update_lib/deps.py (2)

1056-1084: subprocess.run for git log lacks cwd — relies on implicit working directory.

Both get_module_last_updated and get_test_last_updated run git log without specifying cwd, while _get_cpython_version (line 186) explicitly uses cwd=cpython_prefix. If the script is ever invoked from a directory other than the repo root, the git commands will fail or return wrong results. Consider passing cwd explicitly for robustness.

Suggested fix for `get_module_last_updated`
         result = subprocess.run(
             ["git", "log", "-1", "--format=%cd", "--date=short", "--"] + local_paths,
             capture_output=True,
             text=True,
             timeout=10,
+            cwd=lib_prefix if not pathlib.Path(local_paths[0]).is_absolute() else None,
         )

1104-1125: Duplicate pattern with get_module_last_updated — consider extracting a shared helper.

The git-log-last-date subprocess call is duplicated between get_module_last_updated (line 1074) and get_test_last_updated (line 1115). A small shared helper like _git_last_commit_date(paths: list[str]) -> str | None would reduce duplication.

scripts/update_lib/cmd_todo.py (1)

578-599: Performance: N subprocess calls for git log + N difflib passes per run.

Each lib item triggers a git log subprocess (via get_module_last_updated) and potentially a full file diff (via get_module_diff_stat). With hundreds of modules, this could noticeably slow down the default (non-verbose) todo command. Consider either:

  1. Batching git log queries (e.g., one git log call with all paths, then parse per-path dates), or
  2. Adding a --no-meta flag or making metadata opt-in via --verbose (similar to how test metadata is already verbose-only).

Not a blocker for a dev tool, but worth considering if users report slowness.

Comment on lines +1034 to +1053
def _count_path_diff(path_a: pathlib.Path, path_b: pathlib.Path) -> int:
"""Count changed lines between two paths (file or directory, *.py only)."""
if path_a.is_file() and path_b.is_file():
return _count_file_diff(path_a, path_b)
if path_a.is_dir() and path_b.is_dir():
total = 0
a_files = {f.relative_to(path_a) for f in path_a.rglob("*.py")}
b_files = {f.relative_to(path_b) for f in path_b.rglob("*.py")}
for rel in a_files & b_files:
total += _count_file_diff(path_a / rel, path_b / rel)
for rel in a_files - b_files:
content = safe_read_text(path_a / rel)
if content:
total += len(content.splitlines())
for rel in b_files - a_files:
content = safe_read_text(path_b / rel)
if content:
total += len(content.splitlines())
return total
return 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Mismatched path types (file vs. directory) silently return 0.

If a module changed from a single file to a package (or vice versa) between CPython versions, _count_path_diff returns 0 instead of reflecting the actual diff. This is an edge case but could hide a meaningful change in the todo output.

Consider counting all lines from both sides when types don't match, similar to how you handle files only present on one side in the directory case.

🤖 Prompt for AI Agents
In `@scripts/update_lib/deps.py` around lines 1034 - 1053, The function
_count_path_diff currently returns 0 when path types differ (file vs directory);
change it to detect mismatched types and count the lines on both sides instead
of returning 0: if one side is a file and the other a dir, sum the file's line
count (use safe_read_text to read + splitlines length) and the total lines of
all *.py files under the directory (iterate dir.rglob("*.py") and use
safe_read_text for each); keep using _count_file_diff for the file-file case and
the existing directory-directory aggregation logic in _count_path_diff.

@youknowone youknowone merged commit d2a9937 into RustPython:main Feb 9, 2026
12 of 13 checks passed
@youknowone youknowone deleted the todo-date branch February 9, 2026 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant