-
-
Notifications
You must be signed in to change notification settings - Fork 480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modularization of sagelib: Break out separate packages sagemath-objects, sagemath-categories #29865
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Commit: |
This comment has been minimized.
This comment has been minimized.
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. Last 10 new commits:
|
comment:11
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:13
Some of the Python modules in
vs.
|
comment:15
but does not succeed without importing |
comment:16
|
This comment has been minimized.
This comment has been minimized.
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:167
Never mind then! Sorry for the noise. |
comment:168
Okay. Let's get this in. |
comment:169
Thanks! |
comment:170
Why this is not yet merged? |
Changed branch from u/mkoeppe/t/29865-modularizarion-sage-objects to |
…e relative by absolute imports <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes sagemath#1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> We restructure the `all.py` files for modularization. Guided by the technical constraints outlined in https://groups.google.com/g/sage-devel/c/ozh-7ZZ848s, sagemath#35095 defines distribution packages (pip-installable packages) **sagemath-{brial, combinat, eclib, flint, gap, giac, glpk, graphs, groups, homfly, lcalc, libbraiding, libecm, linbox, modules, mpmath, ntl, pari, plot, polyhedra, schemes, singular, standard-no-symbolics, symbolics}**. When a namespace package such as `sage.misc` is filled by modules from several distribution packages, we create modules named: - `src/sage/misc/all__sagemath_environment.py` - `src/sage/misc/all__sagemath_objects.py` - `src/sage/misc/all__sagemath_repl.py` Import statements are moved from `src/sage/misc/all.py` to these files as appropriate, and `src/sage/misc/all.py` imports `*` from there. Also some imports are replaced by lazy imports. The new files provide the top level namespaces for the modularized distribution packages, thus [enabling modularized testing](https://doc.s agemath.org/html/en/developer/packaging_sage_library.html#testing- distribution-packages). This design was introduced in sagemath#29865 (merged in Jan 2022, early in the Sage 9.6 development cycle). <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes sagemath#12345". --> - Copied from sagemath#35095. - Part of sagemath#29705 Moreover, applied a one-line command to replace relative by absolute imports, thus complementing sagemath#36666, which does not touch `.all*` files. The changes to other files in `sage.modules` etc. come from the PRs sagemath#36597, sagemath#36572, sagemath#36588, sagemath#36589 merged here and do not need review. <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - sagemath#12345: short description why this is a dependency - sagemath#34567: ... --> - Depends on sagemath#36597 (merged here to resolve merge conflict) - Depends on sagemath#36572 (merged here to resolve merge conflict) - Depends on sagemath#36588 (merged here to resolve merge conflict) - Depends on sagemath#36589 (merged here to resolve merge conflict) - Depends on sagemath#36449 (merged here to resolve merge conflict) <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#36676 Reported by: Matthias Köppe Reviewer(s): David Coudert, John H. Palmieri, Matthias Köppe, Tobias Diez
…e relative by absolute imports <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes sagemath#1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> We restructure the `all.py` files for modularization. Guided by the technical constraints outlined in https://groups.google.com/g/sage-devel/c/ozh-7ZZ848s, sagemath#35095 defines distribution packages (pip-installable packages) **sagemath-{brial, combinat, eclib, flint, gap, giac, glpk, graphs, groups, homfly, lcalc, libbraiding, libecm, linbox, modules, mpmath, ntl, pari, plot, polyhedra, schemes, singular, standard-no-symbolics, symbolics}**. When a namespace package such as `sage.misc` is filled by modules from several distribution packages, we create modules named: - `src/sage/misc/all__sagemath_environment.py` - `src/sage/misc/all__sagemath_objects.py` - `src/sage/misc/all__sagemath_repl.py` Import statements are moved from `src/sage/misc/all.py` to these files as appropriate, and `src/sage/misc/all.py` imports `*` from there. Also some imports are replaced by lazy imports. The new files provide the top level namespaces for the modularized distribution packages, thus [enabling modularized testing](https://doc.s agemath.org/html/en/developer/packaging_sage_library.html#testing- distribution-packages). This design was introduced in sagemath#29865 (merged in Jan 2022, early in the Sage 9.6 development cycle). <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes sagemath#12345". --> - Copied from sagemath#35095. - Part of sagemath#29705 Moreover, applied a one-line command to replace relative by absolute imports, thus complementing sagemath#36666, which does not touch `.all*` files. The changes to other files in `sage.modules` etc. come from the PRs sagemath#36597, sagemath#36572, sagemath#36588, sagemath#36589 merged here and do not need review. <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - sagemath#12345: short description why this is a dependency - sagemath#34567: ... --> - Depends on sagemath#36597 (merged here to resolve merge conflict) - Depends on sagemath#36572 (merged here to resolve merge conflict) - Depends on sagemath#36588 (merged here to resolve merge conflict) - Depends on sagemath#36589 (merged here to resolve merge conflict) - Depends on sagemath#36449 (merged here to resolve merge conflict) <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#36676 Reported by: Matthias Köppe Reviewer(s): David Coudert, John H. Palmieri, Kwankyu Lee, Matthias Köppe, Tobias Diez
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:
This creates a pip-installable source distribution
sagemath-objects-VERSION.tar.gz
(orsagemath-categories-VERSION.tar.gz
) inupstream/
.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: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
The text was updated successfully, but these errors were encountered: