11478
Comment: sagemath-standard on pypi
|
14014
Modularization
|
Deletions are marked like this. | Additions are marked like this. |
Line 180: | Line 180: |
The Sage library is now available as a [[https://pypi.org/project/sagemath-standard/|source distribution sagemath-standard]] on PyPI. * [[https://trac.sagemath.org/ticket/29705|Meta-ticket #29705: Modularize sagelib into separate distutils packages]] |
A source tarball of the Sage distribution (or a worktree of the Sage git repository after running the `./bootstrap` script) contains several self-contained source trees of Python distribution packages in `build/pkgs/*/src/`, which can be packaged, built and installed by standard Python procedures: * `setup.py sdist` builds a source distribution (it is invoked by the convenience script `build/pkgs/*/spkg-src`), which can afterwards be installed using `pip`. * `setup.py install` installs the package directly (this is legacy use of `setuptools` and is not recommended). * `setup.py bdist_wheel` builds a wheel, which can afterwards be installed using `pip`. * Note, however, that `pip install .` does not work. In order to keep the monolithic structure of the `SAGE_ROOT/src` tree unchanged (for the convenience of Sage developers), the source trees of the Python distribution packages make use of symlinks. These symlinks are not compatible with `pip install .`. However, `setup.py sdist` follows the symlinks - the resulting source distribution contains ordinary files only and is therefore pip-installable. The following Python distribution packages exist in Sage 9.3: * The Sage library is built from `build/pkgs/sagelib/src`. Since 9.3.beta8, the resulting [[https://pypi.org/project/sagemath-standard/|source distribution sagemath-standard]] is available on PyPI. * `build/pkgs/sage_docbuild/src` contains a distribution that provides the Python package `sage_docbuild`, moved from `sage_setup.docbuild` in [[https://trac.sagemath.org/ticket/30476|#30476]] * `build/pkgs/sage_sws2rst/src` contains the source of https://pypi.org/project/sage-sws2rst/ * `build/pkgs/sage_conf/src` (after running the top-level `configure` script) contains the source of the [[https://trac.sagemath.org/ticket/21707|Sage configuration package]], which provides: * a single Python module, `sage_conf`, providing configuration information to the SageMath library at the time of its installation and at its runtime * a console script `sage-config`, for querying the variables of `sage_conf` from the shell * the sourcable shell script `sage-env-config`, providing additional configuration information in the form of environment variables. In the course of the modularization effort of [[https://trac.sagemath.org/ticket/29705|Meta-ticket #29705]], in the Sage 9.4 series we expect to add many more distribution packages in the same format. * Splitting out `sage_setup` (the build system of the Sage library) as a separate distribution package (currently it is shipped as part of `sagemath-standard`). * Providing alternative implementations of `sage_conf` for different use cases. * Splitting `sagemath-standard` into many namespace packages. |
Sage 9.3 Release Tour
in progress (2021)
Contents
Polyhedral geometry
New features
The Schlegel diagrams are now repaired (they previously broke convexity). Now, one specifies which facet to use to do the projection 30015:
1 sage: fcube = polytopes.hypercube(4)
2 sage: tfcube = fcube.face_truncation(fcube.faces(0)[0])
3 sage: tfcube.facets()[-1]
4 A 3-dimensional face of a Polyhedron in QQ^4 defined as the convex hull of 8 vertices
5 sage: sp = tfcube.schlegel_projection(tfcube.facets()[-1])
6 sage: sp.plot() # The proper Schlegel diagram is shown
A different values of position changes the projection:
New features:
30704: Upgrade to Normaliz 3.8.9 and PyNormaliz 2.13
30946: Add "minimal=True" option to affine_hull_projection
30954: Implement a proper equality check for polyhedron representation objects
Implementation improvements
The zonotope construction got improved:
Before:
sage: from itertools import combinations sage: cu = polytopes.cube() sage: sgmt = [p.vector()-q.vector() for p,q in combinations(cu.vertices(),2)] sage: sgmt2 = set(tuple(x) for x in sgmt) sage: # %time polytopes.zonotope(sgmt) # killed due to memory overflow sage: %time polytopes.zonotope(sgmt2) CPU times: user 2.06 s, sys: 23.9 ms, total: 2.09 s Wall time: 2.09 s A 3-dimensional polyhedron in ZZ^3 defined as the convex hull of 96 vertices
With 31038:
sage: from itertools import combinations sage: cu = polytopes.cube() sage: sgmt = [p.vector()-q.vector() for p,q in combinations(cu.vertices(),2)] sage: sgmt2 = set(tuple(x) for x in sgmt) sage: %time polytopes.zonotope(sgmt) CPU times: user 138 ms, sys: 0 ns, total: 138 ms Wall time: 138 ms A 3-dimensional polyhedron in ZZ^3 defined as the convex hull of 96 vertices sage: %time polytopes.zonotope(sgmt2) CPU times: user 58 ms, sys: 0 ns, total: 58 ms Wall time: 57.6 ms A 3-dimensional polyhedron in ZZ^3 defined as the convex hull of 96 vertices
Improvements:
30040: Improve face iterator for simple/simplicial polytopes
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.
Graph theory
Major improvements in the backends:
30777: Deleting edges
30665: Edge iterator and copy
30776: Subgraph and equality check
30753: Obtaining subgraphs.
31129: Depth first search
31197: Use binary matrix data structure for bitsets.
Algebra
Package upgrades, system packages, user packages
Python
SageMath 9.3 continues to support system Python versions 3.6.x, 3.7.x, 3.8.x, and 3.9.x. If no suitable system Python is found, Sage installs its own copy of Python 3 from source. The version of Python shipped with the Sage distribution has been upgraded from 3.8.5 to 3.9.1. #30589
FLINT, Arb
GAP
Other package upgrades
Upgrade tickets, milestone 9.3
System package information for OpenSUSE
In particular, users of OpenSUSE Tumbleweed will notice the information about system packages that the Sage distribution can use.
Chapter on packages in the Sage reference manual
We have consolidated the information about packages into a single source, build/pkgs/ in the source tree, from which we generate package lists for the reference manual #29655, to which also the Sage website points.
A number of user packages have been added as optional packages: ore_algebra, sage_flatsurf, admcycles, slabbe, snappy, surface_dynamics. Meta-ticket #31164 tracks the task of adding user packages to build/pkgs/.
For developers and packagers: Version constraints for Python packages
For all Python packages in the Sage distribution, build/pkgs/SPKG/install-requires.txt now encodes version constraints (such as lower and upper bounds) #30719. The constraints are in the format of the install_requires key of setup.cfg or setup.py.
The files may include comments (starting with #) that explain why a particular lower bound is warranted or why we wish to include or reject certain versions. For example:
$ cat build/pkgs/sphinx/package-version.txt 3.1.2.p0 $ cat build/pkgs/sphinx/install-requires.txt # gentoo uses 3.2.1 sphinx >=3, <3.3
The comments may include links to Trac tickets, as in the following example:
$ cat build/pkgs/packaging/install-requires.txt packaging >=18.0 # Trac #30975: packaging 20.5 is known to work but we have to silence "DeprecationWarning: Creating a LegacyVersion"
The currently encoded version constraints are merely a starting point. Downstream packagers and developers are invited to refine the version constraints based on their experience and tests. When a package update is made in order to pick up a critical bug fix from a newer version, then the lower bound should be adjusted.
In Sage 9.3, the new files are included only for documentation purposes and to facilitate development and packaging. An effort is underway in #30913 to use the new files to generate dependency metadata for the Sage library. There is no mechanism yet to use system Python packages; see Meta-ticket #29013 for this task.
For developers: Setting up Python packages from PyPI as Sage packages
Setting up Python packages from PyPI as Sage packages has become easier #30974.
$ ./sage -package create scikit_spatial --pypi Downloading tarball to /Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/upstream/scikit-spatial-5.0.0.tar.gz [......................................................................] $ ls build/pkgs/scikit_spatial/ SPKG.rst dependencies package-version.txt type checksums.ini install-requires.txt spkg-install.in $ cat build/pkgs/scikit_spatial/SPKG.rst scikit_spatial: Spatial objects and computations based on NumPy arrays ====================================================================== Description ----------- Spatial objects and computations based on NumPy arrays. License ------- BSD license Upstream Contact ---------------- https://pypi.org/project/scikit-spatial/
Note that this new command does not check the dependencies of the Python package; this still needs to be done manually.
The above command creates a "normal" package (with tarball information in checksums.ini). To create a package as a "pip" package (which will be obtained directly from PyPI on an install), use ./sage -package create scikit_spatial --pypi --source pip instead.
Modularization and packaging of sagelib
A source tarball of the Sage distribution (or a worktree of the Sage git repository after running the ./bootstrap script) contains several self-contained source trees of Python distribution packages in build/pkgs/*/src/, which can be packaged, built and installed by standard Python procedures:
setup.py sdist builds a source distribution (it is invoked by the convenience script build/pkgs/*/spkg-src), which can afterwards be installed using pip.
setup.py install installs the package directly (this is legacy use of setuptools and is not recommended).
setup.py bdist_wheel builds a wheel, which can afterwards be installed using pip.
Note, however, that pip install . does not work. In order to keep the monolithic structure of the SAGE_ROOT/src tree unchanged (for the convenience of Sage developers), the source trees of the Python distribution packages make use of symlinks. These symlinks are not compatible with pip install .. However, setup.py sdist follows the symlinks - the resulting source distribution contains ordinary files only and is therefore pip-installable.
The following Python distribution packages exist in Sage 9.3:
The Sage library is built from build/pkgs/sagelib/src. Since 9.3.beta8, the resulting source distribution sagemath-standard is available on PyPI.
build/pkgs/sage_docbuild/src contains a distribution that provides the Python package sage_docbuild, moved from sage_setup.docbuild in #30476
build/pkgs/sage_sws2rst/src contains the source of https://pypi.org/project/sage-sws2rst/
build/pkgs/sage_conf/src (after running the top-level configure script) contains the source of the Sage configuration package, which provides:
a single Python module, sage_conf, providing configuration information
to the SageMath library at the time of its installation and at its runtime
a console script sage-config, for querying the variables of sage_conf
- from the shell
the sourcable shell script sage-env-config, providing additional configuration
- information in the form of environment variables.
In the course of the modularization effort of Meta-ticket #29705, in the Sage 9.4 series we expect to add many more distribution packages in the same format.
Splitting out sage_setup (the build system of the Sage library) as a separate distribution package (currently it is shipped as part of sagemath-standard).
Providing alternative implementations of sage_conf for different use cases.
Splitting sagemath-standard into many namespace packages.
Use of system Jupyter notebook / JupyterLab
The Sage Installation Manual now has instructions on how to run the SageMath jupyter kernel in a system jupyter notebook or JupyterLab #30476
Tickets
Availability of Sage 9.3 and installation help
Development of the Sage 9.3 series has begun.
See sage-devel for development discussions.