sagemath/sage

(experimental) Compile Cython code with binding=True

jdemeyer opened this issue · 59 comments

When using the Cython compiler directive binding=True, Cython uses a custom type to implement functions and methods. This custom type supports more Python features. The most important changes lie in inspect support.

We find several Cython bugs regarding binding=True:

Depends on #25842
Depends on #25845
Depends on #25848

Upstream: Reported upstream. No feedback yet.

CC: @kwankyu

Component: cython

Author: Jeroen Demeyer

Branch/Commit: u/jdemeyer/ticket/22747 @ d962040

Reviewer: Michael Orlitzky

Issue created by migration from https://trac.sagemath.org/ticket/22747

Description changed:

--- 
+++ 
@@ -1 +1 @@
-When using the Cython compiler directive `binding=True`, Cython uses a custom type to implement functions and methods. This custom type supports more Python features, such as `inspect` support.
+When using the Cython compiler directive `binding=True`, Cython uses a custom type to implement functions and methods. This custom type supports more Python features. The most important changes lie in `inspect` support.

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

2b70327Compile Cython code with binding=True

Description changed:

--- 
+++ 
@@ -1 +1,3 @@
 When using the Cython compiler directive `binding=True`, Cython uses a custom type to implement functions and methods. This custom type supports more Python features. The most important changes lie in `inspect` support.
+
+Unfortunately, this behaves badly if there are import cycles and there are many in Sage (#21636).

Changed dependencies from #21682 to #21843

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

b56b4beInclude Cython directives in .cython_version file
547397bCompile Cython code with binding=True

Changed commit from 2b70327 to 547397b

Description changed:

--- 
+++ 
@@ -1,3 +1,7 @@
 When using the Cython compiler directive `binding=True`, Cython uses a custom type to implement functions and methods. This custom type supports more Python features. The most important changes lie in `inspect` support.
 
 Unfortunately, this behaves badly if there are import cycles and there are many in Sage (#21636).
+
+We find several Cython bugs regarding `binding=True`:
+- https://github.com/cython/cython/issues/1658
+- https://github.com/cython/cython/issues/1679

Upstream: Reported upstream. No feedback yet.

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

ee13351Compile Cython code with binding=True

Changed commit from 547397b to ee13351

Changed dependencies from #21843 to #21843, #22852

Changed commit from ee13351 to 93250a2

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

841676dDefine functions before calling them
8994aceMerge commit '841676d4931c9f59019b2b6b82afbbe7df222c10' into t/22747/ticket/22747
93250a2Compile Cython code with binding=True

Changed commit from 93250a2 to 1e78314

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

1e78314Compile Cython code with binding=True

Changed dependencies from #21843, #22852 to none

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

a57b913QuotientRing_nc.ideal(): use super() instead of CommutativeRing
e62cc3aCompile Cython code with binding=True

Changed commit from 1e78314 to e62cc3a

Dependencies: #23103

Description changed:

--- 
+++ 
@@ -3,5 +3,5 @@
 Unfortunately, this behaves badly if there are import cycles and there are many in Sage (#21636).
 
 We find several Cython bugs regarding `binding=True`:
-- https://github.com/cython/cython/issues/1658
-- https://github.com/cython/cython/issues/1679
+- https://github.com/cython/cython/issues/1658 (not a big problem for Sage)
+- https://github.com/cython/cython/pull/1724 (patch submitted upstream)

Description changed:

--- 
+++ 
@@ -1,6 +1,4 @@
 When using the Cython compiler directive `binding=True`, Cython uses a custom type to implement functions and methods. This custom type supports more Python features. The most important changes lie in `inspect` support.
-
-Unfortunately, this behaves badly if there are import cycles and there are many in Sage (#21636).
 
 We find several Cython bugs regarding `binding=True`:
 - https://github.com/cython/cython/issues/1658 (not a big problem for Sage)

Changed commit from e62cc3a to 680f4a7

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

256bf19Move richcmp stuff to new file richcmp.pyx
7629851Merge tag '8.0.beta9' into t/23103/move_richcmp_stuff_to_new_file
031761fFix two more imports
f159d41Add Cython patch to fix decorators with binding=True
680f4a7Compile Cython code with binding=True

Changed dependencies from #23103 to #23103, #23122

Changed commit from 680f4a7 to b24e4c8

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

d59afe3Load the correct zlib library
db3b5ebMerge commit '031761f6ead116e4fa0a0fd3bf21fca5546df6d7' into HEAD
4c5cc9cAdd Cython patch to fix decorators with binding=True
116030bCompile Cython code with binding=True
b24e4c8Sage library fixes for binding=True

Description changed:

--- 
+++ 
@@ -2,4 +2,4 @@
 
 We find several Cython bugs regarding `binding=True`:
 - https://github.com/cython/cython/issues/1658 (not a big problem for Sage)
-- https://github.com/cython/cython/pull/1724 (patch submitted upstream)
+- https://github.com/cython/cython/pull/1724 (patch submitted upstream, no feedback yet)

Changed dependencies from #23103, #23122 to #23103, #23122, #23155, #15947

Description changed:

--- 
+++ 
@@ -1,5 +1,5 @@
 When using the Cython compiler directive `binding=True`, Cython uses a custom type to implement functions and methods. This custom type supports more Python features. The most important changes lie in `inspect` support.
 
 We find several Cython bugs regarding `binding=True`:
-- https://github.com/cython/cython/issues/1658 (not a big problem for Sage)
-- https://github.com/cython/cython/pull/1724 (patch submitted upstream, no feedback yet)
+- https://github.com/cython/cython/issues/1658 (not an issue for Sage)
+- https://github.com/cython/cython/pull/1724 (see #23155)

Description changed:

--- 
+++ 
@@ -3,3 +3,4 @@
 We find several Cython bugs regarding `binding=True`:
 - https://github.com/cython/cython/issues/1658 (not an issue for Sage)
 - https://github.com/cython/cython/pull/1724 (see #23155)
+- https://github.com/cython/cython/pull/1728 (see #23155)

Changed dependencies from #23103, #23122, #23155, #15947 to #23103, #23122, #23155, #15947, #23159

Changed commit from b24e4c8 to 37975ed

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

2e2339bAdd Cython patch to fix decorators with binding=True
091657dAdd Cython patch to fix method calls with binding=True
8f29430_lmul_ and _rmul_: scalar should be Element instead of RingElement
d288f41Give deprecation warning for #5930 unconditionally
6bd7e9fMerge commit '031761f6ead116e4fa0a0fd3bf21fca5546df6d7'; commit 'd59afe3bf4ee03da91184ae6183a6dd6a9d3656f'; commit '091657d270e422bfc7f27efa7d6944a5c3fd96f2'; commit '8f294308f8b85b233ffdc9df3f20c404ee6431c9'; commit 'd288f414bf0f8d785c1928fd1bdce89ec1bdc033' into HEAD
8ebd184Compile Cython code with binding=True
37975edSage library fixes for binding=True

Changed commit from 37975ed to 90e7db1

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

8a5bb48Compile Cython code with binding=True
90e7db1Sage library fixes for binding=True

Changed commit from 90e7db1 to 4062ec6

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

4062ec6Sage library fixes for binding=True

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

94ab6e0Compile Cython code with binding=True
dba0dd6Sage library fixes for binding=True

Changed commit from 4062ec6 to dba0dd6

Changed dependencies from #23103, #23122, #23155, #15947, #23159 to none

Changed commit from dba0dd6 to 0f70aed

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

f1debe3Upgrade to Cython 0.28.4
ee4c6c4Compile Cython code with binding=True
aa3513fSage library fixes for binding=True
0f70aedTry to fix Set_PythonType

Changed commit from 0f70aed to 60007d5

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

6310172Fix a cyclic import involving interval fields
60007d5Move Set_PythonType to a new file

Changed commit from 60007d5 to 13068eb

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

13068ebMove Set_PythonType to a new file

Dependencies: #25845

Changed commit from 13068eb to ddb7cc8

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

7e7daefMove Set_PythonType to a new file
48f170fCompile Cython code with binding=True
46a7887Sage library fixes for binding=True
ddb7cc8Fix a cyclic import involving interval fields

Changed commit from ddb7cc8 to 5282f12

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

8756c40Some preparations for binding=True
5282f12Sage library fixes for binding=True

Changed commit from 5282f12 to d962040

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

742e1c9Some preparations for binding=True
c5a8bd3Compile Cython code with binding=True
d962040Sage library fixes for binding=True

Changed dependencies from #25845 to #25842, #25845, #25848

comment:36

We can close this ticket in favor of #26254.

The only commit from the branch here that is useful is sagemath/sagetrac-mirror@d962040 -- not really "Sage library fixes" but just some updates of doctest outputs.

comment:37

Ok, #26254 looks much further along.

Reviewer: Michael Orlitzky