Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve interface of list_packages #31385

Closed
mkoeppe opened this issue Feb 12, 2021 · 25 comments
Closed

Improve interface of list_packages #31385

mkoeppe opened this issue Feb 12, 2021 · 25 comments

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Feb 12, 2021

(split out from #31013)

... representing package info using a new PackageInfo class, which provides also dict-like access, maintaining compatibility with the previous interface in this way.

CC: @jhpalmieri @dimpase

Component: misc

Author: Tobias Diez, Matthias Koeppe, John Palmieri

Branch: ebfb13c

Reviewer: Matthias Koeppe, John Palmieri, Tobias Diez

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

@mkoeppe mkoeppe added this to the sage-9.3 milestone Feb 12, 2021
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Feb 12, 2021

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Feb 12, 2021

Reviewer: Matthias Koeppe, ...

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Feb 12, 2021

Commit: 7488fcd

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Feb 12, 2021

Changed author from Tobias Diez to Tobias Diez, Matthias Koeppe

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Feb 12, 2021

New commits:

35642b3sage.misc.packages, sage-list-packages: Use new class PackageInfo
687df80sage.misc.package.PackageInfo: Improve wording of deprecation message, fix doctests
6bc70fcsage.misc.package.list_packages: Align optional tags in doctests
7488fcdCode cleanup

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 24, 2021

comment:3

Sage development has entered the release candidate phase for 9.3. Setting a new milestone for this ticket based on a cursory review of ticket status, priority, and last modification date.

@mkoeppe mkoeppe modified the milestones: sage-9.3, sage-9.4 Mar 24, 2021
@tobiasdiez
Copy link
Contributor

comment:4

Still needs review. Matthias, I'm happy with your changes - if that is sufficient, feel free to set it to positive review.

@dimpase
Copy link
Member

dimpase commented Jun 25, 2021

comment:6

does not work with #31577 and #32036 - not sure which one to blame.

@jhpalmieri
Copy link
Member

comment:8

Replying to @dimpase:

does not work with #31577 and #32036 - not sure which one to blame.

With this plus #32036, the Sage library fails to build for me:

Traceback (most recent call last):
  File "/Users/jpalmier/Desktop/Sage/sage_builds/TESTING/sage-9.4.beta3/build/pkgs/sagelib/src/setup.py", line 79, in <module>
    distributions += ['sage-{}'.format(pkg)
  File "/Users/jpalmier/Desktop/Sage/sage_builds/TESTING/sage-9.4.beta3/build/pkgs/sagelib/src/setup.py", line 81, in <listcomp>
    if is_package_installed_and_updated(pkg)]
  File "/Users/jpalmier/Desktop/Sage/sage_builds/TESTING/sage-9.4.beta3/build/pkgs/sagelib/src/sage_setup/optional_extension.py", line 51, in is_package_installed_and_updated
    condition = (pkginfo["installed_version"] == pkginfo["remote_version"])
  File "/Users/jpalmier/Desktop/Sage/sage_builds/TESTING/sage-9.4.beta3/build/pkgs/sagelib/src/sage/misc/package.py", line 210, in __getitem__
    from sage.misc.superseded import deprecation
  File "/Users/jpalmier/Desktop/Sage/sage_builds/TESTING/sage-9.4.beta3/build/pkgs/sagelib/src/sage/misc/superseded.py", line 29, in <module>
    from sage.misc.lazy_attribute import lazy_attribute
ModuleNotFoundError: No module named 'sage.misc.lazy_attribute'

(I don't think that #31577 is involved.)

@jhpalmieri
Copy link
Member

comment:9

Replying to @jhpalmieri:

(I don't think that #31577 is involved.)

Or maybe it is, on another machine I'm seeing the same error with #31577 + #31385, but not #32036.

@jhpalmieri
Copy link
Member

comment:10

Maybe these previous posts are red herrings, and the problem is this ticket doesn't work with the latest beta.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jun 30, 2021

comment:11

Thanks for testing it -- I'll revisit it after the next beta

@jhpalmieri
Copy link
Member

comment:12

The following seems to fix it for me, but I don't know if it's a good and/or safe change:

diff --git a/src/sage_setup/optional_extension.py b/src/sage_setup/optional_extension.py
index 06586f1d39..f252849384 100644
--- a/src/sage_setup/optional_extension.py
+++ b/src/sage_setup/optional_extension.py
@@ -48,7 +48,7 @@ def is_package_installed_and_updated(pkg):
         # Might be an installed old-style package
         condition = is_package_installed(pkg)
     else:
-        condition = (pkginfo["installed_version"] == pkginfo["remote_version"])
+        condition = (pkginfo.installed_version == pkginfo.remote_version)
     return condition
 
 

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jul 19, 2021

comment:13

Setting a new milestone for this ticket based on a cursory review.

@mkoeppe mkoeppe modified the milestones: sage-9.4, sage-9.5 Jul 19, 2021
@jhpalmieri
Copy link
Member

@jhpalmieri
Copy link
Member

Changed commit from 7488fcd to ebfb13c

@jhpalmieri
Copy link
Member

comment:15

If my changes are okay, then I think we should merge it.


New commits:

de1a48csage.misc.packages, sage-list-packages: Use new class PackageInfo
ebc4f82sage.misc.package.PackageInfo: Improve wording of deprecation message, fix doctests
18bcf00sage.misc.package.list_packages: Align optional tags in doctests
8b06dc8Code cleanup
ebfb13ctrac 31385: fix sage_setup to use the new package attributes

@jhpalmieri
Copy link
Member

Changed reviewer from Matthias Koeppe, ... to Matthias Koeppe, John Palmieri

@jhpalmieri
Copy link
Member

Changed author from Tobias Diez, Matthias Koeppe to Tobias Diez, Matthias Koeppe, John Palmieri

@tobiasdiez
Copy link
Contributor

comment:16

They are fine with me. Setting this to positive review as it seems that everyone reviewed everyone else's changes.

@tobiasdiez
Copy link
Contributor

Changed reviewer from Matthias Koeppe, John Palmieri to Matthias Koeppe, John Palmieri, Tobias Diez

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Oct 26, 2021

comment:17

Yes, looks good to me. Thanks!

@vbraun
Copy link
Member

vbraun commented Oct 31, 2021

Changed branch from u/jhpalmieri/improve_interface_of_list_packages to ebfb13c

@seblabbe
Copy link
Contributor

comment:19

sage --standard, sage --optional and sage --experimental are broken in 9.5.beta6 (9 doctests failing in cmdline.py with --optional=sage,internet). Maybe this was caused by the changes made here. I created ticket #32885.

@seblabbe
Copy link
Contributor

Changed commit from ebfb13c to none

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants