Skip to content

Modularization of sagelib: Break out separate packages sagemath-objects, sagemath-categories #29865

@mkoeppe

Description

@mkoeppe

This ticket creates two experimental packages https://pypi.org/project/sagemath-objects/ and https://pypi.org/project/sagemath-categories/, outlined in Meta-ticket #29705, that consist of small subsets of the modules of sagelib, making Sage objects, the element/parent framework, categories, the coercion system and the related metaclasses available.

To build an sdist:

./sage -sh build/pkgs/sagemath_objects/spkg-src
./sage -sh build/pkgs/sagemath_categories/spkg-src

This creates a pip-installable source distribution sagemath-objects-VERSION.tar.gz (or sagemath-categories-VERSION.tar.gz) in upstream/.

The distributions depend only on Cython, pkgconfig, cysignals, gmpy2. The latter, of course, requires various headers and libraries, so they are not quite "purely" pip-installable packages.

The goal is for all modules of sagemath-objects and sagemath-categories to be importable even when sagelib is not installed. This can be tested (with tox) as follows:

./bootstrap && ./sage -sh -c '(cd build/pkgs/sagemath_objects/src && tox -v -v -e py39)'
./bootstrap && ./sage -sh -c '(cd build/pkgs/sagemath_categories/src && tox -v -v -e py39)'

sagemath-categories is intended to have sagemath-objects as a prerequisite. However, currently, sagemath-categories is an independent distribution that provides a superset of the modules of sagemath-objects.

Recombining it with the rest of sagelib via namespace package magic as outlined in #29705 is not implemented on this ticket. This will be done in follow-up tickets.

Depends on #29039
Depends on #32933

CC: @videlec @tscrim @orlitzky @nthiery @timokau @fchapoton @tobiasdiez @kwankyu @vbraun

Component: refactoring

Keywords: sd111

Author: Matthias Koeppe

Branch/Commit: 36d6b09

Reviewer: Kwankyu Lee

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions