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

Sage banner: include warning if a prerelease #6505

Closed
jhpalmieri opened this issue Jul 10, 2009 · 13 comments
Closed

Sage banner: include warning if a prerelease #6505

jhpalmieri opened this issue Jul 10, 2009 · 13 comments

Comments

@jhpalmieri
Copy link
Member

From sage-devel:

I just noticed an old thread, where a user had problems on squite, 
making his own version of some packages with an alpha, heta or rc 
release of Sage. 

It would be good if alpha/beta/rc releases always showed a message that 
they were pre-release versions for developers and not considered stable. 
If there was some automatic way of making this happen, it would avoid 
the risk of someone forgetting to add or delete a file. 

This patch should do this. To fully test, make a source distribution of Sage using sage-sdist. To partially test, in Sage, do

sage: sage.version.version
'4.1.rc1'
sage: print sage.misc.banner.banner_text()
----------------------------------------------------------------------
| Sage Version 4.1.rc1, Release Date: 2009-07-07                     |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------
**********************************************************************
*                                                                    *
* Warning: this is a prerelease version, and it may be unstable.     *
*                                                                    *
**********************************************************************
sage: sage.version.version = '4.1'
sage: print sage.misc.banner.banner_text()
----------------------------------------------------------------------
| Sage Version 4.1, Release Date: 2009-07-07                         |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------

I believe that when a Sage distribution is created, the string from banner_text() is printed into the file SAGE_ROOT/local/bin/sage-banner (see SAGE_ROOT/local/bin/sage-sdist). So I think this patch will do what was requested.

CC: @sagetrac-drkirkby

Component: misc

Author: John Palmieri

Reviewer: Dan Drake

Merged: Sage 4.1.1.alpha1

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

@jhpalmieri

This comment has been minimized.

@jhpalmieri

This comment has been minimized.

@sagetrac-mhampton
Copy link
Mannequin

sagetrac-mhampton mannequin commented Jul 10, 2009

comment:4

The change of tiny to some sort of float value seems kind of odd, could this be avoided somehow?

119 {'major': 3, 'minor': 2, 'tiny': 1.2, 'prerelease': False}.
125 {'major': 3, 'minor': 2, 'tiny': 1.200..., 'prerelease': False}.

@dandrake
Copy link
Contributor

comment:5

Replying to @sagetrac-mhampton:

The change of tiny to some sort of float value seems kind of odd, could this be avoided somehow?

119 {'major': 3, 'minor': 2, 'tiny': 1.2, 'prerelease': False}.
125 {'major': 3, 'minor': 2, 'tiny': 1.200..., 'prerelease': False}.

I agree that's a bit weird, but when we do really 'use' the value of tiny? If we just print it, it should be fine; even when there's some actual comparisons being done, I think there won't be any trouble with the floating point numbers. I'll think about this some more, but it seems okay to me.

BTW, I'm working on reviewing this.

@dandrake
Copy link
Contributor

comment:6

This patch looks good, but I did try to use -sdist and am having some problems. I'm not sure if the problem is with the patch or with my use of -sdist. (Almost certainly the latter!)

I compiled a source tarball (4.1.rc1), applied the patch (with mq), did a qfinish to get the patch into the regular history, and then tried ./sage -sdist 4.1.rc2 to try and make a fictional rc2 to see if, after compiling, I got the correct banner.

The sdist script spit out some strange errors, but did create a tarball. I'm compiling that tarball now, but local/bin/sage-banner is an empty file!

Also, doing an sdist leaves behind a zombie tree: it looks like it's there, but if you try to run Sage, it doesn't work. This is because of #1065 (!) but even if I do a sage -b, when I rerun Sage, I don't get a banner...which is worrisome since that's what this ticket is about.

I do notice that when I try to emulate the sage-sdist script and run the line that sets the banner, this happens. This is from a "sage -sh" shell:

