Comments (17)
Thanks for the report. I did not yet start testing with 3.11. I hope to get to it soon though.
from kiwi.
This seems to be an issue with type casts with the new inline functions included in 3.11.x. I've created a CPython bug since I don't know if it is a bug with CPython or a bug with the kiwisolver code. See:
Using PyTuple_SetItem
fixes the issue but I don't know if the new PyTuple_SET_ITEM
is buggy or if the kiwi C++ source code is doing something not quite correct. I'm not a C++ expert.
from kiwi.
The issue can be worked around by using nullptr, as per change below. However, I think the PyTuple_SET_ITEM()
and similar macros in CPython 3.11 should be changed to accept NULL/0 as null arguments.
diff --git a/py/src/symbolics.h b/py/src/symbolics.h
index 69ea540..1558063 100644
--- a/py/src/symbolics.h
+++ b/py/src/symbolics.h
@@ -123,7 +123,7 @@ PyObject* BinaryMul::operator()( Expression* first, double second )
return 0;
Py_ssize_t end = PyTuple_GET_SIZE( first->terms );
for( Py_ssize_t i = 0; i < end; ++i ) // memset 0 for safe error return
- PyTuple_SET_ITEM( terms.get(), i, 0 );
+ PyTuple_SET_ITEM( terms.get(), i, nullptr );
for( Py_ssize_t i = 0; i < end; ++i )
{
PyObject* item = PyTuple_GET_ITEM( first->terms, i );
diff --git a/py/src/util.h b/py/src/util.h
index 4b00fa7..1f40dc9 100644
--- a/py/src/util.h
+++ b/py/src/util.h
@@ -117,7 +117,7 @@ make_terms( const std::map<PyObject*, double>& coeffs )
return 0;
Py_ssize_t size = PyTuple_GET_SIZE( terms.get() );
for( Py_ssize_t i = 0; i < size; ++i ) // zero tuple for safe early return
- PyTuple_SET_ITEM( terms.get(), i, 0 );
+ PyTuple_SET_ITEM( terms.get(), i, nullptr );
Py_ssize_t i = 0;
iter_t it = coeffs.begin();
iter_t end = coeffs.end();
from kiwi.
Thanks for investigating. I will make a PR with those changes while waiting to see if a fix lands in CPython and add 3.11 to the test matrix.
from kiwi.
PR is at #142 and appears to work just fine. I will merge sometimes next week if nothing happens in the meantime.
from kiwi.
Thanks!
from kiwi.
The release process has started but the aarch build is real slow. Hopefully the wheels will appear on PyPI later today
from kiwi.
The build is much longer than the typical duration I can see in the history. Maybe it's just randomly hanging ?
from kiwi.
Right I will trig it again
from kiwi.
The discussed fix appears to fail on MacOS ARM (see #144). I would appreciate if anybody with more C++ background has an idea on how to fix this for all compilers and architectures.
from kiwi.
I think the following CPython patch may have made #142 unecessary : python/cpython@8bcc3fa
This patch was not yet shipped, and will (likely) be included only in Python 3.11.0b4 (scheduled for this Thursday).
I hope this helps.
from kiwi.
Thanks I will look into reverting the change once the beta is out.
from kiwi.
@MatthieuDartiailh FYI Python 3.11.0b4 is now available after a couple weeks of delay :)
from kiwi.
Thanks I am waiting for it to be available on GHA to merge the relevant PR.
from kiwi.
It's been available on GHA for a couple hours
from kiwi.
Everything seems to be installing fine for SymPy with 3.11b4:
https://github.com/sympy/sympy/runs/7318381460
There is a test failure but it's unrelated to kiwi.
from kiwi.
I merged the PR and will try to cut a new release soon.
from kiwi.
Related Issues (20)
- Failed building wheel for kiwisolver :( HOT 4
- Cann't install on python 3.11b3 HOT 2
- 1.4.3 has no attribute __version__ HOT 2
- ERROR: Failed building wheel for kiwisolver: C2440: 'static_cast': cannot convert from 'expr_type' to 'type' HOT 2
- Provide cp311 releases HOT 1
- Objective cell memory leak? HOT 26
- Continuous fuzzing by way of Google's OSS-Fuzz HOT 1
- Tests fail on pypy
- #egg=kiwisolver See assertion error when installing kiwisolver HOT 4
- about duplicate constraints HOT 3
- Add Python API to get all constraints HOT 14
- Is it possible to get the absolute value of an expression? HOT 10
- Is it possible to tell the Solver to prefer smaller or larger solutions? HOT 3
- Missing type hint for `Constraint.violated()` HOT 1
- Python 3.12 manylinux wheels HOT 2
- PyInstaller executable with matplotlib cannot find _cext DLL HOT 6
- `top_level.txt` include a non existing module `src`
- DLL load failed while importing _cext HOT 2
- How do we define an "objective function" and maximize or minimize it? HOT 1
- On Windows 10 LTSC, import kiwisolver (and/or import matplotlib) fails with DLL _cext even after installing VS runtime (solution incl) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kiwi.