Skip to content

Meta-ticket: Remove use of SAGE_LIB and SAGE_EXTCODE variables #33037

Description

@mkoeppe

Portions of namespace packages can be installed in separate locations.

Hence, the variable sage.env.SAGE_LIB is no longer meaningful.

Instead, we should make use of the __path__ attribute of packages, https://python.readthedocs.io/en/stable/reference/import.html#module-path, which in the case of namespace packages is an iterable.

SAGE_EXTCODE should be replaced by using importlib.resources (more precisely, the backport package importlib-resources). Version 5.9.0 can do as_file with directories (https://importlib-resources.readthedocs.io/en/latest/history.html#v5-9-0)

Depends on #31306

CC: @tornaria

Component: refactoring

Issue created by migration from https://trac.sagemath.org/ticket/33037

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions