diff --git a/src/sage/ext/__init__.py b/src/sage/ext/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/graphs/__init__.py b/src/sage/graphs/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/graphs/graph_decompositions/__init__.py b/src/sage/graphs/graph_decompositions/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/arith/__init__.py b/src/sage/graphs/graph_decompositions/all.py similarity index 100% rename from src/sage/arith/__init__.py rename to src/sage/graphs/graph_decompositions/all.py diff --git a/src/sage/interfaces/__init__.py b/src/sage/interfaces/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/libs/__init__.py b/src/sage/libs/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/matrix/__init__.py b/src/sage/matrix/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/misc/__init__.py b/src/sage/misc/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/numerical/__init__.py b/src/sage/numerical/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/numerical/backends/__init__.py b/src/sage/numerical/backends/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/categories/__init__.py b/src/sage/numerical/backends/all.py similarity index 100% rename from src/sage/categories/__init__.py rename to src/sage/numerical/backends/all.py diff --git a/src/sage/rings/__init__.py b/src/sage/rings/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage/sets/__init__.py b/src/sage/sets/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/sage_docbuild/builders.py b/src/sage_docbuild/builders.py index b6b723976cd..9cc99254e64 100644 --- a/src/sage_docbuild/builders.py +++ b/src/sage_docbuild/builders.py @@ -1011,6 +1011,10 @@ def get_new_and_updated_modules(self): raise module_filename = sys.modules[module_name].__file__ + if module_filename is None: + # Namespace package + old_modules.append(module_name) + continue if (module_filename.endswith('.pyc') or module_filename.endswith('.pyo')): source_filename = module_filename[:-1] if (os.path.exists(source_filename)): diff --git a/src/sage_setup/command/sage_install.py b/src/sage_setup/command/sage_install.py index 8571b4e9813..abfc142eec4 100644 --- a/src/sage_setup/command/sage_install.py +++ b/src/sage_setup/command/sage_install.py @@ -71,9 +71,12 @@ def clean_stale_files(self): # Determine all Python modules inside all packages py_modules = [] + ordinary_packages = [] for package in dist.packages: package_dir = cmd_build_py.get_package_dir(package) - py_modules += cmd_build_py.find_package_modules(package, package_dir) + if os.path.exists(os.path.join(package_dir, '__init__.py')): + ordinary_packages.append(package) + py_modules.extend(cmd_build_py.find_package_modules(package, package_dir)) # modules is a list of triples (package, module, module_file). # Construct the complete module name from this. py_modules = ["{0}.{1}".format(*m) for m in py_modules] @@ -97,7 +100,7 @@ def clean_stale_files(self): for output_dir in set(output_dirs): log.info('- cleaning {0}'.format(output_dir)) clean_install_dir(output_dir, - dist.packages, + ordinary_packages, py_modules, dist.ext_modules, data_files, diff --git a/src/sage_setup/find.py b/src/sage_setup/find.py index 71fddc3e4ef..28467135c12 100644 --- a/src/sage_setup/find.py +++ b/src/sage_setup/find.py @@ -404,7 +404,7 @@ def installed_files_by_module(site_packages, modules=('sage',)): Namespace packages:: sage: files_by_module['sage.graphs.graph_decompositions'] - {...'sage/graphs/graph_decompositions/__init__.py'...} + set() This takes about 30ms with warm cache::