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

Remove unused class from sage_setup.optional extension #31013

Closed
tobiasdiez opened this issue Dec 5, 2020 · 88 comments
Closed

Remove unused class from sage_setup.optional extension #31013

tobiasdiez opened this issue Dec 5, 2020 · 88 comments

Comments

@tobiasdiez
Copy link
Contributor

The code in optional_extension was mostly unused and is removed in this ticket (and similarly extension.skip_build was nowhere else set).
The only still used method was is_package_installed_and_updated which is moved to sage.misc.package.

Related: #28815

CC: @mkoeppe @kiwifb

Component: build

Keywords: sd111

Author: Tobias Diez

Branch/Commit: a7b1e81

Reviewer: François Bissey

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

@tobiasdiez tobiasdiez added this to the sage-9.3 milestone Dec 5, 2020
@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 5, 2020

Changed commit from 508075c to 2492f1e

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 5, 2020

Branch pushed to git repo; I updated commit sha1. New commits:

2492f1eCode cleanup

@tobiasdiez

This comment has been minimized.

@mkoeppe
Copy link
Contributor

mkoeppe commented Dec 5, 2020

comment:4

Can't make incompatible changes to the interface of a public function

@mkoeppe
Copy link
Contributor

mkoeppe commented Dec 5, 2020

comment:5

(I'm referring to the list_packages function)

@mkoeppe
Copy link
Contributor

mkoeppe commented Dec 5, 2020

comment:6

It's also conflicting with the changes in #30940 (which needs review)

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 5, 2020

Branch pushed to git repo; I updated commit sha1. New commits:

649ffffFix build

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 5, 2020

Changed commit from 2492f1e to 649ffff

@tobiasdiez
Copy link
Contributor Author

comment:8

Replying to @mkoeppe:

Can't make incompatible changes to the interface of a public function

So one cannot change public facing functions at all? What is the policy/strategy for this? Introduce a new method, say list_packages_typed?

It's also conflicting with the changes in #30940 (which needs review)

I wouldn't say it's conflicting, just results in easy-to-resolve merge conflicts.

@mkoeppe
Copy link
Contributor

mkoeppe commented Dec 5, 2020

comment:9

Replying to @tobiasdiez:

Replying to @mkoeppe:

Can't make incompatible changes to the interface of a public function

So one cannot change public facing functions at all? What is the policy/strategy for this? Introduce a new method, say list_packages_typed?

It could be a new function (with deprecation for the old one), or an optional argument that controls the return type, ...

But in this particular case, it would probably be good enough to just give the new class dictionary-like behavior so that user code can continue to access the slots like a dictionary. Possibly with deprecation warning.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 5, 2020

Changed commit from 649ffff to 26b59ad

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 5, 2020

Branch pushed to git repo; I updated commit sha1. New commits:

26b59adImplement __getitem__

@tobiasdiez
Copy link
Contributor Author

comment:11

Replying to @mkoeppe:

But in this particular case, it would probably be good enough to just give the new class dictionary-like behavior so that user code can continue to access the slots like a dictionary. Possibly with deprecation warning.

That's a nice idea, implemented!

@mkoeppe
Copy link
Contributor

mkoeppe commented Dec 5, 2020

comment:12

Instead of "string-based access", perhaps this should be called "dict-like access" in the deprecation messages?

@mkoeppe
Copy link
Contributor

mkoeppe commented Dec 6, 2020

comment:13

I think in this change you need to use is_installed() instead

--- a/src/bin/sage-list-packages
+++ b/src/bin/sage-list-packages
@@ -91,16 +91,16 @@ else:
 if WARN:
     print(WARN)
 if args['installed_only']:
-    L = [pkg for pkg in L if pkg['installed']]
+    L = [pkg for pkg in L if pkg.installed]
 elif args['not_installed_only']:
-    L = [pkg for pkg in L if not pkg['installed']]
+    L = [pkg for pkg in L if not pkg.installed]

@mkoeppe mkoeppe changed the title Remove unused optional extension Remove unused optional extension, improve interface of list_packages Dec 6, 2020
@mkoeppe
Copy link
Contributor

mkoeppe commented Dec 6, 2020

comment:16

Hoping we can make progress on this ticket this week - https://wiki.sagemath.org/days111

@mkoeppe
Copy link
Contributor

mkoeppe commented Dec 6, 2020

Changed keywords from none to sd111

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 6, 2020

Changed commit from 26b59ad to 0c10be0

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 6, 2020

Branch pushed to git repo; I updated commit sha1. New commits:

0c10be0Fix build

@tobiasdiez
Copy link
Contributor Author

comment:18

Replying to @mkoeppe:

I think in this change you need to use is_installed() instead

Indeed, thanks!

@mkoeppe mkoeppe added this to the sage-9.4 milestone Mar 15, 2021
@mkoeppe
Copy link
Contributor

mkoeppe commented Jul 19, 2021

comment:61

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
@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 26, 2021

Changed commit from 541fa1b to 6c67908

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 26, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

6c67908Merge branch 'develop' of https://github.com/sagemath/sage into public/build/remove_optional_extension

@tobiasdiez
Copy link
Contributor Author

comment:63

Rebased, so this is now ready for review.

@tobiasdiez
Copy link
Contributor Author

Changed work issues from rebase on #31385 to none

@mkoeppe
Copy link
Contributor

mkoeppe commented Dec 18, 2021

comment:64

Stalled in needs_review or needs_info; likely won't make it into Sage 9.5.

@mkoeppe mkoeppe modified the milestones: sage-9.5, sage-9.6 Dec 18, 2021
@tobiasdiez
Copy link
Contributor Author

comment:65

Yes, I would appreciate if this ticket could be reviewed!

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 3, 2022

Changed commit from 6c67908 to a7b1e81

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 3, 2022

Branch pushed to git repo; I updated commit sha1. New commits:

11b45bdMerge branch 'develop' of https://github.com/sagemath/sage into public/build/remove_optional_extension
a7b1e81Improve typing

@tobiasdiez
Copy link
Contributor Author

Changed dependencies from #31385 to none

@kiwifb
Copy link
Member

kiwifb commented Jan 10, 2022

comment:69

Thanks for copying me Matthias. I was aware of this ticket and I guess it will at least remove some pesky doctests. Otherwise it will just make me move some patch from one file to another.

is_package_installed_and_updated is one of those things I am patiently waiting for the modularisation of sage to kill. In the meantime I am patching an alternative mechanism anyway.

@kiwifb
Copy link
Member

kiwifb commented Jan 10, 2022

comment:70

Other than that, if you copied me for the review, it all looks good and sensible to me.

@kiwifb
Copy link
Member

kiwifb commented Jan 10, 2022

Reviewer: François Bissey

@tobiasdiez
Copy link
Contributor Author

comment:71

Thanks for the review!

@vbraun
Copy link
Member

vbraun commented Jan 31, 2022

Changed branch from public/build/remove_optional_extension to a7b1e81

@vbraun vbraun closed this as completed in 3abe1a7 Jan 31, 2022
mkoeppe added a commit to mkoeppe/sage that referenced this issue Apr 23, 2024
vbraun pushed a commit to vbraun/sage that referenced this issue Apr 28, 2024
    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

Remove code deprecated in:
- sagemath#31013 (2022)
- sagemath#30747 (2020)
- sagemath#30607 (2020)

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#37855
Reported by: Matthias Köppe
Reviewer(s): François Bissey, Matthias Köppe
vbraun pushed a commit to vbraun/sage that referenced this issue May 2, 2024
    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

Remove code deprecated in:
- sagemath#31013 (2022)
- sagemath#30747 (2020)
- sagemath#30607 (2020)

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#37855
Reported by: Matthias Köppe
Reviewer(s): François Bissey, Matthias Köppe
@mantepse mantepse mentioned this issue May 10, 2024
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

5 participants