Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Merge #33011
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Jul 15, 2022
2 parents 625ac58 + 39aa2f1 commit d3bdb46
Show file tree
Hide file tree
Showing 16 changed files with 10 additions and 3 deletions.
Empty file removed src/sage/ext/__init__.py
Empty file.
Empty file removed src/sage/graphs/__init__.py
Empty file.
Empty file.
File renamed without changes.
Empty file removed src/sage/interfaces/__init__.py
Empty file.
Empty file removed src/sage/libs/__init__.py
Empty file.
Empty file removed src/sage/matrix/__init__.py
Empty file.
Empty file removed src/sage/misc/__init__.py
Empty file.
Empty file removed src/sage/numerical/__init__.py
Empty file.
Empty file.
File renamed without changes.
Empty file removed src/sage/rings/__init__.py
Empty file.
Empty file removed src/sage/sets/__init__.py
Empty file.
4 changes: 4 additions & 0 deletions src/sage_docbuild/builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)):
Expand Down
7 changes: 5 additions & 2 deletions src/sage_setup/command/sage_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/sage_setup/find.py
Original file line number Diff line number Diff line change
Expand Up @@ -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::
Expand Down

0 comments on commit d3bdb46

Please sign in to comment.