python-dependency-injector icon indicating copy to clipboard operation
python-dependency-injector copied to clipboard

Migrate to Cython3

Open ZipFile opened this issue 1 year ago • 3 comments
trafficstars

As title says. Major incompatibility with v0.29 was new mandatory dunder mangling, so solution was simply to rename them. Otherwise migration was pretty much straightforward.

Notes:

  • Cython 3 no longer recommends commiting C files. I already have some drafts, will submit PR after this one is merged.
  • So far it builds and runs on CPython 3.7-3.12 (with coverage).
  • On PyPy it won't build with DEPENDENCY_INJECTOR_DEBUG_MODE (probably Cython issue), without debug mode looks like it builds and runs fine (no coverage ofc), but there are few failing tests, need investigate more if this is related to version of PyPy itself (I was testing with 7.3.16).
  • Not exactly sure about segfaults mentioned in #812, but majority of tests were failing because Cython 3 started mangling attributes that were previously unmangled.

ZipFile avatar Aug 13 '24 13:08 ZipFile

@ZipFile wow, thanks for the PR!

rmk135 avatar Aug 13 '24 15:08 rmk135

Coverage Status

coverage: 91.623%. remained the same when pulling cb81e56e5ee5af8aceed31d406043480017711e8 on ZipFile:cython3 into 2c998b8448ae717921efa63610669aa6ea661bae on ets-labs:master.

coveralls avatar Aug 13 '24 15:08 coveralls

Looks like tox was ignoring DEPENDENCY_INJECTOR_DEBUG_MODE env var set from GHA pipeline, coverage supposed to be around 94% with *.pyx included. Pushed fix + extra logging.

ZipFile avatar Aug 13 '24 21:08 ZipFile

@ZipFile thanks for the PR, It looks cool 👏

Hi @rmk135, would you mind taking a look at this PR when you have a chance? 🙏

Is there anything else needed to move it forward? I can try to help if needed

oleksandr-kuzmenko avatar Oct 29 '24 13:10 oleksandr-kuzmenko