py-spy icon indicating copy to clipboard operation
py-spy copied to clipboard

Add support for 3.14

Open nedbat opened this issue 9 months ago • 6 comments

I'm trying to speed up coverage.py using new support available in the latest 3.14 alphas. I'd love to use py-spy to squeeze the most performance I can.

But: Unsupported version of Python: 3.14.0

nedbat avatar Mar 13 '25 19:03 nedbat

I'll point out: https://peps.python.org/pep-0768/

adriangb avatar May 18 '25 14:05 adriangb

@adriangb can you say more about why you are pointing to that? Is it for me or the maintainers?

nedbat avatar May 18 '25 14:05 nedbat

Sorry for the brief comment. 3.14 introduces a new way for remote debuggers (or samplers) to inspect a running process. I figured that might be relevant for py-spy supporting 3.14. I think it might be relevant for the maintainers / anyone implementing support for 3.14.

adriangb avatar May 18 '25 14:05 adriangb

@adriangb thanks for pointing out pep 768! That functionality is pretty useful - but I don't think I need to take advantage of it here yet (since py-spy doesn't inject code or modify the running program at all).

@nedbat I'm aiming to get python 3.14 support out before the release in october - but supporting alpha versions in py-spy have proven to be tricky in the past, since the memory layouts on internal python objects have sometimes changed between alpha releases =(. I'd like to start using the _Py_DebugOffsets that were introduced in python 3.12 to handle this - not only should it let us support new python versions easier, but it will let us handle things like alpha releases, debug builds of python and hopefully even freethreaded python builds. Changing to use _Py_DebugOffsets will be a major change though -

benfred avatar Jul 12 '25 18:07 benfred

@benfred 3.14 has been out for a week and us performance lunatics are eagerly waiting on py-spy support 🙌

adhami3310 avatar Oct 15 '25 04:10 adhami3310

On my side, I get the error Failed to find python version from target process. I use 3.14.0 installed in linux using pyenv

kasium avatar Nov 03 '25 10:11 kasium