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

Commit

Permalink
src/sage_setup/command/sage_install.py (sage_clean): Clean __init__.p…
Browse files Browse the repository at this point in the history
…y when installed package was ordinary, source package is namespace
  • Loading branch information
Matthias Koeppe committed Jul 13, 2022
1 parent bd185b5 commit 39aa2f1
Showing 1 changed file with 5 additions and 2 deletions.
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

0 comments on commit 39aa2f1

Please sign in to comment.