rake@sage.math:/scratch/drake/sage-4.1.rc1/local/bin$ echo "import sage.misc.banner; sage.misc.banner.banner()" | ./python
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/scratch/drake/sage-4.1.rc1/local/lib/python2.6/site-packages/sage/misc/banner.py", line 95, in banner
    print banner_text() 
  File "/scratch/drake/sage-4.1.rc1/local/lib/python2.6/site-packages/sage/misc/banner.py", line 68, in banner_text
    pre = version_dict()['prerelease']
  File "/scratch/drake/sage-4.1.rc1/local/lib/python2.6/site-packages/sage/misc/banner.py", line 136, in version_dict
    from sage.rings.integer import Integer
  File "integer.pyx", line 156, in sage.rings.integer (sage/rings/integer.c:31017)
  File "/scratch/drake/sage-4.1.rc1/local/lib/python2.6/site-packages/sage/rings/infinity.py", line 200, in <module>
    import sage.rings.rational
  File "rational.pyx", line 70, in sage.rings.rational (sage/rings/rational.c:23686)
  File "real_mpfr.pyx", line 1, in sage.rings.real_mpfr (sage/rings/real_mpfr.c:29109)
  File "complex_number.pxd", line 8, in sage.libs.mpmath.utils (sage/libs/mpmath/utils.c:5273)
  File "complex_double.pxd", line 13, in sage.rings.complex_number (sage/rings/complex_number.c:14050)
  File "complex_double.pyx", line 88, in sage.rings.complex_double (sage/rings/complex_double.c:13486)
  File "/scratch/drake/sage-4.1.rc1/local/lib/python2.6/site-packages/sage/rings/complex_field.py", line 86, in ComplexField
    C = ComplexField_class(prec)
  File "/scratch/drake/sage-4.1.rc1/local/lib/python2.6/site-packages/sage/rings/complex_field.py", line 175, in __init__
    ParentWithGens.__init__(self, self._real_field(), ('I',), False)
  File "/scratch/drake/sage-4.1.rc1/local/lib/python2.6/site-packages/sage/rings/complex_field.py", line 228, in _real_field
    self.__real_field = real_mpfr.RealField_constructor(self._prec)
  File "real_mpfr.pyx", line 244, in sage.rings.real_mpfr.RealField_constructor (sage/rings/real_mpfr.c:3853)
TypeError: 'NoneType' object is unsubscriptable

Looks like something fishy in the bit of code that makes the version dictionary. I'll look at this more later, if no one beats to me. BTW, this did pass doctests, so either something is really goofy about the environment above, or we a fix and a new doctest.

@dandrake
Copy link
Contributor

comment:7

Okay, I took a 4.1.rc1 source tarball, compiled it, make a little change, then sdisted it...and it appears to work fine. No significant error messages, and I think the resulting sage-banner file works. So there's something going on with this patch.

BTW, above I meant to end with "or we need a fix and a new doctest."

@jhpalmieri
Copy link
Member Author

comment:8

Here is a new version of the patch which doesn't give me this error message.

@jhpalmieri
Copy link
Member Author

Attachment: trac_6505_prerelease.patch.gz

@jhpalmieri
Copy link
Member Author

comment:9

Replying to @dandrake:

Replying to @sagetrac-mhampton:

The change of tiny to some sort of float value seems kind of odd, could this be avoided somehow?

119 {'major': 3, 'minor': 2, 'tiny': 1.2, 'prerelease': False}.
125 {'major': 3, 'minor': 2, 'tiny': 1.200..., 'prerelease': False}.

I agree that's a bit weird, but when we do really 'use' the value of tiny? If we just print it, it should be fine; even when there's some actual comparisons being done, I think there won't be any trouble with the floating point numbers. I'll think about this some more, but it seems okay to me.

Right: I think in recent history, tiny has been an integer, and in this case it prints like an integer. Allowing it to have digits beyond the decimal point is "just in case". If it is a float, we can print it when needed with as many decimal places as we want.

@dandrake
Copy link
Contributor

comment:10

I'll try to look at the new patch soon. I'm now at a conference and may not have a lot of time, but at the end of this week, the conference will transmogrify into "*-combinat" (http://wiki.sagemath.org/combinat/FPSAC09) so I'll definitely be able to devote time to reviewing by then.

@dandrake
Copy link
Contributor

comment:11

Positive review. This took me a while, since I didn't really know how to use -sdist, but it does work as advertised.

@dandrake
Copy link
Contributor

Reviewer: Dan Drake

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Jul 27, 2009

Merged: Sage 4.1.1.alpha1

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

2 participants