sagemath/sage

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

Closed this issue · 233 comments

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

Description changed:

--- 
+++ 
@@ -2,4 +2,5 @@
 
 On top of it, this ticket experiments with breaking out the fundamental package `sage-objects`, outlined in Meta-ticket #29705.
 
+The goal is for all modules of `sage-objects` to be importable even when `sagelib` is not installed.
 

Description changed:

--- 
+++ 
@@ -2,5 +2,5 @@
 
 On top of it, this ticket experiments with breaking out the fundamental package `sage-objects`, outlined in Meta-ticket #29705.
 
-The goal is for all modules of `sage-objects` to be importable even when `sagelib` is not installed.
+The goal is for all modules of `sage-objects` to be importable even when `sagelib` is not installed.  We test this with tox.
 

Branch pushed to git repo; I updated commit sha1. New commits:

889f0c6sage.env.sage_include_directories: Do not fail if numpy cannot be imported
dd3dc15build/pkgs/sage_objects: Add dependencies, get minimal tox working

Branch pushed to git repo; I updated commit sha1. New commits:

4a99c1cAdd comment
b72264eWIP: More stuff

Changed commit from dd3dc15 to b72264e

Description changed:

--- 
+++ 
@@ -4,3 +4,11 @@
 
 The goal is for all modules of `sage-objects` to be importable even when `sagelib` is not installed.  We test this with tox.
 
+To test:
+
+```
+./sage -pip install tox
+./sage -sh -c '(cd build/pkgs/sage_objects/src && tox)'
+```
+
+

Changed commit from b72264e to 23aaec1

Branch pushed to git repo; I updated commit sha1. New commits:

23aaec1Version with sage.structure, sage.categories that builds OK; uses gmpy2

Changed dependencies from #29864 to #29864, #29869

Changed commit from 23aaec1 to 29e30a4

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

cbc5555sage.misc.misc, sage.misc.persist, sage.structure.formal_sum: Make some imports local to functions
0b7e11fOn the way to get sage.structure.all importing
19f86dcsage.env: Do not die if DOT_SAGE is None
a795d56sage.structure.factorization: Make import of sage.rings.integer.Integer local to methods
0ce9916sage.structure.sequence: Make import of sage.misc.latex local to the latex method
fa22e19sage.structure.all: Import .formal_sum lazily to avoid pulling in sage.modules
acf1ba3sage.structure.factorization: Make import of sage.misc.misc_c.prod local to methods
14b1e55sage.structure.formal_sum, .parent_gens: Fixup: Remove imports
a5453bfFixup: Add src/sage/misc/call.py
29e30a4Merge branch 't/29869/move_attrcall_and_friends_from_sage_misc_misc_to_new_module_sage_misc_call' into t/29865-modularizarion-sage-objects
comment:11

import sage.structure.all succeeds now

Branch pushed to git repo; I updated commit sha1. New commits:

c4a68e3build/pkgs/sage_objects/src/tox.ini: Add comments, test more

Changed commit from 29e30a4 to c4a68e3

comment:13

Some of the Python modules in sage.categories seem to be sensitive to import order.

$ build/pkgs/sage_objects/src/.tox/python/bin/python -c 'import sage.categories.map'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "sage/categories/map.pyx", line 1, in init sage.categories.map (build/cythonized/sage/categories/map.c:16980)
  File "/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/build/pkgs/sage_objects/src/.tox/python/lib/python3.7/site-packages/sage/structure/__init__.py", line 2, in <module>
    import sage.structure.element
  File "sage/structure/parent.pxd", line 12, in init sage.structure.element (build/cythonized/sage/structure/element.c:34583)
  File "sage/categories/map.pxd", line 4, in init sage.structure.parent (build/cythonized/sage/structure/parent.c:27689)
AttributeError: module 'sage.categories.map' has no attribute 'Map'

vs.

$ build/pkgs/sage_objects/src/.tox/python/bin/python -c 'import sage.structure.all, sage.categories.map'
# succeeds

Changed commit from c4a68e3 to 7cca294

Branch pushed to git repo; I updated commit sha1. New commits:

1963567sage.categories.crystals: Make import of sage.misc.latex local to a method
c557714sage.categories: Make imports from sage.rings, .sets, .combinat, .plot, .matrix local to methods
7cca294Now we can import sage.categories.all
comment:15
$ build/pkgs/sage_objects/src/.tox/python/bin/python -c 'import sage.structure.all, sage.categories.all'
# succeeds

but does not succeed without importing sage.structure.all first...

comment:16
build/pkgs/sage_objects/src/.tox/python/bin/python -c 'import sage.structure.all, sage.categories.all, sage.categories.facade_sets; sage.categories.facade_sets.FacadeSets().example()'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "sage/misc/classcall_metaclass.pyx", line 322, in sage.misc.classcall_metaclass.ClasscallMetaclass.__call__ (build/cythonized/sage/misc/classcall_metaclass.c:1717)
  File "/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/build/pkgs/sage_objects/src/.tox/python/lib/python3.7/site-packages/sage/categories/category_with_axiom.py", line 1993, in __classcall__
    (base_category_class, axiom) = cls._base_category_class_and_axiom
  File "sage/misc/lazy_attribute.pyx", line 699, in sage.misc.lazy_attribute.lazy_class_attribute.__get__ (build/cythonized/sage/misc/lazy_attribute.c:2894)
  File "/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/build/pkgs/sage_objects/src/.tox/python/lib/python3.7/site-packages/sage/categories/category_with_axiom.py", line 1933, in _base_category_class_and_axiom
    base_category_class, axiom = base_category_class_and_axiom(cls)
  File "/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/build/pkgs/sage_objects/src/.tox/python/lib/python3.7/site-packages/sage/categories/category_with_axiom.py", line 1790, in base_category_class_and_axiom
    assert getattr(base_category_class, axiom, None) is cls, \
  File "sage/misc/lazy_import.pyx", line 498, in sage.misc.lazy_import.LazyImport.__get__ (build/cythonized/sage/misc/lazy_import.c:4236)
  File "sage/misc/lazy_import.pyx", line 188, in sage.misc.lazy_import.LazyImport.get_object (build/cythonized/sage/misc/lazy_import.c:2340)
  File "sage/misc/lazy_import.pyx", line 217, in sage.misc.lazy_import.LazyImport._get_object (build/cythonized/sage/misc/lazy_import.c:2482)
RuntimeError: resolving lazy import FacadeSets during startup

Description changed:

--- 
+++ 
@@ -11,4 +11,5 @@
 ./sage -sh -c '(cd build/pkgs/sage_objects/src && tox)'
 ```
 
+So far this only creates a separate distutils package that consists of a small subset of the modules of sagelib.  Recombining it with the rest of sagelib via namespace package magic is not yet implemented.
 

Changed commit from 7cca294 to 2c2ddb7

Branch pushed to git repo; I updated commit sha1. New commits:

2c2ddb7build/pkgs/sage_objects/src/setup.py: Remove unused imports

Work Issues: Rebase on top of only #29702 and #29869

Changed work issues from Rebase on top of only #29702 and #29869 to Rebase on top of only #29702 and #29869 and perhaps #29847

Changed work issues from Rebase on top of only #29702 and #29869 and perhaps #29847 to Rebase on top of only #29702, #29701 and #29869 and perhaps #29847

Changed commit from 2c2ddb7 to 719cb6d

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

5d697cesage.structure.sequence: Make import of sage.misc.latex local to the latex method
dcb7c73sage.structure.all: Import .formal_sum lazily to avoid pulling in sage.modules
30d3647sage.structure.factorization: Make import of sage.misc.misc_c.prod local to methods
24b26d8sage.structure.formal_sum, .parent_gens: Fixup: Remove imports
5b98ba3build/pkgs/sage_objects/src/tox.ini: Add comments, test more
21baff3sage.categories.crystals: Make import of sage.misc.latex local to a method
90d3f6dsage.categories: Make imports from sage.rings, .sets, .combinat, .plot, .matrix local to methods
e88ceb4Now we can import sage.categories.all
ecc9415build/pkgs/sage_objects/src/setup.py: Remove unused imports
719cb6dbuild/pkgs/sage_objects/src/setup.py: Remove code for namespace packages and distribution filtering

Description changed:

--- 
+++ 
@@ -13,3 +13,6 @@
 
 So far this only creates a separate distutils package that consists of a small subset of the modules of sagelib.  Recombining it with the rest of sagelib via namespace package magic is not yet implemented.
 
+The package depends only on `Cython`, `pkgconfig`, `cysignals`, `gmpy2`. The latter, of course, requires various headers and libraries, so this is not quite a purely pip-installable library.
+
+

Changed work issues from Rebase on top of only #29702, #29701 and #29869 and perhaps #29847 to none

Changed dependencies from #29864, #29869 to #29702, #29701, #29869

Description changed:

--- 
+++ 
@@ -1,18 +1,16 @@
-#29864 provides a prototype implementation of separate distutils packages implementing namespace packages using the example `sage-tdlib`.
+This ticket creates an experimental package `sage-objects`, outlined in Meta-ticket #29705, that consists of a small subset of the modules of sagelib.  To build an sdist:
 
-On top of it, this ticket experiments with breaking out the fundamental package `sage-objects`, outlined in Meta-ticket #29705.
+```
+./sage -sh build/pkgs/sage_objects/spkg-src
+```
+This creates a pip-installable source distribution `sage-objects-VERSION.tar.gz` in `upstream/`.  The package depends only on `Cython`, `pkgconfig`, `cysignals`, `gmpy2`. The latter, of course, requires various headers and libraries, so this is not quite a "purely" pip-installable package.
 
-The goal is for all modules of `sage-objects` to be importable even when `sagelib` is not installed.  We test this with tox.
-
-To test:
+The goal is for all modules of `sage-objects` to be importable even when `sagelib` is not installed.  This can be tested with tox as follows.
 
 ```
 ./sage -pip install tox
 ./sage -sh -c '(cd build/pkgs/sage_objects/src && tox)'
 ```
 
-So far this only creates a separate distutils package that consists of a small subset of the modules of sagelib.  Recombining it with the rest of sagelib via namespace package magic is not yet implemented.
+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 on follow-up tickets.
 
-The package depends only on `Cython`, `pkgconfig`, `cysignals`, `gmpy2`. The latter, of course, requires various headers and libraries, so this is not quite a purely pip-installable library.
-
-

Description changed:

--- 
+++ 
@@ -1,4 +1,6 @@
-This ticket creates an experimental package `sage-objects`, outlined in Meta-ticket #29705, that consists of a small subset of the modules of sagelib.  To build an sdist:
+This ticket creates an experimental package `sage-objects`, outlined in Meta-ticket #29705, that consists of a small subset 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/sage_objects/spkg-src

Changed commit from 719cb6d to b9d2a51

Branch pushed to git repo; I updated commit sha1. New commits:

b9d2a51build/pkgs/sage_objects/: Add/update metadata

Branch pushed to git repo; I updated commit sha1. New commits:

354a07fbuild/pkgs/sage_objects/src/README.md: Add doc links

Changed commit from b9d2a51 to 354a07f

Branch pushed to git repo; I updated commit sha1. New commits:

5ec6042build/pkgs/sage_objects/spkg-install: Replace by the script from sage_tdlib

Changed commit from 354a07f to 5ec6042

Author: Matthias Koeppe

comment:32

As part of this ticket I made a number of changes to import statements throughout sage.categories.
https://github.com/sagemath/sagetrac-mirror/blob/5ec60422cff0e536e913c8e6306de45147b2f129/src/sage/categories/&id2=e2dcdeeabb578c37bcf0361c0be3079315e9252c

Should I put them on a separate ticket to facilitate review?

Changed dependencies from #29702, #29701, #29869 to #29702, #29701, #29869, #29873

comment:35

Replying to @mkoeppe:

As part of this ticket I made a number of changes to import statements throughout sage.categories.
https://github.com/sagemath/sagetrac-mirror/blob/5ec60422cff0e536e913c8e6306de45147b2f129/src/sage/categories/&id2=e2dcdeeabb578c37bcf0361c0be3079315e9252c

Should I put them on a separate ticket to facilitate review?

This is now #29873

comment:36

Can all of the functions/methods in sage-objects be run after a pip install, or is it only the import that works? (The existing doctests use various things from sage.all, so no one expects those to work.)

comment:37

This is unknown. Activating a part of the testsuite that can/does work, and finding the best way to test this, is TBD.
I hope some of it can be done through mocking (see #29874).

Work Issues: rebase on top of new tickets

Changed work issues from rebase on top of new tickets to rebase on top of new tickets, add CI workflow

Changed dependencies from #29702, #29701, #29869, #29873 to #29702, #29701, #29869, #29873, #29892

Changed dependencies from #29702, #29701, #29869, #29873, #29892 to #29702, #29701, #29869, #29873, #29892, #29883

Changed commit from 5ec6042 to 907c9f9

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

3060dddOn the way to get sage.structure.all importing
db1c595sage.env: Do not die if DOT_SAGE is None
8b134c0sage.structure.all: Import .formal_sum lazily to avoid pulling in sage.modules
cb0b850build/pkgs/sage_objects/src/tox.ini: Add comments, test more
ad502bbNow we can import sage.categories.all
d030578build/pkgs/sage_objects/src/setup.py: Remove unused imports
2cf8312build/pkgs/sage_objects/src/setup.py: Remove code for namespace packages and distribution filtering
3790abebuild/pkgs/sage_objects/: Add/update metadata
d67d4edbuild/pkgs/sage_objects/src/README.md: Add doc links
907c9f9build/pkgs/sage_objects/spkg-install: Replace by the script from sage_tdlib

Branch pushed to git repo; I updated commit sha1. New commits:

dc49119.github/workflows/tox-optional.yml: Test sage_objects

Changed commit from 907c9f9 to dc49119

Changed work issues from rebase on top of new tickets, add CI workflow to add tox dependency, add spkg-check

Branch pushed to git repo; I updated commit sha1. New commits:

3f5b6eaMove sage.misc.misc.coeff_repr, repr_lincomb to new module sage.misc.repr
08fedfasrc/sage/combinat/root_system/type_dual.py: Remove unused variable to fix pyflakes warning
05efc11sage.misc.repr.coeff_repr: Add doctest, adapted from sage.misc.latex.coeff_repr
34d38a5Merge branch 't/29892/move_sage_misc_misc_coeff_repr__repr_lincomb_to_new_module_sage_misc_repr' into t/29865-modularizarion-sage-objects
97199ddsage.structure.parent_gens: Remove imports
bb4c6a8sage.structure.sequence: Make import of sage.misc.latex local to the latex method
0820283sage.structure.factorization: Make import of sage.rings.integer.Integer local to methods
7991b64sage.structure.factorization: Make import of sage.misc.misc_c.prod local to methods
8ec06f0Merge branch 't/29883/sage_structure__remove_some_module_level_imports' into t/29865-modularizarion-sage-objects
152dac5build/pkgs/sage_objects/dependencies: Add more

Changed commit from dc49119 to 152dac5

comment:49

https://github.com/mkoeppe/sage/runs/785565655:

  [sage_objects-9.1.rc5]     File "setup.py", line 6, in <module>
  [sage_objects-9.1.rc5]       from sage_setup.command.sage_build_cython import sage_build_cython
  [sage_objects-9.1.rc5]     File "/sage/build/pkgs/sage_objects/src/sage_setup/command/sage_build_cython.py", line 19, in <module>
  [sage_objects-9.1.rc5]       from sage_setup.library_order import library_order
  [sage_objects-9.1.rc5]     File "/sage/build/pkgs/sage_objects/src/sage_setup/library_order.py", line 54, in <module>
  [sage_objects-9.1.rc5]       m4ri_pc = pkgconfig.parse('m4ri')
  [sage_objects-9.1.rc5]     File "/sage/local/lib/python3.7/site-packages/pkgconfig/pkgconfig.py", line 248, in parse
  [sage_objects-9.1.rc5]       _raise_if_not_exists(package)
  [sage_objects-9.1.rc5]     File "/sage/local/lib/python3.7/site-packages/pkgconfig/pkgconfig.py", line 103, in _raise_if_not_exists
  [sage_objects-9.1.rc5]       raise PackageNotFoundError(package)
  [sage_objects-9.1.rc5]   pkgconfig.pkgconfig.PackageNotFoundError: m4ri not found
  [sage_objects-9.1.rc5] Full log file: /sage/logs/pkgs/sage_objects-9.1.rc5.log
comment:50

Also, of course, installation of sage_objects breaks other things in the tests:

(build/cythonized/sage/plot/plot3d/shapes.c:12604)
  File "sage/ext/interpreters/wrapper_rdf.pxd", line 7, in init sage.plot.plot3d.parametric_surface (build/cythonized/sage/plot/plot3d/parametric_surface.c:12057)
ModuleNotFoundError: No module named 'sage.ext.interpreters.wrapper_rdf'

Description changed:

--- 
+++ 
@@ -7,11 +7,10 @@
 ```
 This creates a pip-installable source distribution `sage-objects-VERSION.tar.gz` in `upstream/`.  The package depends only on `Cython`, `pkgconfig`, `cysignals`, `gmpy2`. The latter, of course, requires various headers and libraries, so this is not quite a "purely" pip-installable package.
 
-The goal is for all modules of `sage-objects` to be importable even when `sagelib` is not installed.  This can be tested with tox as follows.
+The goal is for all modules of `sage-objects` to be importable even when `sagelib` is not installed.  This can be tested (with tox) as follows:
 
 ```
-./sage -pip install tox
-./sage -sh -c '(cd build/pkgs/sage_objects/src && tox)'
+./sage -f -c sage_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 on follow-up tickets.

Branch pushed to git repo; I updated commit sha1. New commits:

4867555build/pkgs/sage_objects: Do not install, only test with tox, for now
12788ddsage.misc.misc, sage.misc.persist, sage.structure.formal_sum: Make some imports local to functions

Changed commit from 152dac5 to 12788dd

comment:54

I'll probably make sage-objects smaller by only including sage.categories.category rather than all of sage.categories;
and add a package sage-categories that is larger than the current version, including also sage.rings.ring and similar abstract classes.
(On this ticket, sage-categories would just be a larger package whose MANIFEST.in is a superset of that of sage-objects. It will be done by dependencies later.)

Branch pushed to git repo; I updated commit sha1. New commits:

c845235sage.categories.all: Resolve a circular import
b982fdcbuild/pkgs/sage_objects/src/tox.ini: Add test

Changed commit from 12788dd to b982fdc

comment:56

This will need #29916 (sage.structure: Replace import of sage.categories.all by more specific imports)

Changed work issues from add tox dependency, add spkg-check to none

Changed commit from b982fdc to 0a5ded7

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

94ec3c9Add sage --package update-latest command
cb7a291Fixup rebase
1d36a2ebuild/bin/sage-system-python: Try python first
a91ecabMerge branch 't/29890/build_bin_sage_system_python__try__python__first' into t/20104/automatic_updates_of_pip_type_packages
ba6fbb5Merge branch 't/20104/automatic_updates_of_pip_type_packages' into t/29901/_github_workflows___test_all_optional_packages__add_workflow_for_testing_all_experimental_packages
4dc7367.github/workflows: Replace explicit optional/experimental lists by using sage-package
efb14c3Suppress linebreaks
bd703e4.github/workflows/tox-optional.yml: Do not test huge packages
d6e56e8Merge branch 't/29901/_github_workflows___test_all_optional_packages__add_workflow_for_testing_all_experimental_packages' into t/29865-modularizarion-sage-objects
0a5ded7build/pkgs/sage_categories: New (lightly edited copy of sage_objects)

Changed commit from 0a5ded7 to 77cae45

Branch pushed to git repo; I updated commit sha1. New commits:

77cae45build/pkgs/sage_objects: Only include the most basic categories

Changed commit from 77cae45 to f46acbd

Branch pushed to git repo; I updated commit sha1. New commits:

468c088build/pkgs/sage_objects: Install some scripts from bin
f46acbdbuild/pkgs/sage_objects: Add the doctester

Changed commit from f46acbd to 386bf91

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

210c1a7sage.plot: Import sage.misc.verbose
8a5e384Fix remaining imports of *verbose*
5632556src/sage/modular/modsym/relation_matrix_pyx.pyx: Fixup import
41d42e9sage.misc.verbose: Fix imports
b3af9e2sage.misc.verbose: Fix doctest
d8abdb0Fixup various imports and uses of verbose
db40fd5Fix pyflakes warnings regarding imports
b7da100Merge branch 't/29895/move_sage_misc_misc__verbose__to_new_module_sage_misc_verbose' into t/29865-modularizarion-sage-objects
9f7f65cBreak out *.all__sage_objects from sage.all, sage.misc.all, sage.categories.all
386bf91build/pkgs/sage_objects: WIP: Run doctester

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

ad00b40sage.doctest, src/bin/sage-runtests: Remove handling of sagenb
faef943Merge branch 't/29940/sage_doctest__remove_handling_of_sagenb' into t/29922/sage_doctest__make_imports_more_specific__make_global_environment_for_tests_customizable
67db00fsrc/bin/sage-runtests, sage.doctest: Handle option --environment
9bf6f88sage.doctest.control: Remove unused import
89988cfsage.doctest.forker.init_sage: Actually handle the optional arg
2664865sage.misc.package: Do not fail if SAGE_PKGS, SAGE_SPKG_INST do not exist
2a602dfsage.repl.display.fancy_repr: Do not fail if sage.matrix.matrix1 canno be imported
9e808daMerge branch '29922'
bdb162dsrc/sage: Move more to all__sage_objects.py
224ad51build/pkgs/sage_objects: Make doctesting work

Changed commit from 386bf91 to 224ad51

comment:66

Doctesting sage-objects now "works" thanks to #29922.
Of course, most doctests fail because all the concrete classes that are used in the examples are not defined. And the preparsed language also requires Integer and RealNumber, which we do not have.

comment:67

Replying to @mkoeppe:

I'll probably make sage-objects smaller by only including sage.categories.category rather than all of sage.categories;

this is done (but I temporarily added modules to do doctesting)

and add a package sage-categories that is larger than the current version, including also sage.rings.ring and similar abstract classes.

This is probably best to do if we can include Integer as well, so that depends on #29911 (remove ntl dependency)

Changed commit from 224ad51 to 5eafbc7

Branch pushed to git repo; I updated commit sha1. New commits:

14396afMerge tag '9.2.beta2' into t/29701/replace_use_of_module_list_optionalextension
5eafbc7Merge branch 't/29701/replace_use_of_module_list_optionalextension' into t/29865-modularizarion-sage-objects

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

a5bc828src/sage/misc/sageinspect.py: Fixup fixup
1baaa68src/sage/misc/sageinspect.py: Remove unused import
6734969Merge branch 't/29786/move_extension_options_from_src_module_list_py_to__distutils___directives_in_the_individual_files__part_4__sage_rings_' into t/29911/sage_rings_integer__integer_ring__remove_dependencies_on_sage_libs_ntl
5e9f00csrc/sage/rings/integer*.pyx: Remove 'libraries = ntl'
a9d4575Merge branch 't/29911/sage_rings_integer__integer_ring__remove_dependencies_on_sage_libs_ntl' into t/29865-modularizarion-sage-objects
e00aaecAdd from sage_objects MANIFEST.in
739b401Update from sage_objects tox.ini
8f78aa8sage.rings.ideal: Do not import sage.interfaces.singular at load time
bac135fbuild/pkgs/sage_categories/src/setup.cfg: Fix up
1e82b2dbuild/pkgs/sage_categories/src/MANIFEST.in: Add a bit from sage.rings

Changed commit from 5eafbc7 to 1e82b2d

Branch pushed to git repo; I updated commit sha1. New commits:

50a112cbuild/pkgs/sage_categories/src/bin: New symlink
fd81024build/pkgs/sage_categories/src/MANIFEST.in: More tweaks

Changed commit from 1e82b2d to fd81024

comment:72

Before we can add sage.rings.integer, we need #30022 (sage.rings.integer, rational: Remove compile-time dependency on cypari2 and flint).

Branch pushed to git repo; I updated commit sha1. New commits:

4271679Set up all__sage_categories.py

Changed commit from fd81024 to 4271679

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

0915137sage.rings.integer_ring.IntegerRing_class._coerce_ZZ: Remove, replaces uses by calls to ZZ_to_mpz
8468ad1src/sage/rings/integer*.pyx: Remove 'libraries = ntl'
62e2aa9Merge tag '9.2.beta6' into t/29911/sage_rings_integer__integer_ring__remove_dependencies_on_sage_libs_ntl
0f3cd7bMerge branch 't/29911/sage_rings_integer__integer_ring__remove_dependencies_on_sage_libs_ntl' into t/29865/t/29865-modularizarion-sage-objects
d62da15sage_setup.command.sage_build: Add the extensions to the distribution
06a3609sage_setup.find.find_python_sources: Add benchmark doctest
174626cMerge branch 't/29786/move_extension_options_from_src_module_list_py_to__distutils___directives_in_the_individual_files__part_4__sage_rings_' into t/29701/replace_use_of_module_list_optionalextension
034a7f7Merge branch 'public/move_all_code_from_src_setup_py__src_fpickle_setup_py_to_sage_setup' of git://trac.sagemath.org/sage into t/29701/replace_use_of_module_list_optionalextension
d3c608bMerge tag '9.2.beta3' into t/29701/replace_use_of_module_list_optionalextension
ef8b3a5Merge branch 't/29701/replace_use_of_module_list_optionalextension' into t/29865/t/29865-modularizarion-sage-objects

Changed commit from 4271679 to ef8b3a5

Description changed:

--- 
+++ 
@@ -1,17 +1,23 @@
-This ticket creates an experimental package `sage-objects`, outlined in Meta-ticket #29705, that consists of a small subset of the modules of sagelib, making Sage objects, the element/parent framework, categories, the coercion system and the related metaclasses available.
+This ticket creates two experimental packages `sage-objects` and `sage-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/sage_objects/spkg-src
+./sage -sh build/pkgs/sage_categories/spkg-src
 ```
-This creates a pip-installable source distribution `sage-objects-VERSION.tar.gz` in `upstream/`.  The package depends only on `Cython`, `pkgconfig`, `cysignals`, `gmpy2`. The latter, of course, requires various headers and libraries, so this is not quite a "purely" pip-installable package.
+This creates a pip-installable source distribution `sage-objects-VERSION.tar.gz` (or `sage-categories-VERSION.tar.gz`) in `upstream/`.  
 
-The goal is for all modules of `sage-objects` to be importable even when `sagelib` is not installed.  This can be tested (with tox) as follows:
+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 `sage-objects` and `sage-categories` to be importable even when `sagelib` is not installed.  This can be tested (with tox) as follows:
 
 ```
-./sage -f -c sage_objects
+./sage -sh -c '(cd build/pkgs/sage_objects/src && tox)'
+./sage -sh -c '(cd build/pkgs/sage_categories/src && tox)'
 ```
+
+`sage_categories` is intended to have `sage_objects` as a prerequisite. However, currently, `sage_categories` is an independent distribution that provides a superset of the modules of `sage_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 on follow-up tickets.