-
-
Notifications
You must be signed in to change notification settings - Fork 482
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
Rewrite deprecation to use trac ticket numbers #13109
Comments
comment:1
I just have to say it, please don't hurt me!
That's incompatible with the current one, as far as I understand the ways optional args with defaults work. So will the syntax for the deprecation function have to be ... deprecated? |
comment:2
That depends on whether the barber of Seville shaves himself or not. |
This comment has been minimized.
This comment has been minimized.
comment:3
The first patch changes the deprecation syntax. The second adds the trac numbers to all deprecations in the Sage library. The third fixes all doctests. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Author: Volker Braun |
comment:5
The last patch adds documentation to the developer guide. |
comment:7
Very comprehensive work.
|
This comment has been minimized.
This comment has been minimized.
comment:8
Oops, removing that was a mistake. One more thing; to make sure that this supersedes #8073, if we do keep Sage versions in, let's make sure to make it very very clear whether we are doing >= or >. Also, reading through the ticket number patch confirms my sense that Sage version is important; looking at something that says Sage version 4.3 (!!!) is far more revealing than Trac number so and so. |
This comment has been minimized.
This comment has been minimized.
comment:9
The :trac: markup shows nicely in the html reference. I've opened #13116 to properly render it on the commandline. If you record the trac number then its == and there is no question about >= or >. We should collect deprecated ticket numbers during doctest so we can list them. Then its easy to list the deprecations sorted by age, say. But this is for another ticket. |
comment:10
I updated the patches to use the shorter url There is nothing different in doctesting deprecations from doctesting other stuff in the Sage library, so I'm against adding an extra section on that to the coding conventions section. Shorter is better if there is no additional information conveyed. Now would be a good time to review this ticket. It touches a lot of places and I do have better things to do than to keep the patches up-to-date for the next 6 months :-P |
comment:11
Replying to @vbraun:
Simply not true. You have
but one needs an ellipsis, and this is standard in the tests I've seen. Probably not always necessary, but good protocol.
In fact, you even change this in several of the tests in your patch. Also, I'm wondering why the tests pass in developer/conventions.rst when you don't use the In fact, even putting in a blatant error in that file doesn't cause a problem in testing. Do these even get tested? |
comment:12
Oh, and as to reviewing this monster - I appreciate what you're saying, but actually checking that all these Trac numbers are correct is a big job all by itself. I'm sorry that I may not be able to get to this one soon. |
comment:13
Although I started this with my post to sage-devel, I'm afraid that I don't have time to test it as I am rushing for a deadline and will be away for 3 weeks with little opportunity. Regarding checking all the trac numbers being correct: I'm sure that almost all, if not all are correct, since I am sure that Volker will have done a careful job. Hence I think that a positive review on this should not wait for every one to be checked. If any are wrong, as soon as anyone notices it can be fixed in a separate follow-up. Is that not sensible? Certianly better than having to do it all again in a few months! |
comment:14
We should write "Perfect is the enemy of good" in huge letters on top of the developer guide, I think. |
Removed trailing whitespace |
comment:15
Attachment: trac_13109_documentation.patch.gz Hmm now the patchbot gets the order wrong. Apply trac_13109_deprecation.patch, trac_13109_fix_doctests.patch, trac_13109_documentation.patch, trac_13109_ticket_numbers.patch |
comment:16
Me, too %-) Apply trac_13109_deprecation.patch, trac_13109_ticket_numbers.patch, trac_13109_fix_doctests.patch, trac_13109_documentation.patch |
comment:17
I am just curious why we don't use a consistent style in deprecating functions. I would prefer the following style using decorators as I like the
|
comment:18
You can also use the `@rename_keyword' decorator to give alternative spellings for keywords (e.g. British vs. American English). Its not just a tool to deprecate keyword options. |
Dependencies: #12544 |
comment:33
This needs to be rebased to sage-5.2.beta1:
|
Updated patch |
Attachment: trac_13109_ticket_numbers.patch.gz Updated patch |
comment:34
Attachment: trac_13109_fix_doctests.patch.gz I've updated the patches to (the as of now unreleased) sage-5.2.beta1. I'm switching this back to positive review since it is a trivial rebase. |
comment:35
Hi guys! I love this new syntax; it's a great way to point to the right piece of information! I also appreciate the tremendous work you put into recovering the ticket number for all deprecation warnings in Sage. However, I am deeply concerned by the fact that this patch touches so many files in Sage. It is going to create conflicts with many upcoming patches, including many in the Sage-Combinat queue. We are already having great trouble getting things in and this would waste a lot of good developpers time. I thus would strongly recommend, if not request, that this change be made with a transition period where including a track ticket number is mandatory for getting new/refactored code into Sage, but where old deprecation warnings could be left as is. Anyway, those deprecation warnings are doomed to progressively disapear by themselves; is it really worth refactoring them? John: sorry for voicing this, ... well ... loudly, earlier today. Sorry also for not sumbling earlier on this ticket to give my view point before all the work is done. Cheers, |
comment:36
Hi Nicolas, How many conflicts do you actually get? The assumption is that deprecated code isn't under current development, so although we touch a lot of files we don't actually get many conflicts. Many deprecation warnings didn't even have a "since Sage version x" attached, so its doubtful that they will be removed over time. We can add a stub old-style Best, |
comment:37
A grep on the combinat queue tells me that 34 files use deprecation. Some of those don't need to be changed at all, but I would bet that at least 20 of them do. |
comment:38
Should we have
:-) |
comment:39
Replying to @jdemeyer:
See comments 1 and 2 above (and I thought that was my joke!) |
comment:40
I propose that we deprecate all self-referential deprecation jokes. |
comment:41
Never! |
Merged: sage-5.2.rc0 |
As discussed on https://groups.google.com/d/topic/sage-devel/I12IeaFlE7g/discussion, change the deprecation function to the new arguments
where both arguments are mandatory. Once this code is in Sage, one
can deduce every possible thing discussed above in this thread from
the trac number. The deprecation warning can produce the URL of the
trac ticket.
Analogous changes are made to
deprecated_function_alias
anddeprecated_callable_import
. Finally, the@rename_keyword(deprecated="sage version string", ...)
decorator is changed toApply
This ticket also fixes #8073, #8546.
Depends on #12544
Depends on #12965
CC: @JohnCremona @kini @williamstein @jasongrout @kcrisman
Component: doctest coverage
Author: Volker Braun
Reviewer: John Palmieri, Karl-Dieter Crisman
Merged: sage-5.2.rc0
Issue created by migration from https://trac.sagemath.org/ticket/13109
The text was updated successfully, but these errors were encountered: