stl_tools icon indicating copy to clipboard operation
stl_tools copied to clipboard

Fix extension build

Open MarkKoz opened this issue 4 years ago • 1 comments

I was getting errors installing this package on Python 3.9 on Windows:

stl_tools\cwrapped.c(19405): error C2039: 'exc_type': is not a member of '_ts'
cpython/pystate.h(51): note: see declaration of '_ts'
stl_tools\cwrapped.c(19406): error C2039: 'exc_value': is not a member of '_ts'
cpython/pystate.h(51): note: see declaration of '_ts'
stl_tools\cwrapped.c(19407): error C2039: 'exc_traceback': is not a member of '_ts'
cpython/pystate.h(51): note: see declaration of '_ts'
stl_tools\cwrapped.c(19408): error C2039: 'exc_type': is not a member of '_ts'
cpython/pystate.h(51): note: see declaration of '_ts'
stl_tools\cwrapped.c(19409): error C2039: 'exc_value': is not a member of '_ts'
cpython/pystate.h(51): note: see declaration of '_ts'
stl_tools\cwrapped.c(19410): error C2039: 'exc_traceback': is not a member of '_ts'
cpython/pystate.h(51): note: see declaration of '_ts'
stl_tools\cwrapped.c(19444): error C2039: 'exc_type': is not a member of '_ts'
cpython/pystate.h(51): note: see declaration of '_ts'
stl_tools\cwrapped.c(19445): error C2039: 'exc_value': is not a member of '_ts'
cpython/pystate.h(51): note: see declaration of '_ts'
stl_tools\cwrapped.c(19446): error C2039: 'exc_traceback': is not a member of '_ts'
cpython/pystate.h(51): note: see declaration of '_ts'
stl_tools\cwrapped.c(19458): error C2039: 'exc_type': is not a member of '_ts'
cpython/pystate.h(51): note: see declaration of '_ts'
stl_tools\cwrapped.c(19459): error C2039: 'exc_value': is not a member of '_ts'
cpython/pystate.h(51): note: see declaration of '_ts'
stl_tools\cwrapped.c(19460): error C2039: 'exc_traceback': is not a member of '_ts'
cpython/pystate.h(51): note: see declaration of '_ts'
stl_tools\cwrapped.c(19461): error C2039: 'exc_type': is not a member of '_ts'
cpython/pystate.h(51): note: see declaration of '_ts'
stl_tools\cwrapped.c(19462): error C2039: 'exc_value': is not a member of '_ts'
cpython/pystate.h(51): note: see declaration of '_ts'
stl_tools\cwrapped.c(19463): error C2039: 'exc_traceback': is not a member of '_ts'
cpython/pystate.h(51): note: see declaration of '_ts'

To fix this, I deleted the checked-in C file and modified setup.py to invoke Cython to build it all from scratch. This relies on setuptools >= 18.0 for proper Cython support. Other than that, I don't believe there are any potentially backwards-incompatible changes. I have not tested this on old versions like 2.7 and 3.2 like the readme mentions.

I also fixed the specification of build dependencies. It will now automatically install numpy and cython before installing the package. Furthermore, all dependencies have minimum versions specified in accordance with the readme. Technically, matplotlib should be less than version 3.3.0 since that's when the warn kwarg of matplotlib.use was removed. I didn't restrict it to that since there's already a PR open to remove that kwarg anyway (#16).

MarkKoz avatar Aug 08 '21 21:08 MarkKoz

Thanks, this worked for me in combination with PR#16

macromaniac avatar Dec 31 '21 18:12 macromaniac