Conversation
a0fc296 to
d3df03f
Compare
|
@DimitriPapadopoulos, Idk how familiar you are with Cython/C, but would appreciate your review here (if you have time 🙂) |
Try to match `store_le32` and improve readability.
Given these variables are integers, the latter is the more typical naming convention.
Everything that was relevant here has been moved to Cython. Also Cython has its own `stdint` wrappers to handle differences encountered. So those are not needed. Plus this was only needed for old Visual Studio versions, which are not used any more. In particular this was used with Python 2.7, which was dropped from the codebase.
Since the only header file included has been dropped, there is no need to include header files. So drop this from the `MANIFEST.in` as well.
d3df03f to
7e69f0c
Compare
|
I'll have a look, but I actually don't know much about Cython. I am more experienced in Python bindings for C++ libraries using SIP. |
|
|
||
| # C extensions | ||
| numcodecs/**/*.c | ||
| numcodecs/**/*.h |
There was a problem hiding this comment.
Had forgotten that. Thanks!
There was a problem hiding this comment.
No worries. Did as well. Plus being able to filter the headers meant needing to drop the one that was here.
| from libc.stdint cimport uint8_t, uint32_t | ||
|
|
||
|
|
||
| cdef inline void store_le32(uint8_t c[4], uint32_t i) nogil: |
There was a problem hiding this comment.
Adding nogil is good.
There was a problem hiding this comment.
Yep this forces Cython to generate straight C code. So the resulting code is nearly identical to what was in the header.
|
Yeah the dropping Python 2.7 & C files in your other two PRs reminded me there was some leftover compatibility code in this header for Windows Python 2.7. So this cleans that out and consolidates things into Cython (with some readability/code quality improvements). |
joshmoore
left a comment
There was a problem hiding this comment.
No strong opinions from my side, so generally 👍.
Probably my only question is whether or not there will be any impact on client code. E.g. if stdint_compat.h doesn't get re-generated, could anyone have been depending on it ❓
|
Thanks Josh! 🙏 Nope the header isn't installed. It is only used as part of the build process. |
Convert code from header files to Cython (generated C code is equivalent). Then drop the headers. These were there primarily for Windows compatibility with old Python versions (namely 2.7), but shouldn't be needed any more.
xref: #368
xref: #369
TODO:
tox -e py310passes locallytox -e docspasses locally