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: Fix for namespace package sage
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Jul 15, 2022
1 parent f447a11 commit 01f9143
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/sage_setup/find.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,9 @@ def _cythonized_dir(src_dir=None, editable_install=None):
if src_dir is None:
src_dir = SAGE_SRC
src_dir = Path(src_dir)
sage = import_module('sage')
d = Path(sage.__file__).resolve().parent.parent
# sage.cpython is an ordinary package, so it has __file__
sage_cpython = import_module('sage.cpython')
d = Path(sage_cpython.__file__).resolve().parent.parent.parent
editable_install = d == src_dir.resolve()
if editable_install:
# Editable install: Cython generates files in the source tree
Expand Down Expand Up @@ -390,7 +391,7 @@ def installed_files_by_module(site_packages, modules=('sage',)):
EXAMPLES::
sage: site_packages = os.path.dirname(os.path.dirname(sage.__file__))
sage: site_packages = os.path.dirname(os.path.dirname(os.path.dirname(sage.cpython.__file__)))
sage: from sage_setup.find import installed_files_by_module
sage: files_by_module = installed_files_by_module(site_packages)
sage: (f,) = files_by_module['sage.structure.sage_object']; f
Expand Down

0 comments on commit 01f9143

Please sign in to comment.