apm-agent-python icon indicating copy to clipboard operation
apm-agent-python copied to clipboard

Wrapt 1.15.0 doesn't play well with py3.12

Open basepi opened this issue 1 year ago • 1 comments

Causes Django's test_stacktrace_filtered_for_elasticapm to fail.

Perhaps related to https://github.com/GrahamDumpleton/wrapt/issues/231 ?

basepi avatar Aug 29 '23 21:08 basepi

still not working with wrapt 1.15.0, I'm using 3.9.18

andrei-gutierrez avatar Jan 10 '24 14:01 andrei-gutierrez

In the wrapt 1.16.0 release, two important things were changed in regards to ObjectProxy:

  1. you could not set class in objectproxy: https://github.com/GrahamDumpleton/wrapt/commit/fe909c26f29f954de7648f8bb7fbd1916ee34cc6
  2. a pure python ObjectProxy alternative was exposed: https://github.com/GrahamDumpleton/wrapt/commit/77a41f5de2db5fb60c6b5456097602c9d1099eb0

Currently apm-agent does not use 2.), however 2.) will definitely fix the issue here (at a performance cost). @andrei-gutierrez Could you please retry tests with wrapt 1.16.0 as-is to see if the first change fixed this?

timostrunk avatar Mar 15 '24 13:03 timostrunk

Not running all tests but with python 3.12.2 and wrapt 1.16.0 quite a bit of them pass: 876 passed, 62 skipped

xrmx avatar Mar 18 '24 14:03 xrmx

Should I send a PR to include wrapt != 1.15.* in the requirements?

timostrunk avatar Mar 18 '24 15:03 timostrunk

It should be something like wrapt>=1.14.1,!=1.15.0 and install_requires in setup.cfg should be bumped too.

xrmx avatar Mar 18 '24 16:03 xrmx

I sent the PR, but the CLA process on our side will take a bit of time. I think for the moment it would be best if somebody else opened an equivalent PR.

timostrunk avatar Mar 19 '24 08:03 timostrunk