Skip to content

Cleanup sage.env #27040

@SnarkBoojum

Description

@SnarkBoojum
  1. sage.all should be importable and mostly usable even if no environment variables like SAGE_ROOT or SAGE_LOCAL are set. This requires a new function join which is like os.path.join except that None values are propagated.

  2. Several unneeded variables are removed.

  3. Get rid of the over-engineered $VAR replacement stuff.

  4. In some places, SAGE_LIB (installed location of Sage) can be used instead of SAGE_SRC.

  5. Determine SAGE_LIB not from site-packages but from sage.__file__

  6. Rename _add_variable_or_fallback -> var to shorten line lengths.

There is a thread on sage-devel that complains about the failure in Debian of import sage.all from system Python.

Depends on #27041

CC: @infinity0 @tobihan

Component: porting

Author: Jeroen Demeyer

Branch: 3b0a094

Reviewer: Erik Bray

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions