#18581: _package_lists_from_sage_output() should output installed and available
versions
-------------------------------------+-------------------------------------
Reporter: jdemeyer | Owner:
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-6.8
Component: misc | Resolution:
Keywords: | Merged in:
Authors: John Palmieri | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/jhpalmieri/versions | 17bc8fad32020a978d940694edba35b46e81389f
Dependencies: #18456 | Stopgaps:
-------------------------------------+-------------------------------------
Changes (by jdemeyer):
* status: needs_review => needs_work
Old description:
> Currently, the function `_package_lists_from_sage_output` only gives the
> latest available version of a package, not the version which is
> installed. I propose to actually return a list of triples
> {{{
> (package_name, installed_version, latest_version)
> }}}
> where `installed_version` is `None` if the package is not installed and
> `latest_version` is the newest available version.
>
> If, for example, arb-2.5.0 is installed but arb-2.6.0 is availble, then
> one such triple would be
> {{{
> ('arb', '2.5.0', '2.6.0')
> }}}
>
> If arb is not installed, this would be:
> {{{
> ('arb', None, '2.6.0')
> }}}
New description:
Currently, the function `_package_lists_from_sage_output` only gives the
latest available version of a package, not the version which is installed.
I propose to define a new function `package_versions(local=False)` which
returns a dictionary with key:value pairs of the form
{{{
package_name: (installed_version, latest_version)
}}}
where `installed_version` is `None` if the package is not installed and
`latest_version` is the newest available version.
If, for example, arb-2.5.0 is installed but arb-2.6.0 is availble, then
one such key:value pair would be
{{{
'arb': ('2.5.0', '2.6.0')
}}}
If arb is not installed, this would be:
{{{
'arb': (None, '2.6.0')
}}}
--
Comment:
I don't want a '''tuple''' of lists of tuples, that's just too
complicated. I meant just one list of tuples.
Actually thinking a bit more about this, a dictionary makes more sense:
the keys are the package names and the values are tuples
`(installed_version, latest_version)`.
And I certainly want the output format to be the same for `local=True` and
`local=False`.
I also propose to make this a separate function `package_versions()` to
avoid the many `if version` branches you will need. And then implement the
old `_package_lists_from_sage_output()` as a very short function using
this new `package_versions()` function.
--
Ticket URL: <http://trac.sagemath.org/ticket/18581#comment:5>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.