Skip to content

sage.features.Feature.resolution: If SAGE_ROOT is available, recommend system packages #30606

@mkoeppe

Description

@mkoeppe

Currently, if a Feature is keyed to an spkg, a FeatureNotPresentError recommends to use sage -i to install the package.

When SAGE_ROOT (or sage_bootstrap, see #29039) is available, we can do better:

  1. We can recommend equivalent system packages for package systems available on the present system.

  2. Moreover, if SAGE_ROOT/bin/sage-spkg is not available, then we remove the recommendation to use sage -i. This is for the benefit of distribution packaging.

    (Distribution packages would typically not install sage-spkg, so this information is automatically suppressed -- no more patching is necessary.)

  3. Finally, for Python packages that have a requirements.txt (see Add build/pkgs/SPKG/requirements.txt for all Python SPKG #30024), we also show a pip invocation.

(1. and 3. depend on a few scripts from SAGE_ROOT/build/bin to be available in the PATH. Distribution packages could consider to install these scripts; perhaps, in some libexec-style directory. Also, SAGE_ROOT/build/pkgs/*/requirements.txt and SAGE_ROOT/build/pkgs/*/distros/ need to be made available at runtime.)

We also add the names of the detected package systems to the default optional tags in use by doctests.

CC: @kiwifb @jhpalmieri @slel @seblabbe

Component: build: configure

Author: Matthias Koeppe

Branch: 68a8e2a

Reviewer: Sébastien Labbé

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions