Skip to content

Commit

Permalink
Trac #32885: sage --standard, sage --optional and `sage --experim…
Browse files Browse the repository at this point in the history
…ental` are broken

On Ubuntu 18.04 with 9.5.beta6, `sage --standard`, `sage --optional` and
`sage --experimental` are broken:

{{{
$ sage --standard
[package]...............................[latest version] ([version])

Traceback (most recent call last):
  File "/home/slabbe/GitBox/sage/src/bin/sage-list-packages", line 102,
in <module>
    pkg.installed_version = pkg.installed_version or 'not_installed'
AttributeError: can't set attribute

$ sage --optional
[package]...............................[latest version] ([version])

/home/slabbe/GitBox/sage/local/lib/python3.9/site-
packages/sage/misc/package.py:117: UserWarning: failed to fetch the
version of pkg='ore_algebra' at https://pypi.org/pypi/ore_algebra/json
  warnings.warn("failed to fetch the version of pkg={!r} at
{}".format(pkg, url))
Traceback (most recent call last):
  File "/home/slabbe/GitBox/sage/src/bin/sage-list-packages", line 102,
in <module>
    pkg.installed_version = pkg.installed_version or 'not_installed'
AttributeError: can't set attribute

$ sage --experimental
[package]...............................[latest version] ([version])

Traceback (most recent call last):
  File "/home/slabbe/GitBox/sage/src/bin/sage-list-packages", line 102,
in <module>
    pkg.installed_version = pkg.installed_version or 'not_installed'
AttributeError: can't set attribute
}}}

This leads to the following doctests to fail.

{{{
$ sage -t --optional=sage,internet src/sage/tests/cmdline.py
}}}
gives
{{{
[218 tests, 9 failures, 36.22 s]
}}}

URL: https://trac.sagemath.org/32885
Reported by: slabbe
Ticket author(s): John Palmieri
Reviewer(s): Sébastien Labbé
  • Loading branch information
Release Manager committed Nov 20, 2021
2 parents e12c3ec + 50daef4 commit bd586df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/bin/sage-list-packages
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ L.sort(key=lambda pkg: pkg.name)

# print (while getting rid of None in versions)
for pkg in L:
pkg.installed_version = pkg.installed_version or 'not_installed'
pkg.remote_version = pkg.remote_version or '?'
pkg = pkg._replace(installed_version = pkg.installed_version or 'not_installed',
remote_version = pkg.remote_version or '?')
print(format_string.format(**pkg._asdict()))
if WARN:
print(WARN)
6 changes: 3 additions & 3 deletions src/sage/misc/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ def standard_packages():
"""
from sage.misc.superseded import deprecation
deprecation(30747,
'the functions standard_packages, optional_packages, experimental_packages'
'the functions standard_packages, optional_packages, experimental_packages '
'are deprecated, use sage.features instead')
pkgs = list_packages('standard', local=True).values()
return (sorted(pkg.name for pkg in pkgs if pkg.is_installed()),
Expand Down Expand Up @@ -543,7 +543,7 @@ def optional_packages():
"""
from sage.misc.superseded import deprecation
deprecation(30747,
'the functions standard_packages, optional_packages, experimental_packages'
'the functions standard_packages, optional_packages, experimental_packages '
'are deprecated, use sage.features instead')
pkgs = list_packages('optional', local=True)
pkgs = pkgs.values()
Expand Down Expand Up @@ -576,7 +576,7 @@ def experimental_packages():
"""
from sage.misc.superseded import deprecation
deprecation(30747,
'the functions standard_packages, optional_packages, experimental_packages'
'the functions standard_packages, optional_packages, experimental_packages '
'are deprecated, use sage.features instead')
pkgs = list_packages('experimental', local=True).values()
return (sorted(pkg.name for pkg in pkgs if pkg.is_installed()),
Expand Down

0 comments on commit bd586df

Please sign in to comment.