Features for testing the presence of package systems sage_spkg, conda, pip, debian, fedora etc. - Packages and Features

Skip to content
Back to top
View this page
Edit this page

# Features for testing the presence of package systems `sage_spkg`, `conda`, `pip`, `debian`, `fedora` etc.

class sage.features.pkg_systems.PackageSystem(*args, **kwds)

  Bases: `Feature`

  A `Feature` describing a system package manager.

  EXAMPLES:

  Sage

      sage: from sage.features.pkg_systems import PackageSystem
      sage: PackageSystem('conda')
      Feature('conda')

  Python

      >>> from sage.all import *
      >>> from sage.features.pkg_systems import PackageSystem
      >>> PackageSystem('conda')
      Feature('conda')

  spkg_installation_hint(spkgs, prompt, feature)

    Return a string that explains how to install `feature`.

    EXAMPLES:

    Sage

        sage: from sage.features.pkg_systems import PackageSystem
        sage: homebrew = PackageSystem('homebrew')
        sage: homebrew.spkg_installation_hint('openblas')  # optional - SAGE_ROOT
        'To install openblas using the homebrew package manager, you can try to run:\n!brew install openblas'

    Python

        >>> from sage.all import *
        >>> from sage.features.pkg_systems import PackageSystem
        >>> homebrew = PackageSystem('homebrew')
        >>> homebrew.spkg_installation_hint('openblas')  # optional - SAGE_ROOT
        'To install openblas using the homebrew package manager, you can try to run:\n!brew install openblas'

class sage.features.pkg_systems.PipPackageSystem(*args, **kwds)

  Bases: `PackageSystem`

  A `Feature` describing the Pip package manager.

  EXAMPLES:

  Sage

      sage: from sage.features.pkg_systems import PipPackageSystem
      sage: PipPackageSystem()
      Feature('pip')

  Python

      >>> from sage.all import *
      >>> from sage.features.pkg_systems import PipPackageSystem
      >>> PipPackageSystem()
      Feature('pip')

class sage.features.pkg_systems.SagePackageSystem(*args, **kwds)

  Bases: `PackageSystem`

  A `Feature` describing the package manager of the SageMath distribution.

  EXAMPLES:

  Sage

      sage: from sage.features.pkg_systems import SagePackageSystem
      sage: SagePackageSystem()
      Feature('sage_spkg')

  Python

      >>> from sage.all import *
      >>> from sage.features.pkg_systems import SagePackageSystem
      >>> SagePackageSystem()
      Feature('sage_spkg')