Skip to content

[pony] Fix stubtest failures with pony 0.7.20 - #16176

Merged
srittau merged 3 commits into
python:mainfrom
niallsemple:pony-0.7.20-stubtest-fix
Aug 10, 2026
Merged

[pony] Fix stubtest failures with pony 0.7.20#16176
srittau merged 3 commits into
python:mainfrom
niallsemple:pony-0.7.20-stubtest-fix

Conversation

@niallsemple

Copy link
Copy Markdown
Contributor

Fixes the pony part of #16175 (the daily stubtest run also reports a separate setuptools failure, not addressed here).

pony 0.7.20 (released 2026-08-09) renamed the first parameter of most methods from domain-specific names (translator, attr, wrapper, monad, decompiler, ...) to self — and to cls on EntityMeta — which produced 924 stubtest errors. This updates the stubs to match the 0.7.20 runtime.

Changes

  • Rename first parameters to self/cls across the pony stubs (888 self, 10 cls)
  • Add symbols new in 0.7.20:
    • py23compat.PY313 / PY314
    • Decompiler opcode handlers: CALL_KW, CONVERT_VALUE, FORMAT_SIMPLE, FORMAT_WITH_SPEC, LOAD_FAST_BORROW, LOAD_FAST_BORROW_LOAD_FAST_BORROW, LOAD_FAST_LOAD_FAST, LOAD_SMALL_INT, POP_JUMP_IF_NONE, POP_JUMP_IF_NOT_NONE, SET_FUNCTION_ATTRIBUTE, STORE_FAST_LOAD_FAST, STORE_FAST_STORE_FAST, TO_BOOL
    • decompiling.direct_jump_to_loop_ops / double_load_store_ops / slice_to_ast
    • core.QueryResultIterator.__iter__
    • utils.utils.IntegerGenerator / PersistentPickler / PersistentUnpickler
  • Match runtime defaults: Decompiler.CALL_FUNCTION_EX(argc=1) and MAKE_FUNCTION(argc=0)

Verification (local, pony==0.7.20)

  • tests/stubtest_third_party.py pony — passes (924 errors before)
  • tests/mypy_test.py stubs/pony — success
  • tests/pyright_test.py stubs/pony — 0 errors
  • ruff check stubs/pony — clean

niallsemple and others added 2 commits August 10, 2026 08:41
pony 0.7.20 renamed the first parameter of most methods from
domain-specific names (translator, attr, wrapper, monad, ...) to
`self` (and to `cls` on EntityMeta), which produced 924 stubtest
errors on the daily run (python#16175).

- Rename first parameters to `self`/`cls` across the pony stubs
- Add symbols new in 0.7.20: py23compat.PY313/PY314,
  Decompiler opcode handlers (CALL_KW, CONVERT_VALUE, FORMAT_SIMPLE,
  FORMAT_WITH_SPEC, LOAD_FAST_BORROW*, LOAD_FAST_LOAD_FAST,
  LOAD_SMALL_INT, POP_JUMP_IF_(NOT_)NONE, SET_FUNCTION_ATTRIBUTE,
  STORE_FAST_LOAD_FAST, STORE_FAST_STORE_FAST, TO_BOOL),
  decompiling.direct_jump_to_loop_ops / double_load_store_ops /
  slice_to_ast, QueryResultIterator.__iter__,
  utils.IntegerGenerator / PersistentPickler / PersistentUnpickler
- Match runtime defaults for Decompiler.CALL_FUNCTION_EX(argc=1)
  and MAKE_FUNCTION(argc=0)

Verified locally against pony==0.7.20: stubtest_third_party.py pony
passes (was 924 errors), mypy_test.py stubs/pony and pyright pass,
ruff check clean.
@github-actions

This comment has been minimized.

@srittau

srittau commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

We should also bump the version in METADATA.toml to version ~= "0.7.20"

@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@niallsemple

Copy link
Copy Markdown
Contributor Author

Hope this is what you wanted

@srittau
srittau merged commit 42e48d4 into python:main Aug 10, 2026
74 checks passed
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.

2 participants