Sage 9.2 Release Tour

in progress (2020)

Python 3 transition completed

SageMath 9.0 was the first version of Sage running on Python 3 by default. SageMath 9.1 continued to support Python 2.

Support for Python 2 removed

Sage 9.2 has removed support for Python 2. The Sage library now makes use of Python language and library features that are only available in Python 3.6 or newer; and large amounts of compatibility code have been removed.

However, note that this is unrelated to the minimal requirements for a source installation of the Sage distribution: Sage 9.2 is still able to build on a system that only provides Python 2.x or Python 3.5 or older. In this case, the SageMath distribution builds its own copy of Python 3.

Support for system Python 3.6 added

This allows Sage to use the system Python on some older Linux distributions that are still in widespread use in scientific computing, including centos-8 and fedora-{26,27,28} (although Python 3.7.x packages are also available for these). See #29033 for more details.

For developers: Using Python 3.6+ features in sagelib

Meta-ticket #29756 provides a starting point for a discussion of new features of the Python language and standard library to bring them to systematic use in sagelib.

More details

Package upgrades

The removal of support for Python 2 has enabled major package upgrades.

Major user-visible package upgrades below...

matplotlib

Dropping Python 2 support allowed us to make a major jump from matplotlib 2.2.5 to 3.3.1. See matplotlib's release notes for 3.0, 3.1, 3.2,3.3. In addition to improved output, this update will likely enable Sage developers to implement new features for plotting and graphics.

rpy2 and R

The rpy2 Python package is the foundation for SageMath's interface to R. Dropping Python 2 support allowed us to make the major upgrade from 2.8.2 to 3.3.5 in #29441; see the release notes for details.

We only did a minor upgrade of R itself in the Sage distribution, to 3.6.3, the latest in the 3.6.x series. Of course, if R 4.0.x is installed in the system, Sage will use it instead of building its own copy.

The SageMath developers are eager to learn from users how they use the SageMath-R interface, and what needs to be added to it to become more powerful. Let us know at sage-devel.

sphinx

1.8.5 -> 3.1.2

IPython, Jupyter notebook, JupyterLab

Dropping support for Python 2 allowed us to upgrade IPython from 5.8.0 to 7.13.0 in #28197. See the release notes for the 6.x and 7.x series.

We have also upgraded the Jupyter notebook from 5.7.6 to 6.1.1 in #26919; see the notebook changelog for more information.

JupyterLab is now fully supported as an optional, alternative interface #30246, including interacts. To use it, install it first, using the command sage -i jupyterlab_widgets. Then you can start it using ./sage -n jupyterlab.

For developers

The packages giacpy_sage and sage_brial have been merged into sagelib.

Other package updates

For developers: Upgrading packages

Upgrading Python packages in the Sage distribution from PyPI has again become easier, thanks to #20104. You can now do:

$ sage --package update-latest matplotlib
Updating matplotlib: 3.3.0 -> 3.3.1
Downloading tarball to ...matplotlib-3.3.1.tar.bz2
[...............................................................]

When you do this, please remember to check that the checksums.ini file has an upstream_url in the format upstream_url=https://pypi.io/packages/source/m/matplotlib/matplotlib-VERSION.tar.gz. (This is not needed for updated-latest to work, but helps with automated tests of the upgrade ticket -- see Sage 9.1 release tour on this topic.)

Graphics

New features

Implementation improvements

For developers

Linear and multilinear algebra

One free module constructor to rule them all

Sage has several specialized implementation classes for free modules and vector spaces. The factory functions FreeModule and VectorSpace select the appropriate class depending on the base ring and other parameters:

   1 sage: FreeModule(ZZ, 10)
   2 Ambient free module of rank 10 
   3 over the principal ideal domain Integer Ring
   4 sage: FreeModule(FiniteField(5), 10)
   5 Vector space of dimension 10 over Finite Field of size 5
   6 sage: QQ^10 is VectorSpace(QQ, 10)
   7 True

The free modules (vector spaces) created here have a distinguished standard basis indexed by range(rank).

In Sage 9.2, these factory functions have been extended in #30194 so that they cover two more cases:

1. If a sequence or family of indices is passed instead of the rank (dimension), then a CombinatorialFreeModule is created instead. These modules underly SageMath's facilities for algebraic combinatorics.

   1 sage: U = FreeModule(AA, ['x', 'y', 'z']); U
   2 Free module generated by {'x', 'y', 'z'} over Algebraic Real Field
   3 sage: V = VectorSpace(QQ, ZZ); V
   4 sage: V.basis()                                                                                          
   5 Lazy family 
   6 (Term map from Integer Ring 
   7  to Free module generated by Integer Ring over Rational Field(i))
   8 _{i in Integer Ring}
   9 sage: QQ^SymmetricGroup(4)                                                                                                       
  10 Free module generated by 
  11 Symmetric group of order 4! as a permutation group over Rational Field

2. If the factory function is invoked with the parameter with_basis=None, then a free module of the given rank without distinguished basis is created.

   1 sage: W = FreeModule(AA, 3, with_basis=None); W
   2 3-dimensional vector space over the Algebraic Real Field
   3 sage: W.category()
   4 Category of finite dimensional vector spaces over Algebraic Real Field
   5 sage: W.tensor_module(2, 2)                                                                                                      
   6 Free module of type-(2,2) tensors 
   7 on the 3-dimensional vector space over the Algebraic Real Field

It is represented by an instance of the class FiniteRankFreeModule from sage.tensor.modules. These modules are the foundation for the multilinear algebra developed by the SageManifolds project.

Connecting FiniteRankFreeModule and free modules with distinguished basis

Given a basis of a FiniteRankFreeModule, the new method isomorphism_with_fixed_basis (#30094) constructs an isomorphism from the FiniteRankFreeModule to a free module in the category ModulesWithBasis. By default, it uses a CombinatorialFreeModule:

   1 sage: V = FiniteRankFreeModule(QQ, 3, start_index=1); V
   2 3-dimensional vector space over the Rational Field
   3 sage: basis = e = V.basis("e"); basis
   4 Basis (e_1,e_2,e_3) on the 3-dimensional vector space over the
   5 Rational Field
   6 sage: phi_e = V.isomorphism_with_fixed_basis(basis); phi_e
   7 Generic morphism:
   8   From: 3-dimensional vector space over the Rational Field
   9   To:   Free module generated by {1, 2, 3} over Rational Field
  10 sage: phi_e(e[1] + 2 * e[2])
  11 e[1] + 2*e[2]

Other improvements

Sage 9.2 has also merged a number of improvements to sage.tensor.modules: #30094, #30169, #30179, #30181, #30194, #30250, #30251, #30254, #30255, #30287

Polyhedral geometry

New features

It is now possible to choose which backend to use to compute regions of hyperplane arrangements 29506:

   1 sage: R.<sqrt5> = QuadraticField(5)
   2 sage: H = HyperplaneArrangements(R, names='xyz')
   3 sage: x,y,z = H.gens()
   4 sage: A = H(sqrt5*x+2*y+3*z, backend='normaliz')
   5 sage: A.backend()
   6 'normaliz'
   7 sage: A.regions()[0].backend()  # optional - pynormaliz
   8 'normaliz'

It is now possible to compute the slack matrix of a polyhedron 29838:

   1 sage: P = polytopes.cube(intervals='zero_one')
   2 sage: P.slack_matrix()
   3 0 1 1 1 0 0
   4 0 0 1 1 0 1
   5 0 0 0 1 1 1
   6 0 1 0 1 1 0
   7 1 1 0 0 1 0
   8 1 1 1 0 0 0
   9 1 0 1 0 0 1
  10 1 0 0 0 1 1

It is now possible to apply an affine transformation on a polyhedron 30327:

   1 sage: M = random_matrix(QQ,3,3) 
   2 sage: v = vector(QQ,(1,2,3)) 
   3 sage: F = AffineGroup(3, QQ) 
   4 sage: f = F(M, v); f                                                                    
   5       [  0   0  -2]     [1]
   6 x |-> [  0   1   0] x + [2]
   7       [ -1  -1 1/2]     [3]
   8 sage: cube = polytopes.cube() 
   9 sage: f * cube                                                            
  10 A 3-dimensional polyhedron in QQ^3 defined as the convex hull of 8 vertices
  11 sage: f(cube)                     # also works                                                        
  12 A 3-dimensional polyhedron in QQ^3 defined as the convex hull of 8 vertices

Implementation improvements

There are also some bug fixes and other improvements. For more details see the release notes for optimization and polyhedral geometry software interactions in Sage.

Combinatorics

It is now possible to solve an instance of an exact cover problem using a reduction from a dancing links instance to SAT 29338 or MILP 29955:

   1 sage: from sage.combinat.matrices.dancing_links import dlx_solver
   2 sage: rows = [[0,1,2], [3,4,5], [0,1], [2,3,4,5], [0], [1,2,3,4,5]]
   3 sage: d = dlx_solver(rows)
   4 sage: d.one_solution()
   5 [1, 0]
   6 sage: d.one_solution_using_sat_solver('cryptominisat')
   7 [2, 3]
   8 sage: d.one_solution_using_sat_solver('glucose')
   9 [2, 3]
  10 sage: d.one_solution_using_sat_solver('glucose-syrup')
  11 [2, 3]
  12 sage: d.one_solution_using_sat_solver('picosat')
  13 [4, 5]
  14 sage: d.one_solution_using_milp_solver()
  15 [0, 1]
  16 sage: d.one_solution_using_milp_solver('Gurobi')
  17 [0, 1]

Polyomino tilings

It is now possible to find a surrounding of a polyomino with copies of itself, see 29160. This is based on the dancing links solver in Sage. This is motivated by the Heesch's problem. An example is below:

sage: from sage.combinat.tiling import Polyomino
sage: H = Polyomino([(-1, 1), (-1, 4), (-1, 7), (0, 0), (0, 1), (0, 2),
....: (0, 3), (0, 4), (0, 5), (0, 6), (0, 7), (0, 8), (1, 1), (1, 2),
....: (1, 3), (1, 4), (1, 5), (1, 6), (1, 7), (1, 8), (2, 0), (2, 2),
....: (2, 3), (2, 5), (2, 6), (2, 8)])
sage: H.show2d()

H.png

sage: %time solution = H.self_surrounding(10, ncpus=8)
CPU times: user 1.69 s, sys: 1.08 s, total: 2.77 s
Wall time: 3.85 s
sage: G = sum([p.show2d() for p in solution], Graphics())
sage: G

G.png

Fully commutative elements of Coxeter groups

It is now possible by 30243 to enumerate and work with the fully commutative elements of a Coxeter group. Methods to compute *star operations* and plot the *heaps* of such elements are also included.

   1 sage: A3 = CoxeterGroup(['A', 3])
   2 sage: FCA3 = A3.fully_commutative_elements()
   3 sage: FCA3.category()
   4 Category of finite enumerated sets
   5 sage: FCA3.list()
   6 [[],
   7  [1],
   8  [2],
   9  ...
  10  [1, 3, 2],
  11  [1, 2, 3],
  12  [2, 1, 3, 2]]
  13 sage: B8 = CoxeterGroup(['B', 8])
  14 sage: FCB8 = B8.fully_commutative_elements()
  15 sage: len(FCB8)    # long time (7 seconds)
  16 14299
  17 sage: B6 = CoxeterGroup(['B', 6])
  18 sage: FCB6 = B6.fully_commutative_elements()
  19 sage: w = FCB6([1, 6, 2, 5, 4, 6, 5])
  20 sage: w.coset_decomposition({5, 6})
  21 ([6, 5, 6], [1, 2, 4, 5])
  22 sage: w.star_operation({5,6}, 'lower')
  23 [1, 5, 2, 4, 6, 5]
  24 sage: FCB6([3, 2, 4, 3, 1]).plot_heap()

heap.png

Commutative algebra

Laurent polynomials

Rings of Laurent polynomials now support ideal creation and manipulation 29512:

sage: L.<x,y,z> = LaurentPolynomialRing(QQ, 3)                                                
sage: I = L.ideal([(x+y+z)^3+x*y, x^2+y^2+z^2])                                               
sage: I.groebner_basis()                                                                      
(y^4 + 4*x*y*z^2 + y^2*z^2 + 2*x*z^3 + 2*y*z^3 - z^4 + 3/2*x*y*z + 1/4*x*z^2 + 1/4*y*z^2 - 1/4*z^3 + 1/8*x*y,
 x*y^2 - y^3 + 3*x*y*z + x*z^2 - z^3 + 1/2*x*y,
 x^2 + y^2 + z^2)
sage: (x^3+y^3+z^3) in I                                                                      
False
sage: x + x^-1*y^2 + x^-1*z^2 in I                                                            
True

Motivic multiple zetas

The ring of motivic multiple zeta values has been implemented, using algorithms of Francis Brown. It allows to compute at least up to weight 12 22713.

sage: Multizeta(1,2)**2                                                         
12*ζ(1,1,1,3) + 6*ζ(1,1,2,2) + 2*ζ(1,2,1,2)
sage: Multizeta(1,2)==Multizeta(3)                                              
True
sage: Multizeta(2,3,4).n(100)                                                   
0.0029375850405618494701189454256

The numerical evaluation is based on PARI implementation.

Power series

There is new method to compute the coefficients in the Jacobi continued fraction expansion of a power series 29789.

sage: t = QQ[['t']].0                                                             
sage: f = sum(factorial(n)*t**n for n in range(20)).O(20)                         
sage: f.jacobi_continued_fraction()                                             
((-1, -1),
 (-3, -4),
 (-5, -9),
 (-7, -16),
 (-9, -25),
 (-11, -36),
 (-13, -49),
 (-15, -64),
 (-17, -81))

Manifolds

diff function for exterior derivatives

It is now possible to invoke diff to compute the differential (exterior derivative) of a differentiable form (#29953). For instance, for a scalar field:

sage: M = Manifold(2, 'M')
sage: X.<x,y> = M.chart()
sage: f = M.scalar_field(x^2*y, name='f')
sage: diff(f)
1-form df on the 2-dimensional differentiable manifold M
sage: diff(f).display()
df = 2*x*y dx + x^2 dy

and for a 1-form:

sage: a = M.one_form(-y, x, name='a'); a.display()
a = -y dx + x dy
sage: diff(a)
2-form da on the 2-dimensional differentiable manifold M
sage: diff(a).display()
da = 2 dx/\dy

Unicode characters allowed in index notations

Greek letters (and more generally any Unicode non-digit word-constituent character) are now allowed in index notation for tensors (#29248). For instance, taking the trace of a type-(1,1) tensor field:

sage: E.<x,y> = EuclideanSpace()                                                
sage: t = E.tensor_field(1, 1, [[x, 1], [0, y]])                                
sage: t['^μ_μ']                                                                 
Scalar field on the Euclidean plane E^2
sage: t['^μ_μ'] == t.trace()                                                    
True

Dot and cross products of vector fields along a curve

The methods dot_product(), cross_product() and norm() can be now be used for vector fields defined along a differentiable map, the codomain of which is a Riemannian manifold (#30318). Previously, these methods worked only for vector fields on a Riemannian manifold, i.e. along the identity map. An important subcase is of course that of a curve in a Riemannian manifold. For instance, let us consider a helix C in the Euclidean space E3 parametrized by its arc length s:

sage: E.<x,y,z> = EuclideanSpace()
sage: R.<s> = RealLine()
sage: C = E.curve((2*cos(s/3), 2*sin(s/3), sqrt(5)*s/3), (s, -oo, +oo),
....:             name='C')
sage: C.display()                                                               
C: R --> E^3
   s |--> (x, y, z) = (2*cos(1/3*s), 2*sin(1/3*s), 1/3*sqrt(5)*s)

The tangent vector field T=C' has a unit norm since the parameter s is the arc length:

sage: T = C.tangent_vector_field()
sage: T.display()
C' = -2/3*sin(1/3*s) e_x + 2/3*cos(1/3*s) e_y + 1/3*sqrt(5) e_z
sage: norm(T)
Scalar field |C'| on the Real interval (0, 6*pi)
sage: norm(T).expr()
1

We introduce the unit normal vector N via the derivative of T:

sage: T_prime = R.vector_field([diff(T[i], s) for i in E.irange()], dest_map=C,
....:                          name="T'")
sage: N = T_prime / norm(T_prime) 
sage: N.display()                                                               
-cos(1/3*s) e_x - sin(1/3*s) e_y

and we get the binormal vector B as the cross product of T and N:

sage: B = T.cross_product(N)
sage: B
Vector field along the Real number line R with values on the Euclidean space E^3
sage: B.display()                                                               
1/3*sqrt(5)*sin(1/3*s) e_x - 1/3*sqrt(5)*cos(1/3*s) e_y + 2/3 e_z

We can then form the Frenet-Serret frame:

sage: FS = R.vector_frame(('T', 'N', 'B'), (T, N, B),
....:                     symbol_dual=('t', 'n', 'b'))
sage: FS
Vector frame (R, (T,N,B)) with values on the Euclidean space E^3

and check that it is orthonormal:

sage: matrix([[u.dot(v).expr() for v in FS] for u in FS])                       
[1 0 0]
[0 1 0]
[0 0 1]

The Frenet-Serret formulas, expressing the curvature and torsion of C, are obtained as:

sage: N_prime = R.vector_field([diff(N[i], s) for i in E.irange()],
....:                          dest_map=C, name="N'")
sage: B_prime = R.vector_field([diff(B[i], s) for i in E.irange()],
....:                          dest_map=C, name="B'")
sage: for v in (T_prime, N_prime, B_prime): 
....:     v.display(FS) 
....:                                                                           
T' = 2/9 N
N' = -2/9 T + 1/9*sqrt(5) B
B' = -1/9*sqrt(5) N

Orientability of manifolds and vector bundles

It is now possible to define an orientation on a differentiable manifold and on a vector bundle (#30178). Orientations of topological manifolds have also been introduced, according to this definition.

Euclidean spaces as metric spaces

Euclidean spaces have been endowed with a distance function and have been set in the category of complete metric spaces (#30062):

sage: E.<x,y> = EuclideanSpace()
sage: p = E((1,0))  # the point of coordinates (1,0)
sage: q = E((0,2))  # the point of coordinates (0,2)
sage: d = E.dist  # the distance function
sage: d(p,q)
sqrt(5)
sage: p.dist(q)
sqrt(5)
sage: E.category()
Join of Category of smooth manifolds over Real Field with 53 bits of precision and Category of complete metric spaces

Bundle connections

Bundle connections have been improved (#30208) and their action on vector fields and sections has been implemented (#30209).

Internal code improvements and bug fixes

Many improvements/refactoring of the code have been performed in this release:

In addition, various bugs have been fixed: #30108, #30112, #30191, #30289.

Algebra

Lie Conformal Algebras

Implemented Lie conformal algebras and superalgebras. Here are some examples of their usage:

sage: V = lie_conformal_algebras.Virasoro(QQ); V
The Virasoro Lie conformal algebra over Rational Field
sage: V.inject_variables()
Defining L, C
sage: L.bracket(L)
{0: TL, 1: 2*L, 3: 1/2*C}
sage: L.T(2).bracket(L)
{2: 2*TL, 3: 12*L, 5: 10*C}

sage: V = lie_conformal_algebras.NeveuSchwarz(QQ)
sage: V.some_elements()
[L, G, C, TG, TG + 4*T^(2)G, 4*T^(2)G]

sage: W = lie_conformal_algebras.FreeFermions(QQbar, 2); W
The free Fermions super Lie conformal algebra with generators (psi_0, psi_1, K) over Algebraic Field
sage: W.inject_variables()
Defining psi_0, psi_1, K
sage: psi_0.bracket(psi_1.T())
{}
sage: psi_0.bracket(psi_0.T())
{1: K}
sage: psi_0.is_even_odd()
1

For documentation on implemented features see Lie Conformal Algebra. For a list of implemented examples see Lie Conformal Algebra Examples.

Improved Unicode support

Unicode identifiers

Python 3 made much improved support for Unicode available, and Sage 9.2 has merged several Unicode improvements. Note that Python does not allow arbitrary Unicode characters in identifiers but only word constituents. So before you get excited about using emojis... note that they cannot be used:

   1 sage: K.<🍎,🥝> = QQ[]
   2 SyntaxError: invalid character in identifier

However, we can use letters from various alphabets. The updated IPython allows us to type them using latex and unicode tab completion:

   1 sage: μ, ν, ξ = 1, 2, 3       # type \mu<TAB>, 
   2                               #      \nu<TAB>, ...
   3 sage: SR('λ + 2λ')
   4 3*λ
   5 sage: var('α', domain='real')
   6 α
   7 sage: Ш = EllipticCurve('389a').sha()   
   8                               # type \CYR<TAB> CAP<TAB>
   9                               #      LET<TAB> SHA<TAB><ENTER>
  10 sage: Ш
  11 Tate-Shafarevich group for the Elliptic Curve
  12 defined by y^2 + y = x^3 + x^2 - 2*x over Rational Field
  13 sage: GelʹfandT͡setlinPattern = GelfandTsetlinPattern
  14                               # type \MODIFIER LETTER 
  15                               #      PRIME<TAB><ENTER>
  16                               # for the romanized soft mark
  17 sage: ГельфандЦетлинPattern = GelʹfandT͡setlinPattern
  18 sage: ГельфандЦетлинPattern([[3, 2, 1], [2, 1], [1]]).pp()
  19   3     2     1
  20      2     1
  21         1
  22 sage: 四次方(x) = x^4
  23 sage: 四次方(3)
  24 81

We can use math accents...

   1 sage: a = 1
   2 sage: â = 2                   # type a\hat<TAB><ENTER>
   3 sage: ā = 3                   # type a\bar<TAB><ENTER>
   4 sage: a, â, ā
   5 (1, 2, 3)
   6 sage: s(t) = t^3; s
   7 t |--> t^3
   8 sage:  = diff(s, t);        # type s\dot<TAB><ENTER>                                                                                
   9 t |--> 3*t^2
  10 sage:  = diff(, t);        # type s\ddot<TAB><ENTER>                                                                                                   
  11 t |--> 6*t

... and have fun with modifier letters:

   1 sage: ℚ̄ = QQbar               # type \bbQ<TAB>\bar<TAB>
   2 sage: %display unicode_art
   3 sage: A = matrix(ℚ̄, [[1, 2*I], [3*I, 4]]); A
   4 1 2*I
   5 3*I   4
   6 sage: Aᵀ = A.transpose()      # type A\^T<TAB><ENTER>
   7 sage: Aᵀ                                                                                                                     
   8 1 3*I
   9 2*I   4
  10 sage: Aᴴ = A.conjugate_transpose()
  11                               # type A\^H<TAB><ENTER>
  12 sage: Aᴴ
  13 1 -3*I
  14 ⎝-2*I    4
  15 sage: C = Cone([[1, 1], [0, 1]])                                                                           
  16 sage: Cᵒ = C.dual(); Cᵒ       # type C\^o<TAB><ENTER>
  17 2-d cone in 2-d lattice M                                                                                        

But note that Python normalizes identifiers, so the following variants are not distinguished:

   1 sage: AT == Aᵀ, AH == Aᴴ, Co == Cᵒ                                                                                                   
   2 (True, True, True)
   3 sage:  = QQ                  # type \bbQ<TAB><ENTER>
   4 sage: 
   5 Rational Field
   6 sage: Q = 42
   7 sage: 
   8 42
   9 sage: F = 1
  10 sage: 𝐹, 𝐅, 𝓕, 𝕱, 𝗙, 𝘍, 𝙁, 𝙵 # type \itF<TAB>, \bfF<TAB>,
  11                               #      \scrF<TAB>, \frakF<TAB>,
  12                               #      \sansF<TAB>, ...
  13 (1, 1, 1, 1, 1, 1, 1, 1)

We have also added a few Unicode aliases for global constants and functions.

   1 sage: π
   2 pi
   3 sage: _.n()
   4 3.14159265358979
   5 sage: Γ(5/2)                                                                                                                    
   6 3/4*sqrt(pi)
   7 sage: ζ(-1)
   8 -1/12

See Meta-ticket #30111: Unicode support for more information.

Unicode art

Configuration and build changes

Sage 9.1 introduced informational messages at the end of a ./configure run regarding system packages. To make sure that these messages are not overlooked, Sage 9.2 no longer invokes ./configure when you type make in an unconfigured source tree. See sage-devel: require "./configure" before "make", #29316.

All standard Sage packages have been upgraded in Sage 9.2 so that they build correctly using gcc/gfortran 10.x. The Sage ./configure script therefore now accepts these compiler versions.

For developers: Changes to the build system of sagelib

Let's talk about src/setup.py. The build system of the Sage library is based on distutils (not setuptools); it is implemented in the package sage_setup. In particular, it implements its own version of source code discovery methods similar to setuptools.find_packages: sage_setup.find.find_python_sources. Because of source discovery, developers can add new Python modules and packages under src/sage/ simply by creating files and directories; it is not necessary to edit setup.py.

Prior to Sage 9.2, the situation was different for Cython extensions. They had to be listed in src/module_list.py, either one by one, or using glob patterns such as * and **. Sage 9.2 has eliminated the need for src/module_list.py by extending sage_setup.find.find_python_sources; it now also finds Cython modules in the source tree (Trac #29701).

Some Cython modules need specific compiler and linker flags. Sage 9.2 has moved all of these flags from Extension options in src/module_list.py to distutils: directives in the individual .pyx source files, see #29706 and Cython documentation.

Sage 9.2 has also changed the mechanism for conditionalizing a Cython extension module on the presence of a Sage package. Consider the module sage.graphs.graph_decompositions.tdlib as an example. Prior to Sage 9.2, this module was declared as an OptionalExtension, conditional on the SPKG tdlib, in src/module_list.py. The new mechanism is as follows. src/setup.py maps the SPKG name tdlib to the "distribution name" sage-tdlib. At the top of the Cython source file src/sage/graphs/graph_decompositions/tdlib.pyx, there is a new directive sage_setup: distribution = sage-tdlib. Now the source discovery in sage_setup.find.find_python_sources includes this Cython module only if the SPKG tdlib is installed and current.

Cleaning

Availability of Sage 9.2 and installation help

Sage 9.2 has not been released yet. See sage-release for announcements of beta versions and release candidates.

More details