Status of modularization and packaging in Sage 9.3.beta9

86 views
Skip to first unread message

Matthias Koeppe

unread,
Mar 14, 2021, 8:44:19 PM3/14/21
to sage-devel

A quick overview of the status of the modularization effort of Meta-ticket #29705 in Sage 9.3.beta9.

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. Since 9.3.beta9, the resulting source distribution sage-docbuild is available on PyPI.

  • 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.

I hope that we can still merge the following tickets in Sage 9.3, which are waiting for review:

  • #30913: Generate pyproject.toml and setup.cfg [install_requires], requirements.txt, Pipfile, and src/Pipfile
  • #29039: pip-installable version of package sage_conf - installs non-Python bits of the Sage distribution in ~/.sage/
  • #30383: Add configure --disable-notebook; show descriptions of optional packages in configure --help

(see https://trac.sagemath.org/ticket/29705 for more details)


Antonio Rojas

unread,
Mar 15, 2021, 9:51:43 AM3/15/21
to sage-devel
El lunes, 15 de marzo de 2021 a las 1:44:19 UTC+1, Matthias Koeppe escribió:

A quick overview of the status of the modularization effort of Meta-ticket #29705 in Sage 9.3.beta9.

What are the plans for the top-level setup.py? I noticed that it no longer installs sagelib in beta9, just the executables and sage-ext. It would be nice if it could be turned into a sort of meta-script that installed everything or, better yet, if one could specify which parts to install (eg. 'python setup.py build sagelib docbuild')

Matthias Koeppe

unread,
Mar 15, 2021, 12:26:50 PM3/15/21
to sage-devel
On Monday, March 15, 2021 at 6:51:43 AM UTC-7 Antonio Rojas wrote:
El lunes, 15 de marzo de 2021 a las 1:44:19 UTC+1, Matthias Koeppe escribió:

A quick overview of the status of the modularization effort of Meta-ticket #29705 in Sage 9.3.beta9.

What are the plans for the top-level setup.py?

If you are referring to the file src/setup.py: It is used by the Sage distribution for installing sagelib when you use "./configure --enable-editable". (See https://wiki.sagemath.org/ReleaseTours/sage-9.3#Editable_.28.22in-place.22.2C_.22develop.22.29_installs_of_the_Sage_library)
 
It would be nice if it could be turned into a sort of meta-script that installed everything or, better yet, if one could specify which parts to install (eg. 'python setup.py build sagelib docbuild')

I have a different design for this, which uses Python dependencies. Needs review in https://trac.sagemath.org/ticket/30913


 

François Bissey

unread,
Apr 13, 2021, 9:28:06 PM4/13/21
to sage-...@googlegroups.com
I am looking at moving to the modular setup for sage-on-gentoo during the 9.4 cycle.
I am already experimenting and feeling stuff out.
I have already expressed concerns once about building documentation.
I now have some idea on how to build the documentation in sage-on-gentoo. But the doc
folder is not distributed in sage math-standard. Could we have at least a tarball for
the doc sources currently sitting under “src/doc”?

François
> --
> You received this message because you are subscribed to the Google Groups "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/f4672d2d-ae7d-4b94-8697-c945ad961ac8n%40googlegroups.com.

Matthias Koeppe

unread,
Apr 14, 2021, 12:26:57 AM4/14/21
to sage-devel
On Tuesday, April 13, 2021 at 6:28:06 PM UTC-7 François Bissey wrote:
I am looking at moving to the modular setup for sage-on-gentoo during the 9.4 cycle. [...]

I now have some idea on how to build the documentation in sage-on-gentoo. But the doc
folder is not distributed in sage math-standard. Could we have at least a tarball for
the doc sources currently sitting under “src/doc”?

Yes, see ticket https://trac.sagemath.org/ticket/29868, which defines Python distributions for the documentation.


 

François Bissey

unread,
Apr 14, 2021, 12:45:19 AM4/14/21
to sage-...@googlegroups.com
I guess right now I am just after sagemath-doc-src as defined on https://trac.sagemath.org/ticket/29868
although I am not excluding using sagemath-doc-html and sagemath-doc-pdf once they become available,
especially for stable releases.
But right now I am still doing stuff by source building.

Also, I was expecting sagemath-standard to be a sdist for sagelib. I noticed a few differences,
most notably the use of a file called `sage_setup/setenv.py`. I cannot find it anywhere else but
that pypi tarball. Is it something that disappeared in 9.3rc3 or something that lives somewhere else?

François


Matthias Koeppe

unread,
Apr 14, 2021, 12:52:07 AM4/14/21
to sage-devel
On Tuesday, April 13, 2021 at 9:45:19 PM UTC-7 François Bissey wrote:

I guess right now I am just after sagemath-doc-src as defined on https://trac.sagemath.org/ticket/29868
although I am not excluding using sagemath-doc-html and sagemath-doc-pdf once they become available,
especially for stable releases.
But right now I am still doing stuff by source building.

Also, I was expecting sagemath-standard to be a sdist for sagelib.

No, for 9.3 please don't consider release tarballs on PyPI the project upstream.
What I put on PyPI is experimental for Sage 9.3 (the READMEs on PyPI note this) and uses a few additional tickets which don't look like they'll make it into the 9.3 release. See https://trac.sagemath.org/ticket/29705 for more information.
 
I noticed a few differences,
most notably the use of a file called `sage_setup/setenv.py`. I cannot find it anywhere else but
that pypi tarball. Is it something that disappeared in 9.3rc3 or something that lives somewhere else?


See above; this one is from ticket https://trac.sagemath.org/ticket/31338 (needs review).

 

François Bissey

unread,
Apr 14, 2021, 1:18:32 AM4/14/21
to sage-...@googlegroups.com
Just to be clear, I am not going to release a sage-on-gentoo 9.3 out of those.
I am playing around to see what it will looks like. I like planning ahead and
frankly, with some of the stuff that has been going on around me, that’s literally
a way to relax.
I might want to give #31338 some distro love because there are reasons why that file
was suddenly on my radar. Bonus point if you figure out why before I explain it :)

François

Reply all
Reply to author
Forward
0 new messages