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
Support older versions of backports.shutil_get_terminal_size #25320
Comments
comment:2
There is a log file in the commit. |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:4
Oh sorry, I should've reviewed before pushing. Removed. |
comment:5
You need a patched version of https://github.com/chrippa/backports.shutil_get_terminal_size |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:9
It seems like this patch was only included to fix this formatting error (#20599). This is a bit meta, but is there a general patching policy for sage? Sage patches a lot of its dependencies and often has very good reasons to do so. But sometimes it is not strictly necessary. That makes life hard for packagers and also for the people maintaining the sage spkgs. In my opinion patching dependencies should be a last resort, only if there is pretty much no other option. |
comment:10
Replying to @timokau:
There is no such policy. But it might be a good topic for discussion on |
comment:11
Yes I do, but to my understanding the purpose of that list is packagers working together to solve packaging issues right? Such a policy would benefit packagers, but upstream developers would need to be the ones actually deciding on it and adhering to it. So I don't think discussing that on sage-packaging is very useful. Maybe sage-devel, if there is no more proper place to discuss that? |
comment:12
I have posted on sage-devel about this (https://groups.google.com/forum/#!topic/sage-devel/-lBph6WWg5E), so this ticket can go back to topic. |
comment:13
Your patch looks good to me. I think a Feel free to set this to positive review once you added a comment, or also if you don't deem it necessary. |
Reviewer: Julian Rüth |
comment:14
Yeah I thought about that but I wasn't sure how to add comments to the doctests. Simply a |
comment:15
Yes, I think that's acceptable. |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:17
Okay, I added such a comment. New commits:
|
comment:20
Sorry! The issue seems to be the missing initial
while the test code is:
Does anybody know why the |
comment:21
Not sure. Also Volker is only quoting one failure, does that mean that the other one passes or did he imply it was also failing? A pity, that's the first time in a long time this doctest doesn't fail on me in sage-on-gentoo. |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:23
Okay I could reproduce the error locally. No idea why I didn't notice that before, I must have messed up somewhere. Apparently python will interpret those In my opinion the best solution would be to just remove the backports patch in sage. One patch less is one problem less and this patch seems to bring little to none advantage. But judging by the mailing list discussion, @jdemeyer probably disagrees? New commits:
|
comment:24
Replying to @timokau:
Why? It's not the fault of Sage that upstream doesn't make a new release (EDIT: actually, that upstream is dead). One could also argue that your distro should just apply that patch to
I consider correctly formatting exceptions a good feature to have. |
comment:25
Replying to @jdemeyer:
Its not, but I still think it doesn't matter whose fault it is. Instead we should choose the most practical solution. But by now we're just repeating our arguments -- I'm just going to accept that dropping the patch is not an option. Yeah the owner hasn't had any GitHub activity in ages. Best case would be if somebody would just fork it. Looks like there is not much maintenance needed besides reviewing the occasional patch. However I don't really feel comfortable running a python library project myself, as I have no knowledge about the ecosystem (setup.py, pypy etc).
Its kinda nice but at least in my mind not even remotely worth the trouble. The wrong format still conveys all the same information and doesn't really loose any clarity. |
comment:26
Just to talk about something else: it's a bit strange that exactly the same test appears in two places. Maybe the test inside
|
comment:27
Replying to @jdemeyer:
Strange that it appears in two places? sage is littered with identical (and I mean identical) tests often in different files. The only thing peculiar about those two is proximity. |
comment:28
Replying to @kiwifb:
I know. I think it's because of the "coverage" policy that every function should have tests. If people cannot come up with good tests, they just copy an existing test to satisfy the |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:30
Replying to @jdemeyer:
I agree, that'll improve the test (doctests with textual output are inherently brittle) and solve half of this problem. What about the other one? Could we maybe replace that with another exception that is well-behaved, regardless of the backport patch level? I skimmed through the source and the patch to get an idea, but I can't figure out how the backport even influences the ZeroDivisionError formatting, let alone how the New commits:
New commits:
|
comment:31
Replying to @timokau:
The issue is not with the specific exception, but with how IPython formats exceptions in general. |
comment:32
Oh so the backport just reports a wrong terminal size and IPython formats the exception to fit into that size? That makes sense. What do you think about that dummy-line "fix"? |
comment:33
@jdemeyer do you think that fix is acceptable? |
comment:35
Considering what is causing this issue (backports.shutil_get_terminal size failing to do the one thing it is supposed to do), I now agree that the patch should be applied. I will propose it for inclusion in nix. I still think that the sage doctests shouldn't fail because of this. The "problem" here is not essential to sages functionality. But thats not my call so if you don't want any version of this ticket in sage feel free to close this. If you want this ticket resolved but in a different way, I'll gladly implement any suggestions. Thanks again for reviewing! |
comment:36
I won't actively oppose the patch on this ticket. If other people think it's OK, then I'm fine with it. Personally, I think you should just add this patch to the sagemath in your distribution. |
Changed branch from u/gh-timokau/zero-division-format to |
Changed commit from |
comment:39
This is not working for me on Arch: the test is still failing (with unpatched shutil_get_terminal_size) |
comment:40
Should have reacted earlier, but yes the final version of that ticket didn't fix everything.
but during development it was - at some point. |
Because of a broken version of backports.shutil_get_terminal_size, some distros show tracebacks without spacing as follows:
Apparently debian has the same problem.
This patch makes the doctests accept both formats.
Component: porting
Author: Timo Kaufmann
Branch:
d24dd41
Reviewer: Julian Rüth
Issue created by migration from https://trac.sagemath.org/ticket/25320
The text was updated successfully, but these errors were encountered: