Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
src/sage: Replace '# optional - build' by '# optional - sage_spkg'
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Nov 21, 2021
1 parent e943bdc commit c9b48a3
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 52 deletions.
2 changes: 1 addition & 1 deletion src/pyproject.toml.m4
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Minimum requirements for the build system to execute.
requires = [
# Some version of sage-conf is required.
# Note that PEP517/518 have no notion of optional build dependencies:
# Note that PEP517/518 have no notion of optional sage_spkg dependencies:
# https://github.com/pypa/pip/issues/6144
'sage-conf',
esyscmd(`sage-get-system-packages install-requires-toml \
Expand Down
74 changes: 37 additions & 37 deletions src/sage/misc/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
command inside Sage::
sage: from sage.misc.package import list_packages
sage: pkgs = list_packages(local=True) # optional - build
sage: sorted(pkgs.keys()) # optional - build, random
sage: pkgs = list_packages(local=True) # optional - sage_spkg
sage: sorted(pkgs.keys()) # optional - sage_spkg, random
['4ti2',
'alabaster',
'arb',
Expand Down Expand Up @@ -139,17 +139,17 @@ def pip_installed_packages(normalization=None):
EXAMPLES::
sage: from sage.misc.package import pip_installed_packages
sage: d = pip_installed_packages() # optional - build
sage: 'scipy' in d # optional - build
sage: d = pip_installed_packages() # optional - sage_spkg
sage: 'scipy' in d # optional - sage_spkg
True
sage: d['scipy'] # optional - build
sage: d['scipy'] # optional - sage_spkg
'...'
sage: d['beautifulsoup4'] # optional - build beautifulsoup4
sage: d['beautifulsoup4'] # optional - sage_spkg beautifulsoup4
'...'
sage: d['prompt-toolkit'] # optional - build
sage: d['prompt-toolkit'] # optional - sage_spkg
'...'
sage: d = pip_installed_packages(normalization='spkg') # optional - build
sage: d['prompt_toolkit'] # optional - build
sage: d = pip_installed_packages(normalization='spkg') # optional - sage_spkg
sage: d['prompt_toolkit'] # optional - sage_spkg
'...'
"""
Expand Down Expand Up @@ -257,31 +257,31 @@ def list_packages(*pkg_types: str, pkg_sources: List[str] = ['normal', 'pip', 's
EXAMPLES::
sage: from sage.misc.package import list_packages
sage: L = list_packages('standard') # optional - build
sage: sorted(L.keys()) # optional - build, random
sage: L = list_packages('standard') # optional - sage_spkg
sage: sorted(L.keys()) # optional - sage_spkg, random
['alabaster',
'arb',
'babel',
...
'zn_poly']
sage: sage_conf_info = L['sage_conf'] # optional - build
sage: sage_conf_info.type # optional - build
sage: sage_conf_info = L['sage_conf'] # optional - sage_spkg
sage: sage_conf_info.type # optional - sage_spkg
'standard'
sage: sage_conf_info.is_installed() # optional - build
sage: sage_conf_info.is_installed() # optional - sage_spkg
True
sage: sage_conf_info.source # optional - build
sage: sage_conf_info.source # optional - sage_spkg
'script'
sage: L = list_packages(pkg_sources=['pip'], local=True) # optional - build internet
sage: bs4_info = L['beautifulsoup4'] # optional - build internet
sage: bs4_info.type # optional - build internet
sage: L = list_packages(pkg_sources=['pip'], local=True) # optional - sage_spkg internet
sage: bs4_info = L['beautifulsoup4'] # optional - sage_spkg internet
sage: bs4_info.type # optional - sage_spkg internet
'optional'
sage: bs4_info.source # optional - build internet
sage: bs4_info.source # optional - sage_spkg internet
'pip'
Check the option ``exclude_pip``::
sage: [p for p, d in list_packages('optional', exclude_pip=True).items() # optional - build
sage: [p for p, d in list_packages('optional', exclude_pip=True).items() # optional - sage_spkg
....: if d.source == 'pip']
[]
"""
Expand Down Expand Up @@ -385,9 +385,9 @@ def installed_packages(exclude_pip=True):
EXAMPLES::
sage: sorted(installed_packages().keys()) # optional - build
sage: sorted(installed_packages().keys()) # optional - sage_spkg
[...'alabaster', ...'sage_conf', ...]
sage: installed_packages()['alabaster'] # optional - build, random
sage: installed_packages()['alabaster'] # optional - sage_spkg, random
'0.7.12'
.. SEEALSO::
Expand Down Expand Up @@ -423,12 +423,12 @@ def is_package_installed(package, exclude_pip=True):
EXAMPLES::
sage: is_package_installed('gap') # optional - build
sage: is_package_installed('gap') # optional - sage_spkg
True
Giving just the beginning of the package name is not good enough::
sage: is_package_installed('matplotli') # optional - build
sage: is_package_installed('matplotli') # optional - sage_spkg
False
Otherwise, installing "pillow" would cause this function to think
Expand Down Expand Up @@ -470,10 +470,10 @@ def package_versions(package_type, local=False):
EXAMPLES::
sage: std = package_versions('standard', local=True) # optional - build
sage: 'gap' in std # optional - build
sage: std = package_versions('standard', local=True) # optional - sage_spkg
sage: 'gap' in std # optional - sage_spkg
True
sage: std['zn_poly'] # optional - build, random
sage: std['zn_poly'] # optional - sage_spkg, random
('0.9.p12', '0.9.p12')
"""
return {pkg.name: (pkg.installed_version, pkg.remote_version) for pkg in list_packages(package_type, local=local).values()}
Expand All @@ -499,9 +499,9 @@ def standard_packages():
EXAMPLES::
sage: from sage.misc.package import standard_packages
sage: installed, not_installed = standard_packages() # optional - build
sage: installed, not_installed = standard_packages() # optional - sage_spkg
doctest:...: DeprecationWarning: ...
sage: 'numpy' in installed # optional - build
sage: 'numpy' in installed # optional - sage_spkg
True
"""
from sage.misc.superseded import deprecation
Expand Down Expand Up @@ -533,12 +533,12 @@ def optional_packages():
EXAMPLES::
sage: from sage.misc.package import optional_packages
sage: installed, not_installed = optional_packages() # optional - build
sage: installed, not_installed = optional_packages() # optional - sage_spkg
doctest:...: DeprecationWarning: ...
sage: 'beautifulsoup4' in installed+not_installed # optional - build
sage: 'beautifulsoup4' in installed+not_installed # optional - sage_spkg
True
sage: 'beautifulsoup4' in installed # optional - build beautifulsoup4
sage: 'beautifulsoup4' in installed # optional - sage_spkg beautifulsoup4
True
"""
from sage.misc.superseded import deprecation
Expand Down Expand Up @@ -571,7 +571,7 @@ def experimental_packages():
EXAMPLES::
sage: from sage.misc.package import experimental_packages
sage: installed, not_installed = experimental_packages() # optional - build
sage: installed, not_installed = experimental_packages() # optional - sage_spkg
doctest:...: DeprecationWarning: ...
"""
from sage.misc.superseded import deprecation
Expand All @@ -598,15 +598,15 @@ def package_manifest(package):
EXAMPLES::
sage: from sage.misc.package import package_manifest
sage: sagetex_manifest = package_manifest('sagetex') # optional - build
sage: sagetex_manifest['package_name'] == 'sagetex' # optional - build
sage: sagetex_manifest = package_manifest('sagetex') # optional - sage_spkg
sage: sagetex_manifest['package_name'] == 'sagetex' # optional - sage_spkg
True
sage: 'files' in sagetex_manifest # optional - build
sage: 'files' in sagetex_manifest # optional - sage_spkg
True
Test a nonexistent package::
sage: package_manifest('dummy-package') # optional - build
sage: package_manifest('dummy-package') # optional - sage_spkg
Traceback (most recent call last):
...
KeyError: 'dummy-package'
Expand Down
28 changes: 14 additions & 14 deletions src/sage/tests/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ def test_executable(args, input="", timeout=100.0, pydebug_ignore_warnings=False
''
sage: ret
0
sage: out.find("print the Sage root directory") >= 0 # optional - build
sage: out.find("print the Sage root directory") >= 0 # optional - sage_spkg
True
sage: out.find("regular expression search through the Sage") >= 0 # optional - build
sage: out.find("regular expression search through the Sage") >= 0 # optional - sage_spkg
True
Basic information about the Sage installation::
Expand All @@ -202,38 +202,38 @@ def test_executable(args, input="", timeout=100.0, pydebug_ignore_warnings=False
sage: ret
0
sage: (out, err, ret) = test_executable(["sage", "--root"]) # optional - build
sage: len(out) >= 2 # at least one character + newline; optional - build
sage: (out, err, ret) = test_executable(["sage", "--root"]) # optional - sage_spkg
sage: len(out) >= 2 # at least one character + newline; optional - sage_spkg
True
sage: err # optional - build
sage: err # optional - sage_spkg
''
sage: ret # optional -build
sage: ret # optional -sage_spkg
0
Test ``sage --info [packages]`` and the equivalent
``sage -p --info --info [packages]`` (the doubling of ``--info``
is intentional, that option should be idempotent)::
sage: out, err, ret = test_executable(["sage", "--info", "sqlite"]) # optional - build
sage: print(out) # optional - build
sage: out, err, ret = test_executable(["sage", "--info", "sqlite"]) # optional - sage_spkg
sage: print(out) # optional - sage_spkg
sqlite...
SQLite is a software library that implements a self-contained,
serverless, zero-configuration, transactional SQL database engine.
...
sage: err # optional - build
sage: err # optional - sage_spkg
''
sage: ret # optional - build
sage: ret # optional - sage_spkg
0
sage: out, err, ret = test_executable(["sage", "-p", "--info", "--info", "sqlite"]) # optional - build
sage: print(out) # optional - build
sage: out, err, ret = test_executable(["sage", "-p", "--info", "--info", "sqlite"]) # optional - sage_spkg
sage: print(out) # optional - sage_spkg
sqlite...
SQLite is a software library that implements a self-contained,
serverless, zero-configuration, transactional SQL database engine.
...
sage: err # optional - build
sage: err # optional - sage_spkg
''
sage: ret # optional - build
sage: ret # optional - sage_spkg
0
Test ``sage-run`` on a Python file, both with an absolute and with a relative path::
Expand Down

0 comments on commit c9b48a3

Please sign in to comment.