diff --git a/src/sage/algebras/__init__.py b/src/sage/algebras/letterplace/all.py similarity index 100% rename from src/sage/algebras/__init__.py rename to src/sage/algebras/letterplace/all.py diff --git a/src/sage/algebras/finite_dimensional_algebras/__init__.py b/src/sage/categories/examples/all.py similarity index 100% rename from src/sage/algebras/finite_dimensional_algebras/__init__.py rename to src/sage/categories/examples/all.py diff --git a/src/sage/algebras/fusion_rings/__init__.py b/src/sage/coding/codecan/all.py similarity index 100% rename from src/sage/algebras/fusion_rings/__init__.py rename to src/sage/coding/codecan/all.py diff --git a/src/sage/algebras/hecke_algebras/__init__.py b/src/sage/coding/guruswami_sudan/all.py similarity index 100% rename from src/sage/algebras/hecke_algebras/__init__.py rename to src/sage/coding/guruswami_sudan/all.py diff --git a/src/sage/combinat/rigged_configurations/__init__.py b/src/sage/combinat/rigged_configurations/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/combinat/root_system/__init__.py b/src/sage/combinat/root_system/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/combinat/sf/__init__.py b/src/sage/combinat/sf/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/combinat/species/__init__.py b/src/sage/combinat/species/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/crypto/block_cipher/__init__.py b/src/sage/crypto/block_cipher/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/crypto/public_key/__init__.py b/src/sage/crypto/public_key/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/data_structures/__init__.py b/src/sage/data_structures/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/databases/__init__.py b/src/sage/databases/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/dynamics/__init__.py b/src/sage/dynamics/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/dynamics/arithmetic_dynamics/__init__.py b/src/sage/dynamics/arithmetic_dynamics/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/dynamics/cellular_automata/__init__.py b/src/sage/dynamics/cellular_automata/__init__.py deleted file mode 100644 index bd469e79134..00000000000 --- a/src/sage/dynamics/cellular_automata/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -r""" -Cellular Automata -""" diff --git a/src/sage/dynamics/complex_dynamics/__init__.py b/src/sage/dynamics/complex_dynamics/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/functions/__init__.py b/src/sage/functions/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/game_theory/__init__.py b/src/sage/game_theory/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/games/__init__.py b/src/sage/games/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/geometry/__init__.py b/src/sage/geometry/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/geometry/hyperbolic_space/__init__.py b/src/sage/geometry/hyperbolic_space/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/geometry/hyperplane_arrangement/__init__.py b/src/sage/geometry/hyperplane_arrangement/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/algebras/letterplace/__init__.py b/src/sage/geometry/hyperplane_arrangement/all.py similarity index 100% rename from src/sage/algebras/letterplace/__init__.py rename to src/sage/geometry/hyperplane_arrangement/all.py diff --git a/src/sage/geometry/polyhedron/__init__.py b/src/sage/geometry/polyhedron/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/geometry/polyhedron/combinatorial_polyhedron/__init__.py b/src/sage/geometry/polyhedron/combinatorial_polyhedron/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/algebras/lie_algebras/__init__.py b/src/sage/geometry/polyhedron/combinatorial_polyhedron/all.py similarity index 100% rename from src/sage/algebras/lie_algebras/__init__.py rename to src/sage/geometry/polyhedron/combinatorial_polyhedron/all.py diff --git a/src/sage/geometry/polyhedron/modules/__init__.py b/src/sage/geometry/polyhedron/modules/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/algebras/lie_conformal_algebras/__init__.py b/src/sage/geometry/polyhedron/modules/all.py similarity index 100% rename from src/sage/algebras/lie_conformal_algebras/__init__.py rename to src/sage/geometry/polyhedron/modules/all.py diff --git a/src/sage/geometry/riemannian_manifolds/__init__.py b/src/sage/geometry/riemannian_manifolds/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/geometry/triangulation/__init__.py b/src/sage/geometry/triangulation/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/graphs/base/__init__.py b/src/sage/graphs/base/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/algebras/quantum_groups/__init__.py b/src/sage/graphs/base/all.py similarity index 100% rename from src/sage/algebras/quantum_groups/__init__.py rename to src/sage/graphs/base/all.py diff --git a/src/sage/graphs/generators/__init__.py b/src/sage/graphs/generators/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/algebras/quatalg/__init__.py b/src/sage/graphs/generators/all.py similarity index 100% rename from src/sage/algebras/quatalg/__init__.py rename to src/sage/graphs/generators/all.py diff --git a/src/sage/groups/__init__.py b/src/sage/groups/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/groups/abelian_gps/__init__.py b/src/sage/groups/abelian_gps/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/groups/additive_abelian/__init__.py b/src/sage/groups/additive_abelian/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/groups/affine_gps/__init__.py b/src/sage/groups/affine_gps/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/algebras/steenrod/__init__.py b/src/sage/groups/affine_gps/all.py similarity index 100% rename from src/sage/algebras/steenrod/__init__.py rename to src/sage/groups/affine_gps/all.py diff --git a/src/sage/groups/lie_gps/__init__.py b/src/sage/groups/lie_gps/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/calculus/__init__.py b/src/sage/groups/lie_gps/all.py similarity index 100% rename from src/sage/calculus/__init__.py rename to src/sage/groups/lie_gps/all.py diff --git a/src/sage/groups/matrix_gps/__init__.py b/src/sage/groups/matrix_gps/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/groups/misc_gps/__init__.py b/src/sage/groups/misc_gps/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/calculus/transforms/__init__.py b/src/sage/groups/misc_gps/all.py similarity index 100% rename from src/sage/calculus/transforms/__init__.py rename to src/sage/groups/misc_gps/all.py diff --git a/src/sage/groups/perm_gps/__init__.py b/src/sage/groups/perm_gps/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/groups/semimonomial_transformations/__init__.py b/src/sage/groups/semimonomial_transformations/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/categories/examples/__init__.py b/src/sage/groups/semimonomial_transformations/all.py similarity index 100% rename from src/sage/categories/examples/__init__.py rename to src/sage/groups/semimonomial_transformations/all.py diff --git a/src/sage/homology/__init__.py b/src/sage/homology/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/interacts/__init__.py b/src/sage/interacts/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/knots/__init__.py b/src/sage/knots/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/lfunctions/__init__.py b/src/sage/lfunctions/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/libs/gap/__init__.py b/src/sage/libs/gap/__init__.py deleted file mode 100644 index faee3554865..00000000000 --- a/src/sage/libs/gap/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# libgap diff --git a/src/sage/logic/__init__.py b/src/sage/logic/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/manifolds/__init__.py b/src/sage/manifolds/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/manifolds/differentiable/__init__.py b/src/sage/manifolds/differentiable/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/coding/__init__.py b/src/sage/manifolds/differentiable/all.py similarity index 100% rename from src/sage/coding/__init__.py rename to src/sage/manifolds/differentiable/all.py diff --git a/src/sage/manifolds/differentiable/examples/__init__.py b/src/sage/manifolds/differentiable/examples/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/coding/codecan/__init__.py b/src/sage/manifolds/differentiable/examples/all.py similarity index 100% rename from src/sage/coding/codecan/__init__.py rename to src/sage/manifolds/differentiable/examples/all.py diff --git a/src/sage/manifolds/subsets/__init__.py b/src/sage/manifolds/subsets/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/coding/guruswami_sudan/__init__.py b/src/sage/manifolds/subsets/all.py similarity index 100% rename from src/sage/coding/guruswami_sudan/__init__.py rename to src/sage/manifolds/subsets/all.py diff --git a/src/sage/matroids/__init__.py b/src/sage/matroids/__init__.py deleted file mode 100644 index 39cf60e3a53..00000000000 --- a/src/sage/matroids/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ - -__all__ = ["all"] diff --git a/src/sage/misc/cython.py b/src/sage/misc/cython.py index 109e555abe4..fea06f8a333 100644 --- a/src/sage/misc/cython.py +++ b/src/sage/misc/cython.py @@ -211,6 +211,28 @@ def cython(filename, verbose=0, compile_message=False, sage: cython(''' ....: cdef size_t foo = 3/2 ....: ''') + + Check that Cython supports PEP 420 packages:: + + sage: cython(''' + ....: cimport sage.misc.cachefunc + ....: ''') + + sage: cython(''' + ....: from sage.misc.cachefunc cimport cache_key + ....: ''') + + In Cython 0.29.33 using `from PACKAGE cimport MODULE` is broken + when `PACKAGE` is a namespace package, see :trac:`35322`:: + + sage: cython(''' + ....: from sage.misc cimport cachefunc + ....: ''') + Traceback (most recent call last): + ... + RuntimeError: Error compiling Cython file: + ... + ...: 'sage/misc.pxd' not found """ if not filename.endswith('pyx'): print("Warning: file (={}) should have extension .pyx".format(filename), file=sys.stderr) diff --git a/src/sage/misc/dev_tools.py b/src/sage/misc/dev_tools.py index 9b2f8a504c9..c18253358ba 100644 --- a/src/sage/misc/dev_tools.py +++ b/src/sage/misc/dev_tools.py @@ -169,7 +169,7 @@ def load_submodules(module=None, exclude_pattern=None): load sage.geometry.polyhedron.palp_database... succeeded load sage.geometry.polyhedron.ppl_lattice_polygon... succeeded """ - import pkgutil + from .package_dir import walk_packages if module is None: import sage @@ -181,7 +181,7 @@ def load_submodules(module=None, exclude_pattern=None): else: exclude = None - for importer, module_name, ispkg in pkgutil.walk_packages(module.__path__, module.__name__ + '.'): + for importer, module_name, ispkg in walk_packages(module.__path__, module.__name__ + '.'): if ispkg or module_name in sys.modules: continue diff --git a/src/sage/misc/package_dir.py b/src/sage/misc/package_dir.py index 17e0ce7b72c..d4e5cb3bc7a 100644 --- a/src/sage/misc/package_dir.py +++ b/src/sage/misc/package_dir.py @@ -14,6 +14,7 @@ import os import glob +import sys from contextlib import contextmanager @@ -154,7 +155,7 @@ def is_package_or_sage_namespace_package_dir(path, *, distribution_filter=None): :mod:`sage.cpython` is an ordinary package:: sage: from sage.misc.package_dir import is_package_or_sage_namespace_package_dir - sage: directory = os.path.dirname(sage.cpython.__file__); directory + sage: directory = sage.cpython.__path__[0]; directory '.../sage/cpython' sage: is_package_or_sage_namespace_package_dir(directory) True @@ -162,21 +163,21 @@ def is_package_or_sage_namespace_package_dir(path, *, distribution_filter=None): :mod:`sage.libs.mpfr` only has an ``__init__.pxd`` file, but we consider it a package directory for consistency with Cython:: - sage: directory = os.path.join(os.path.dirname(sage.libs.all.__file__), 'mpfr'); directory + sage: directory = os.path.join(sage.libs.__path__[0], 'mpfr'); directory '.../sage/libs/mpfr' sage: is_package_or_sage_namespace_package_dir(directory) True :mod:`sage` is designated to become an implicit namespace package:: - sage: directory = os.path.dirname(sage.env.__file__); directory + sage: directory = sage.__path__[0]; directory '.../sage' sage: is_package_or_sage_namespace_package_dir(directory) True Not a package:: - sage: directory = os.path.join(os.path.dirname(sage.symbolic.__file__), 'ginac'); directory + sage: directory = os.path.join(sage.symbolic.__path__[0], 'ginac'); directory '.../sage/symbolic/ginac' sage: is_package_or_sage_namespace_package_dir(directory) False @@ -211,3 +212,124 @@ def cython_namespace_package_support(): yield finally: Cython.Utils.is_package_dir = Cython.Build.Cythonize.is_package_dir = Cython.Build.Dependencies.is_package_dir = orig_is_package_dir + + +def walk_packages(path=None, prefix='', onerror=None): + r""" + Yield :class:`pkgutil.ModuleInfo` for all modules recursively on ``path``. + + This version of the standard library function :func:`pkgutil.walk_packages` + addresses https://github.com/python/cpython/issues/73444 by handling + the implicit namespace packages in the package layout used by Sage; + see :func:`is_package_or_sage_namespace_package_dir`. + + INPUT: + + - ``path`` -- a list of paths to look for modules in or + ``None`` (all accessible modules). + + - ``prefix`` -- a string to output on the front of every module name + on output. + + - ``onerror`` -- a function which gets called with one argument (the + name of the package which was being imported) if any exception + occurs while trying to import a package. If ``None``, ignore + :class:`ImportError` but propagate all other exceptions. + + EXAMPLES:: + + sage: sorted(sage.misc.package_dir.walk_packages(sage.misc.__path__)) # a namespace package + [..., ModuleInfo(module_finder=FileFinder('.../sage/misc'), name='package_dir', ispkg=False), ...] + """ + # Adapted from https://github.com/python/cpython/blob/3.11/Lib/pkgutil.py + + def iter_modules(path=None, prefix=''): + """ + Yield :class:`ModuleInfo` for all submodules on ``path``. + """ + from pkgutil import get_importer, iter_importers, ModuleInfo + + if path is None: + importers = iter_importers() + elif isinstance(path, str): + raise ValueError("path must be None or list of paths to look for modules in") + else: + importers = map(get_importer, path) + + yielded = {} + for i in importers: + for name, ispkg in iter_importer_modules(i, prefix): + if name not in yielded: + yielded[name] = 1 + yield ModuleInfo(i, name, ispkg) + + def iter_importer_modules(importer, prefix=''): + r""" + Yield :class:`ModuleInfo` for all modules of ``importer``. + """ + from importlib.machinery import FileFinder + + if isinstance(importer, FileFinder): + if importer.path is None or not os.path.isdir(importer.path): + return + + yielded = {} + import inspect + try: + filenames = os.listdir(importer.path) + except OSError: + # ignore unreadable directories like import does + filenames = [] + filenames.sort() # handle packages before same-named modules + + for fn in filenames: + modname = inspect.getmodulename(fn) + if modname and (modname in ['__init__', 'all'] + or modname.startswith('all__') + or modname in yielded): + continue + + path = os.path.join(importer.path, fn) + ispkg = False + + if not modname and os.path.isdir(path) and '.' not in fn: + modname = fn + if not (ispkg := is_package_or_sage_namespace_package_dir(path)): + continue + + if modname and '.' not in modname: + yielded[modname] = 1 + yield prefix + modname, ispkg + + elif not hasattr(importer, 'iter_modules'): + yield from [] + + else: + yield from importer.iter_modules(prefix) + + def seen(p, m={}): + if p in m: + return True + m[p] = True + + for info in iter_modules(path, prefix): + yield info + + if info.ispkg: + try: + __import__(info.name) + except ImportError: + if onerror is not None: + onerror(info.name) + except Exception: + if onerror is not None: + onerror(info.name) + else: + raise + else: + path = getattr(sys.modules[info.name], '__path__', None) or [] + + # don't traverse path items we've seen before + path = [p for p in path if not seen(p)] + + yield from walk_packages(path, info.name + '.', onerror) diff --git a/src/sage/modular/__init__.py b/src/sage/modular/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/modular/abvar/__init__.py b/src/sage/modular/abvar/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/modular/arithgroup/__init__.py b/src/sage/modular/arithgroup/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/modular/btquotients/__init__.py b/src/sage/modular/btquotients/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/modular/hecke/__init__.py b/src/sage/modular/hecke/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/modular/local_comp/__init__.py b/src/sage/modular/local_comp/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/modular/modform/__init__.py b/src/sage/modular/modform/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/modular/modform_hecketriangle/__init__.py b/src/sage/modular/modform_hecketriangle/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/modular/modsym/__init__.py b/src/sage/modular/modsym/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/modular/overconvergent/__init__.py b/src/sage/modular/overconvergent/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/modular/pollack_stevens/__init__.py b/src/sage/modular/pollack_stevens/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/modular/quasimodform/__init__.py b/src/sage/modular/quasimodform/__init__.py deleted file mode 100644 index 6e633f48916..00000000000 --- a/src/sage/modular/quasimodform/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from . import all diff --git a/src/sage/modular/quatalg/__init__.py b/src/sage/modular/quatalg/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/modular/ssmod/__init__.py b/src/sage/modular/ssmod/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/modules/__init__.py b/src/sage/modules/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/modules/fg_pid/__init__.py b/src/sage/modules/fg_pid/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/coding/source_coding/__init__.py b/src/sage/modules/fg_pid/all.py similarity index 100% rename from src/sage/coding/source_coding/__init__.py rename to src/sage/modules/fg_pid/all.py diff --git a/src/sage/modules/fp_graded/__init__.py b/src/sage/modules/fp_graded/__init__.py deleted file mode 100755 index e69de29bb2d..00000000000 diff --git a/src/sage/combinat/__init__.py b/src/sage/modules/fp_graded/all.py old mode 100644 new mode 100755 similarity index 100% rename from src/sage/combinat/__init__.py rename to src/sage/modules/fp_graded/all.py diff --git a/src/sage/modules/fp_graded/steenrod/__init__.py b/src/sage/modules/fp_graded/steenrod/__init__.py deleted file mode 100755 index e69de29bb2d..00000000000 diff --git a/src/sage/combinat/chas/__init__.py b/src/sage/modules/fp_graded/steenrod/all.py old mode 100644 new mode 100755 similarity index 100% rename from src/sage/combinat/chas/__init__.py rename to src/sage/modules/fp_graded/steenrod/all.py diff --git a/src/sage/monoids/__init__.py b/src/sage/monoids/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/parallel/__init__.py b/src/sage/parallel/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/plot/__init__.py b/src/sage/plot/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/plot/plot3d/__init__.py b/src/sage/plot/plot3d/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/probability/__init__.py b/src/sage/probability/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/quadratic_forms/__init__.py b/src/sage/quadratic_forms/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/quadratic_forms/genera/__init__.py b/src/sage/quadratic_forms/genera/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/quivers/__init__.py b/src/sage/quivers/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/combinat/cluster_algebra_quiver/__init__.py b/src/sage/quivers/all.py similarity index 100% rename from src/sage/combinat/cluster_algebra_quiver/__init__.py rename to src/sage/quivers/all.py diff --git a/src/sage/rings/asymptotic/__init__.py b/src/sage/rings/asymptotic/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/rings/convert/__init__.py b/src/sage/rings/convert/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/combinat/crystals/__init__.py b/src/sage/rings/convert/all.py similarity index 100% rename from src/sage/combinat/crystals/__init__.py rename to src/sage/rings/convert/all.py diff --git a/src/sage/rings/function_field/__init__.py b/src/sage/rings/function_field/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/rings/function_field/drinfeld_modules/__init__.py b/src/sage/rings/function_field/drinfeld_modules/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/combinat/designs/__init__.py b/src/sage/rings/function_field/drinfeld_modules/all.py similarity index 100% rename from src/sage/combinat/designs/__init__.py rename to src/sage/rings/function_field/drinfeld_modules/all.py diff --git a/src/sage/rings/invariants/__init__.py b/src/sage/rings/invariants/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/rings/padics/__init__.py b/src/sage/rings/padics/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/rings/polynomial/padics/__init__.py b/src/sage/rings/polynomial/padics/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/combinat/matrices/__init__.py b/src/sage/rings/polynomial/padics/all.py similarity index 100% rename from src/sage/combinat/matrices/__init__.py rename to src/sage/rings/polynomial/padics/all.py diff --git a/src/sage/rings/polynomial/weil/__init__.py b/src/sage/rings/polynomial/weil/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/rings/semirings/__init__.py b/src/sage/rings/semirings/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/rings/valuation/__init__.py b/src/sage/rings/valuation/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/sandpiles/__init__.py b/src/sage/sandpiles/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/sat/__init__.py b/src/sage/sat/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/schemes/__init__.py b/src/sage/schemes/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/schemes/affine/__init__.py b/src/sage/schemes/affine/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/schemes/berkovich/__init__.py b/src/sage/schemes/berkovich/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/schemes/curves/__init__.py b/src/sage/schemes/curves/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/schemes/cyclic_covers/__init__.py b/src/sage/schemes/cyclic_covers/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/schemes/elliptic_curves/__init__.py b/src/sage/schemes/elliptic_curves/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/schemes/generic/__init__.py b/src/sage/schemes/generic/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/schemes/hyperelliptic_curves/__init__.py b/src/sage/schemes/hyperelliptic_curves/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/schemes/jacobians/__init__.py b/src/sage/schemes/jacobians/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/schemes/plane_conics/__init__.py b/src/sage/schemes/plane_conics/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/schemes/plane_quartics/__init__.py b/src/sage/schemes/plane_quartics/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/schemes/product_projective/__init__.py b/src/sage/schemes/product_projective/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/schemes/projective/__init__.py b/src/sage/schemes/projective/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/schemes/riemann_surfaces/__init__.py b/src/sage/schemes/riemann_surfaces/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/combinat/ncsf_qsym/__init__.py b/src/sage/schemes/riemann_surfaces/all.py similarity index 100% rename from src/sage/combinat/ncsf_qsym/__init__.py rename to src/sage/schemes/riemann_surfaces/all.py diff --git a/src/sage/schemes/toric/__init__.py b/src/sage/schemes/toric/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/schemes/toric/sheaf/__init__.py b/src/sage/schemes/toric/sheaf/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/combinat/ncsym/__init__.py b/src/sage/schemes/toric/sheaf/all.py similarity index 100% rename from src/sage/combinat/ncsym/__init__.py rename to src/sage/schemes/toric/sheaf/all.py diff --git a/src/sage/server/__init__.py b/src/sage/server/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/stats/__init__.py b/src/sage/stats/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/stats/distributions/__init__.py b/src/sage/stats/distributions/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/combinat/path_tableaux/__init__.py b/src/sage/stats/distributions/all.py similarity index 100% rename from src/sage/combinat/path_tableaux/__init__.py rename to src/sage/stats/distributions/all.py diff --git a/src/sage/stats/hmm/__init__.py b/src/sage/stats/hmm/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/symbolic/__init__.py b/src/sage/symbolic/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/symbolic/integration/__init__.py b/src/sage/symbolic/integration/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/combinat/posets/__init__.py b/src/sage/symbolic/integration/all.py similarity index 100% rename from src/sage/combinat/posets/__init__.py rename to src/sage/symbolic/integration/all.py diff --git a/src/sage/symbolic/pynac.pxi b/src/sage/symbolic/pynac.pxi index 4015657b951..03da305ca97 100644 --- a/src/sage/symbolic/pynac.pxi +++ b/src/sage/symbolic/pynac.pxi @@ -3,9 +3,9 @@ Declarations for pynac, a Python frontend for ginac Check that we can externally cimport this (:trac:`18825`):: - sage: cython( # long time; random compiler warnings # optional - sage.misc.cython + sage: cython( # optional - sage.misc.cython ....: ''' - ....: from sage.symbolic cimport expression + ....: cimport sage.symbolic.expression ....: ''') """ diff --git a/src/sage/tensor/__init__.py b/src/sage/tensor/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/tensor/modules/__init__.py b/src/sage/tensor/modules/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/topology/__init__.py b/src/sage/topology/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/typeset/__init__.py b/src/sage/typeset/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000