Re: [sage-devel] Meaning of --optional=sage in doctests

2018-08-30 Thread Timo Kaufmann
Also see the solutions I and jhpalmieri proposed in #26159[1].  I like those
better because they still makes it possible to run optional doctests without
running all of sages doctests. I think that is very valuable. The current
example that started the discussion (very limited in scope) in #26110[2] is
building and testing sage and its docs seperately from each other. That is
probably the most important usecase. In a more generalized scenario I can
imagine first building and testing a bare sage and then testing each 
optional
package after it was added.

[1] https://trac.sagemath.org/ticket/26159
[2] https://trac.sagemath.org/ticket/26110

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Meaning of --optional=sage in doctests

2018-08-30 Thread Erik Bray
On Thu, Aug 30, 2018 at 11:04 AM Jeroen Demeyer  wrote:
>
> At #26110 we noticed that the --optional option for doctests is really
> strange when you don't specify "sage" as one of the optional packages.
>
> Here is how things currently work: any doctest line which doesn't
> contain any other tag (like "# optional - mypkg" or even "# long time")
> is treated as if it had "# optional - sage". In other words: if you run
> doctests with --optional=mypkg (without "sage"), then you are running
> only tests containing "# optional - mypkg". If you use "--long
> --optional=mypkg", then you run all "# long time" tests and all "#
> optional - mypkg" tests.
>
> Needless to say, this is useless: tests almost never pass when run this
> way. The implementation looks deliberately designed, so strictly
> speaking it's not a bug. Still, I think that it's something that we
> should change.

I have observed this as well, and it's very annoying.  I haven't given
it much thought though.

> I can see two solutions:
>
> 1. Get rid of "--optional=sage" completely. An added bonus is that this
> would slightly simplify the doctest framework.
>
> 2. Interpret all "sage:" prompts (as opposed to ">>>" prompts) as
> implying "# optional - sage". This means that a line like
>
>  sage: do_something()  # optional - mypkg
>
> would only be run under --optional=sage,mypkg but a line like
>
>  >>> do_something()  # optional - mypkg
>
> would be run with --optional=mypkg

Although more complicated, I kind of like this solution.  From a
long-term perspective I think it would be good to make Sage's doctest
framework into a separate package that can be more easily used by
other projects (especially Sage-affiliated projects).  That is
admittedly a longer-term goal though, for which I have no immediate
plans.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Meaning of --optional=sage in doctests

2018-08-30 Thread Michael Orlitzky
On 08/30/2018 05:04 AM, Jeroen Demeyer wrote:
> 
> I can see two solutions:
> 
> 1. Get rid of "--optional=sage" completely. An added bonus is that this 
> would slightly simplify the doctest framework.

This is probably fine. Now that we have a grown-up build system, I see
this as a consequence of a larger improvement. The way that most test
suites work is that they test only the features that were enabled at
build time. So, for example,

  ./configure --with-mathematica=/usr/local/bin/mathematica

would build you a sage with mathematica support. The configure script
would check that the binary exists and doesn't crash, and the "optional"
mathematica tests would be run unconditionally under the resulting sage.

We would still need separate long-time and internet test suites, but
most of the "optional" test suites (including --optional=sage, since
"sage support" is always enabled) could be eliminated in the same fashion.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Meaning of --optional=sage in doctests

2018-08-30 Thread Jeroen Demeyer
At #26110 we noticed that the --optional option for doctests is really 
strange when you don't specify "sage" as one of the optional packages.


Here is how things currently work: any doctest line which doesn't 
contain any other tag (like "# optional - mypkg" or even "# long time") 
is treated as if it had "# optional - sage". In other words: if you run 
doctests with --optional=mypkg (without "sage"), then you are running 
only tests containing "# optional - mypkg". If you use "--long 
--optional=mypkg", then you run all "# long time" tests and all "# 
optional - mypkg" tests.


Needless to say, this is useless: tests almost never pass when run this 
way. The implementation looks deliberately designed, so strictly 
speaking it's not a bug. Still, I think that it's something that we 
should change.


I can see two solutions:

1. Get rid of "--optional=sage" completely. An added bonus is that this 
would slightly simplify the doctest framework.


2. Interpret all "sage:" prompts (as opposed to ">>>" prompts) as 
implying "# optional - sage". This means that a line like


sage: do_something()  # optional - mypkg

would only be run under --optional=sage,mypkg but a line like

>>> do_something()  # optional - mypkg

would be run with --optional=mypkg

--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.