-
-
Notifications
You must be signed in to change notification settings - Fork 654
Description
This is work toward modularization, see https://doc.sagemath.org/html/en/developer/packaging_sage_library.html#module-level-runtime-dependencies and #29705.
Tickets:
- sage.geometry: Remove .all imports #32534 / Remove some .all imports #32591 / Replace imports of QQ, ZZ, GF, Integer from sage.rings.all by more specific imports #32620 / Remove .all import of infinity #32734 / Remove more .all imports #32733: Remove .all imports (Sage 9.5)
- Remove imports from sage.misc.all #32989 / Remove imports from sage.libs.all #32999 / Remove some imports from sage.rings.all #33000 / Remove imports from sage.interfaces.all #33007 / Replace imports from sage.*.all by more specific imports in combinat #33146 / Replace imports from sage.graphs.all by more specific imports #33199 Remove imports from sage.*.all (Sage 9.6)
- Remove imports from sage.all and sage.rings.all in sage.rings #34189 / Remove imports from sage.rings.all in sage.schemes #34190 / Remove imports from sage.rings.all in sage.modular #34191 / Remove imports from sage.rings.all in sage.calculus, functions, symbolic #34192 / sage.manifolds, sage.tensor: Remove imports from sage.arith.all, sage.rings.all #34428 Remove imports from sage.*.all (Sage 9.7)
- Remove imports from sage.arith.all in the Sage library #34197
- sage.{algebras,combinat,matroids}: Replace imports from sage.*.all for namespace packages #34946
- sage.{rings,modules,geometry}: Replace imports from sage.*.all for namespace packages #34947
- sage.{coding,groups}: Replace imports from sage.*.all for namespace packages #34948
- sage.{categories,matrix,structure}: Replace imports from sage.*.all for namespace packages #34949
- sage.schemes: Replace imports from sage.*.all for namespace packages #34951
- sage.graphs: Replace imports from sage.*.all for namespace packages #34952
- sage.{topology,homology}: Replace imports from sage.*.all for namespace packages #34953
- sage.{functions,interfaces,symbolic}: Replace imports from sage.*.all for namespace packages #34954
- sage.{arith,crypto,databases,dynamics,lfunctions,quadratic_forms}: Replace imports from sage.*.all for namespace packages #34955
- sage.{misc,monoids,sets}: Replace imports from sage.*.all for namespace packages #34956
- sage.{finance,interacts,libs,numerical,stats,tests}: Replace imports from sage.*.all for namespace packages #34957
The branch here on the ticket merges the above tickets and makes violations an error again.
Tools:
-
Find them with
./sage -tox -e relint
- but the list of .all modules that it complains about differs from what actually became a namespace package in Remove __init__.py files for subpackages designated to be namespace packages #33011; this is updated in Remove imports from sage.all and sage.rings.all in sage.rings #34189. (See also tox -e relint: Do not complain about imports from sage.categories.all #33202)
Other tools (not used):
-
https://github.com/asottile/reorder_python_imports with option
--replace-import
... but it rewrites all imports in a peculiar style (one import line for each imported name) -
https://pypi.org/project/import-linter/ - this could replace our use of relint for complaining about .all imports
Component: refactoring
Author: Matthias Koeppe
Issue created by migration from https://trac.sagemath.org/ticket/34201